* gcc.dg/anon-struct-6.c, gcc.dg/anon-struct-7.c,
[official-gcc.git] / gcc / testsuite / gcc.dg / label-decl-2.c
blob5ec124b52bb8e479e354e4ee8439d6833e8af8d2
1 /* Test diagnostics for label declarations. Test with -pedantic. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "-pedantic" } */
6 typedef int b;
8 void
9 f (void)
11 __label__ a, b, c, d;
12 __extension__ (void)&&d; /* { dg-error "error: label 'd' used but not defined" } */
13 /* { dg-warning "warning: ISO C forbids label declarations" "label decls" { target *-*-* } 12 } */
14 goto c; /* { dg-error "error: label 'c' used but not defined" } */
15 a: (void)0;
16 b: (void)0;