gcc/testsuite/c-c++-common/gomp/pr53580.c
raw| 1 | /* PR middle-end/53580 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-fopenmp" } */ |
| 4 | |
| 5 | int |
| 6 | main () |
| 7 | { |
| 8 | int x, y, v = 0; |
| 9 | |
| 10 | #pragma omp parallel |
| 11 | #pragma omp for |
| 12 | for (x = 0; x < 10; x++) |
| 13 | { |
| 14 | #pragma omp for reduction(+: v) /* { dg-error "work-sharing region may not be closely nested inside of work-sharing" } */ |
| 15 | for (y = 0; y < 10; y++) |
| 16 | v++; |
| 17 | } |
| 18 | return v - 100; |
| 19 | } |