Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / c-c++-common / tm / volatile-1.c
blob40b41803555b84cbdbf365c30ef29d34434ade91
1 // Transaction-unsafe testcase from TM TS.
2 // { dg-options -fgnu-tm }
4 volatile int * p = 0;
5 __attribute ((transaction_safe))
6 void f() {
7 int x = 0; // ok: not volatile
8 p = &x; // ok: the pointer is not volatile
9 int i = *p; // { dg-error "volatile" "read through volatile glvalue" }