libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu99-named-loops-2.c
blob46c6ba8e602d1b12d18e35adf51a035ccc8b72af
1 /* N3355 - Named loops. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=gnu99" } */
5 void
6 foo (int x)
8 label1:
9 for (int i = 0; i < 16; ++i)
10 another_label1:
11 for (int j = 0; j < 16; ++j)
12 break label2; /* { dg-error "'break' statement operand 'label2' does not refer to a named loop or 'switch'; did you mean 'label1'\\\?" } */
13 for (int i = 0; i < 16; ++i)
14 break label3; /* { dg-error "'break' statement operand 'label3' does not refer to a named loop or 'switch'" } */
15 label4: /* { dg-message "'switch' name defined here" } */
16 switch (x)
18 case 0:
19 for (int i = 0; i < 16; ++i)
20 continue label5; /* { dg-error "'continue' statement operand 'label5' does not refer to a named loop" } */
21 break label4;
22 case 1:
23 for (int i = 0; i < 16; ++i)
24 continue label4; /* { dg-error "'continue' statement operand 'label4' refers to a named 'switch'" } */
26 label6:
27 for (int i = 0; i < 16; ++i)
28 continue label7; /* { dg-error "'continue' statement operand 'label7' does not refer to a named loop; did you mean 'label6'\\\?" } */
29 label2:
30 for (int i = 0; i < 16; ++i)
32 label8:;
33 for (int i = 0; i < 16; ++i)
34 break label8; /* { dg-error "'break' statement operand 'label8' does not refer to a named loop or 'switch'" } */
35 label9:;
36 for (int i = 0; i < 16; ++i)
37 continue label9; /* { dg-error "'continue' statement operand 'label9' does not refer to a named loop" } */
38 label10:
40 switch (x)
42 case 0:
43 break label10; /* { dg-error "'break' statement operand 'label10' does not refer to a named loop or 'switch'" } */