]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libgomp/lib/contrib/gcc-4.3/libgomp/testsuite/libgomp.c++/pr35185.C
Inital import
[l4.git] / l4 / pkg / libgomp / lib / contrib / gcc-4.3 / libgomp / testsuite / libgomp.c++ / pr35185.C
1 // PR middle-end/35185
2 // { dg-do run }
3
4 extern "C" void abort ();
5
6 struct S
7 {
8   S () : s (6) {}
9   ~S () {}
10   int s;
11 };
12
13 __attribute__((noinline))
14 bool
15 bar (S s)
16 {
17   return s.s != 6;
18 }
19
20 int
21 main ()
22 {
23   S s;
24   int err = 0;
25 #pragma omp parallel shared (s)
26   {
27     if (bar (s))
28       #pragma omp atomic
29         err++;
30   }
31   if (err)
32     abort ();
33 }