1 /* Tests for labels before declarations and at ends of compound statements. */ 2 /* { dg-do compile } */ 3 /* { dg-options "-std=c11 -pedantic-errors" } */ 4 f(int x)5int f(int x) 6 { 7 goto b; 8 a: int i = 2 * x; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */ 9 goto c; 10 b: goto a; 11 { i *= 3; c: } /* { dg-error "label at end of compound statement" } */ 12 return i; 13 d: /* { dg-error "label at end of compound statement" } */ 14 } 15 16