| 1 |
/* N3355 - Named loops. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 |
|
| 5 |
void |
| 6 |
foo (int w) |
| 7 |
{ |
| 8 |
d: e: f:; |
| 9 |
a: b: c: |
| 10 |
for (int x = 0; x < 32; ++x) |
| 11 |
{ |
| 12 |
if (x == 0) |
| 13 |
continue a; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 14 |
else if (x == 1) |
| 15 |
continue b; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 16 |
else if (x == 2) |
| 17 |
continue c; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 18 |
else if (x == 31) |
| 19 |
break b; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 20 |
} |
| 21 |
int y = 0; |
| 22 |
g: h: |
| 23 |
#pragma GCC unroll 2 |
| 24 |
while (y < 16) |
| 25 |
{ |
| 26 |
++y; |
| 27 |
if (y == 12) |
| 28 |
continue g; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 29 |
else if (y == 13) |
| 30 |
continue h; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 31 |
else if (y == 14) |
| 32 |
break g; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 33 |
} |
| 34 |
i: j:; |
| 35 |
k: l: |
| 36 |
switch (y) |
| 37 |
{ |
| 38 |
case 6: |
| 39 |
break; |
| 40 |
case 7: |
| 41 |
break k; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 42 |
case 8: |
| 43 |
break l; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 44 |
} |
| 45 |
m: n: o: p: |
| 46 |
for (int x = 0; x < 2; ++x) |
| 47 |
q: r: s: t: |
| 48 |
switch (x) |
| 49 |
{ |
| 50 |
case 0: |
| 51 |
u: v: |
| 52 |
case 3: |
| 53 |
w: x: |
| 54 |
for (int y = 0; y < 2; ++y) |
| 55 |
y: z: |
| 56 |
for (int z = 0; z < 2; ++z) |
| 57 |
aa: ab: ac: |
| 58 |
for (int a = 0; a < 2; ++a) |
| 59 |
ad: ae: af: |
| 60 |
switch (a) |
| 61 |
{ |
| 62 |
case 0: |
| 63 |
if (w == 0) |
| 64 |
break ae; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 65 |
else if (w == 1) |
| 66 |
break ab; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 67 |
else if (w == 2) |
| 68 |
break z; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 69 |
else if (w == 3) |
| 70 |
break v; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 71 |
else if (w == 4) |
| 72 |
break s; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 73 |
else if (w == 5) |
| 74 |
break p; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 75 |
else if (w == 6) |
| 76 |
break; |
| 77 |
else if (w == 7) |
| 78 |
continue aa; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 79 |
else if (w == 8) |
| 80 |
continue y; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 81 |
else if (w == 9) |
| 82 |
continue x; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 83 |
else if (w == 10) |
| 84 |
continue m; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 85 |
ag: ah: |
| 86 |
do |
| 87 |
{ |
| 88 |
if (w == 11) |
| 89 |
break ag; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 90 |
else |
| 91 |
continue ah; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 92 |
} |
| 93 |
while (0); |
| 94 |
break; |
| 95 |
default: |
| 96 |
break; |
| 97 |
} |
| 98 |
break; |
| 99 |
default: |
| 100 |
break; |
| 101 |
} |
| 102 |
[[]] [[]] ai: |
| 103 |
[[]] [[]] aj: |
| 104 |
[[]] [[]] ak: |
| 105 |
[[]] [[]] [[]] |
| 106 |
for (int x = 0; x < 32; ++x) |
| 107 |
if (x == 31) |
| 108 |
break ak; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 109 |
else if (x == 30) |
| 110 |
break aj; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 111 |
else if (x == 29) |
| 112 |
continue ai; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 113 |
al: |
| 114 |
[[]] am: |
| 115 |
[[]] |
| 116 |
do |
| 117 |
{ |
| 118 |
if (w == 42) |
| 119 |
continue am; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 120 |
else if (w == 41) |
| 121 |
break al; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 122 |
} |
| 123 |
while (1); |
| 124 |
an: |
| 125 |
[[]] ao: |
| 126 |
[[]] [[]] |
| 127 |
while (w) |
| 128 |
{ |
| 129 |
if (w == 40) |
| 130 |
break ao; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 131 |
else if (w == 39) |
| 132 |
continue an; /* { dg-error "ISO C does not support 'continue' statement with an identifier operand before" } */ |
| 133 |
} |
| 134 |
[[]] ap: |
| 135 |
[[]] aq: |
| 136 |
[[]] |
| 137 |
switch (w) |
| 138 |
{ |
| 139 |
case 42: |
| 140 |
break ap; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 141 |
default: |
| 142 |
break aq; /* { dg-error "ISO C does not support 'break' statement with an identifier operand before" } */ |
| 143 |
} |
| 144 |
} |