Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr34513.c
blob76c7ac1f3a54c0833da1489964d0aecaef686506
1 /* PR c++/34513 */
2 /* { dg-do run } */
4 #include <omp.h>
6 extern void abort ();
8 static int errors = 0;
9 static int thrs = 4;
11 int
12 main ()
14 omp_set_dynamic (0);
16 #pragma omp parallel num_threads (thrs)
18 static int shrd = 0;
20 #pragma omp atomic
21 shrd += 1;
23 #pragma omp barrier
25 if (shrd != thrs)
26 #pragma omp atomic
27 errors += 1;
30 if (errors)
31 abort ();
32 return 0;