| 1 |
/* { dg-do compile { target c++11 } } */ |
| 2 |
|
| 3 |
/* This test case is expected to fail due to errors. */ |
| 4 |
|
| 5 |
/* Test that the imperfectly-nested loops with the ordered clause gives |
| 6 |
an error, and that there is only one error (and not one on every |
| 7 |
intervening statement). */ |
| 8 |
|
| 9 |
int f1 (int depth, int iter); |
| 10 |
int f2 (int depth, int iter); |
| 11 |
|
| 12 |
void s1 (int a1, int a2, int a3) |
| 13 |
{ |
| 14 |
int i, j, k; |
| 15 |
|
| 16 |
[[ omp :: directive (for, ordered(3)) ]] |
| 17 |
for (i = 0; i < a1; i++) /* { dg-error "inner loops must be perfectly nested" } */ |
| 18 |
{ |
| 19 |
f1 (0, i); |
| 20 |
for (j = 0; j < a2; j++) |
| 21 |
{ |
| 22 |
f1 (1, j); |
| 23 |
for (k = 0; k < a3; k++) |
| 24 |
{ |
| 25 |
f1 (2, k); |
| 26 |
f2 (2, k); |
| 27 |
} |
| 28 |
f2 (1, j); |
| 29 |
} |
| 30 |
f2 (0, i); |
| 31 |
} |
| 32 |
} |
| 33 |
|