libgomp/testsuite/libgomp.c/pr80394.c
raw| 1 | /* PR libgomp/80394 */ |
| 2 | |
| 3 | int |
| 4 | main () |
| 5 | { |
| 6 | int x = 0; |
| 7 | #pragma omp parallel shared(x) |
| 8 | #pragma omp single |
| 9 | { |
| 10 | #pragma omp task depend(inout: x) |
| 11 | { |
| 12 | for (int i = 0; i < 100000; i++) |
| 13 | asm volatile ("" : : : "memory"); |
| 14 | x += 5; |
| 15 | } |
| 16 | #pragma omp task if (0) depend(inout: x) |
| 17 | ; |
| 18 | if (x != 5) |
| 19 | __builtin_abort (); |
| 20 | } |
| 21 | return 0; |
| 22 | } |