AVR: Assert minimal required bit width of section_common::flags.
[gcc.git] / libgomp / testsuite / libgomp.c / task-6.c
blobe5fc758d2834c1e8167d83b27dc46e4a3ca17d6c
1 #include <stdlib.h>
2 #include <unistd.h>
4 int
5 main ()
7 int x = 0, y = 0;
8 #pragma omp parallel shared(x, y)
9 #pragma omp master
11 #pragma omp task depend(out:y) shared(x, y)
13 sleep (1);
14 x = 1;
15 y = 1;
17 #pragma omp task depend(inout:y) shared(x, y)
19 if (x != 1 || y != 1)
20 abort ();
21 y++;
24 if (x != 1 || y != 2)
25 abort ();
26 x = 0;
27 y = 0;
28 #pragma omp parallel
29 #pragma omp master
31 #pragma omp task depend(out:y)
33 sleep (1);
34 x = 1;
35 y = 1;
37 #pragma omp task depend(inout:y)
39 if (x != 1 || y != 1)
40 abort ();
41 y++;
44 if (x != 1 || y != 2)
45 abort ();
46 return 0;