libgomp/testsuite/libgomp.oacc-c-c++-common/pr90009.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | #include <stdlib.h> |
| 4 | |
| 5 | #define N 100 |
| 6 | |
| 7 | int data[N]; |
| 8 | |
| 9 | int |
| 10 | main (void) |
| 11 | { |
| 12 | int n = N, b = 3; |
| 13 | #pragma acc parallel num_workers(2) |
| 14 | { |
| 15 | int c; |
| 16 | if (n) |
| 17 | c = 0; |
| 18 | else |
| 19 | c = b; |
| 20 | |
| 21 | #pragma acc loop worker |
| 22 | for (int i = 0; i < n; i++) |
| 23 | data[i] = 1; |
| 24 | |
| 25 | if (c) |
| 26 | data[0] = 2; |
| 27 | } |
| 28 | |
| 29 | for (int i = 0; i < n; i++) |
| 30 | if (data[i] != 1) |
| 31 | abort (); |
| 32 | |
| 33 | return 0; |
| 34 | } |