1 /* { dg-do compile } */ 2 /* { dg-options "-fgnu-tm" } */ 3 4 extern void baz(int); 5 6 int y; foo(volatile int x)7void foo(volatile int x) 8 { 9 __transaction_atomic { 10 x = 5; /* { dg-error "invalid volatile use of 'x' inside transaction" } */ 11 x += y; 12 y++; 13 } 14 baz(x); 15 } 16 17 18 volatile int i = 0; 19 george()20void george() 21 { 22 __transaction_atomic { 23 if (i == 2) /* { dg-error "invalid volatile use of 'i' inside transaction" } */ 24 i = 1; 25 } 26 } 27