2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / wtr-label-1.c
blob78a4d6b0a4b6934b3f920b98493a60d958ffa551
1 /* Test for -Wtraditional warnings on label conflicts with identifiers.
2 Note, gcc should omit these warnings in system header files.
3 Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000. */
4 /* { dg-do compile } */
5 /* { dg-options "-Wtraditional" } */
7 enum foo1 { a };
8 struct foo2 { int i; };
9 union foo3 { int j; };
10 int foo4;
11 typedef int foo5;
13 void
14 testfunc1 (foo6)
15 int foo6;
17 int foo7;
19 foo1:
20 foo2:
21 foo3:
22 foo4: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
23 foo5: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
24 foo6: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
25 foo7: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
26 testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
27 a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
29 j: ;
32 # 32 "sys-header.h" 3
33 /* We are in system headers now, no -Wtraditional warnings should issue. */
35 void
36 testfunc2 (foo6)
37 int foo6;
39 int foo7;
41 foo1:
42 foo2:
43 foo3:
44 foo4:
45 foo5:
46 foo6:
47 foo7:
48 testfunc2:
51 j: ;