libgomp/testsuite/libgomp.c-c++-common/task-detach-12.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-fopenmp" } */ |
| 3 | |
| 4 | #include <omp.h> |
| 5 | |
| 6 | int |
| 7 | main () |
| 8 | { |
| 9 | struct S { int a[7]; } s = { { 1, 2, 3, 4, 5, 6, 7 } }; |
| 10 | omp_event_handle_t x; |
| 11 | #pragma omp parallel master |
| 12 | #pragma omp task firstprivate (s) detach (x) |
| 13 | { |
| 14 | if (s.a[3] != 4) |
| 15 | __builtin_abort (); |
| 16 | omp_fulfill_event (x); |
| 17 | } |
| 18 | return 0; |
| 19 | } |