Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c / task-5.c
blobbf44ddd012b622e7376c3b6c4e4881761bb1bffd
1 /* { dg-do run } */
3 #include <omp.h>
4 #include <stdlib.h>
6 int serr;
8 int
9 main ()
11 int e;
12 #pragma omp parallel shared(serr)
14 if (omp_in_final ())
15 #pragma omp atomic write
16 serr = 1;
17 #pragma omp task if (0) shared(serr)
19 if (omp_in_final ())
20 #pragma omp atomic write
21 serr = 1;
22 #pragma omp task if (0) shared(serr)
23 if (omp_in_final ())
24 #pragma omp atomic write
25 serr = 1;
27 #pragma omp task final (1) shared(serr)
29 if (!omp_in_final ())
30 #pragma omp atomic write
31 serr = 1;
32 #pragma omp taskyield
33 #pragma omp taskwait
34 #pragma omp task shared(serr)
35 if (!omp_in_final ())
36 #pragma omp atomic write
37 serr = 1;
40 #pragma omp atomic read
41 e = serr;
42 if (e)
43 abort ();
44 return 0;