OSDN Git Service

* Makefile.in (local-distclean): Remove leftover built files.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / wtr-label-1.c
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" } */
6
7 enum foo1 { a };
8 struct foo2 { int i; };
9 union foo3 { int j; };
10 int foo4;
11 typedef int foo5;
12
13 void
14 testfunc1 (int foo6)
15 {
16   int foo7;
17
18  foo1:
19  foo2:
20  foo3:
21  foo4: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
22  foo5: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
23  foo6: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
24  foo7: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
25  testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
26  a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
27  i:
28  j: ;
29 }
30   
31 # 32 "sys-header.h" 3
32 /* We are in system headers now, no -Wtraditional warnings should issue.  */
33
34 void
35 testfunc2 (int foo6)
36 {
37   int foo7;
38
39  foo1:
40  foo2:
41  foo3:
42  foo4:
43  foo5:
44  foo6:
45  foo7:
46  testfunc2:
47  a:
48  i:
49  j: ;
50 }