2017-09-26 Thomas Koenig <tkoenig@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / label-decl-2.c
blob3ebe290a2709507aa9afc01eb1bbd931256d81be
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; /* { dg-warning "ISO C forbids label declarations" "label decls" } */
12 __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */
13 goto c; /* { dg-error "label 'c' used but not defined" } */
14 a: (void)0;
15 b: (void)0;