Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / task-detach-1.c
blob14932b02b9cb239fadcfb1cdb71d9192b9fe41ab
1 /* { dg-do run } */
3 #include <omp.h>
4 #include <assert.h>
6 /* Test chaining of detached tasks, with each task fulfilling the
7 completion event of the previous one. */
9 int main (void)
11 omp_event_handle_t detach_event1, detach_event2;
12 int x = 0, y = 0, z = 0;
14 #pragma omp parallel
15 #pragma omp single
17 #pragma omp task detach (detach_event1)
18 x++;
20 #pragma omp task detach (detach_event2)
22 y++;
23 omp_fulfill_event (detach_event1);
26 #pragma omp task
28 z++;
29 omp_fulfill_event (detach_event2);
33 assert (x == 1);
34 assert (y == 1);
35 assert (z == 1);