* gcc.dg/i386-fpcvt-1.c: New test.
[official-gcc.git] / gcc / testsuite / gcc.dg / Wswitch-default.c
blob3cc7f2ef0918357606246c58c1bf0f5c78ca0666
1 /* { dg-do compile } */
2 /* { dg-options "-Wswitch-default" } */
4 enum e { e1, e2 };
6 int
7 foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
8 enum e em, enum e en, enum e eo, enum e ep)
10 switch (i)
12 case 1: return 1;
13 case 2: return 2;
14 } /* { dg-warning "switch missing default case" } */
15 switch (j)
17 case 3: return 4;
18 case 4: return 3;
19 default: break;
21 switch (ei)
22 { /* { dg-warning "switch missing default case" } */
24 switch (ej)
26 default: break;
28 switch (ek)
30 case e1: return 1;
31 } /* { dg-warning "switch missing default case" } */
32 switch (el)
34 case e1: return 1;
35 default: break;
37 switch (em)
39 case e1: return 1;
40 case e2: return 2;
41 } /* { dg-warning "switch missing default case" } */
42 switch (en)
44 case e1: return 1;
45 case e2: return 2;
46 default: break;
48 switch (eo)
50 case e1: return 1;
51 case e2: return 2;
52 case 3: return 3;
53 } /* { dg-warning "switch missing default case" } */
54 switch (ep)
56 case e1: return 1;
57 case e2: return 2;
58 case 3: return 3;
59 default: break;
61 return 0;