| 1 |
/* Cases which perhaps could be valid in OpenMP one day, but aren't |
| 2 |
accepted right now. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-std=c2y -fopenmp" } */ |
| 5 |
|
| 6 |
void |
| 7 |
foo () |
| 8 |
{ |
| 9 |
label1: |
| 10 |
#pragma omp parallel for |
| 11 |
for (int i = 0; i < 32; ++i) |
| 12 |
if (i == 31) |
| 13 |
continue label1; /* { dg-error "'continue' statement operand 'label1' does not refer to a named loop" } */ |
| 14 |
else |
| 15 |
{ |
| 16 |
label2: |
| 17 |
for (int j = 0; j < 32; ++j) |
| 18 |
if (j == 31) |
| 19 |
continue label2; |
| 20 |
else if (j == 30) |
| 21 |
break label2; |
| 22 |
else if (j == 29) |
| 23 |
continue label1; /* { dg-error "'continue' statement operand 'label1' does not refer to a named loop; did you mean 'label2'\\\?" } */ |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
void |
| 28 |
bar () |
| 29 |
{ |
| 30 |
label1: |
| 31 |
[[omp::directive (parallel for)]] |
| 32 |
for (int i = 0; i < 32; ++i) |
| 33 |
if (i == 31) |
| 34 |
continue label1; /* { dg-error "'continue' statement operand 'label1' does not refer to a named loop" } */ |
| 35 |
else |
| 36 |
{ |
| 37 |
label2: |
| 38 |
for (int j = 0; j < 32; ++j) |
| 39 |
if (j == 31) |
| 40 |
continue label2; |
| 41 |
else if (j == 30) |
| 42 |
break label2; |
| 43 |
else if (j == 29) |
| 44 |
continue label1; /* { dg-error "'continue' statement operand 'label1' does not refer to a named loop; did you mean 'label2'\\\?" } */ |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
void |
| 49 |
baz () |
| 50 |
{ |
| 51 |
label1: |
| 52 |
#pragma omp parallel for collapse(2) |
| 53 |
for (int i = 0; i < 32; ++i) /* { dg-error "not enough nested loops" } */ |
| 54 |
label2: |
| 55 |
for (int j = 0; j < 32; ++j) |
| 56 |
label3: |
| 57 |
for (int k = 0; k < 32; ++k) |
| 58 |
if (k == 31) |
| 59 |
continue label3; |
| 60 |
else if (k == 30) |
| 61 |
break label3; |
| 62 |
else if (k == 29) |
| 63 |
continue label2; |
| 64 |
} |
| 65 |
|
| 66 |
void |
| 67 |
qux () |
| 68 |
{ |
| 69 |
label1: |
| 70 |
[[omp::directive (parallel for, collapse(2))]] |
| 71 |
for (int i = 0; i < 32; ++i) /* { dg-error "not enough nested loops" } */ |
| 72 |
label2: |
| 73 |
for (int j = 0; j < 32; ++j) |
| 74 |
label3: |
| 75 |
for (int k = 0; k < 32; ++k) |
| 76 |
if (k == 31) |
| 77 |
continue label3; |
| 78 |
else if (k == 30) |
| 79 |
break label3; |
| 80 |
else if (k == 29) |
| 81 |
continue label2; |
| 82 |
} |