Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / stmt-expr-label-2.c
blob35b96e830e505d480a2d2e0109aa4760b50d7490
1 /* Test for labels in statement expressions: bugs 772 and 17913.
2 switch statements must not jump into statement expressions. */
4 /* Origin: Joseph Myers <joseph@codesourcery.com> */
5 /* { dg-do compile } */
6 /* { dg-options "" } */
8 void
9 f (int a)
11 switch (a)
13 case 0:
14 case 1:
16 case 2: /* { dg-error "case label in statement expression not containing enclosing switch statement" } */
17 default: /* { dg-error "'default' label in statement expression not containing enclosing switch statement" } */
18 switch (a)
20 case 3:
21 default:
25 });