PR tree-optimization/67955
[official-gcc.git] / gcc / testsuite / c-c++-common / Wimplicit-fallthrough-18.c
blob2c8a3cb98b3be2510e64e2b2f9c7885f1b8b1487
1 /* PR c/7652 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wimplicit-fallthrough" } */
5 /* Testing some loops. */
7 int f (void);
9 int
10 g (int i)
12 switch (i)
14 case 0:
15 for (;;)
17 if (f ()) /* { dg-warning "statement may fall through" "fall through" { xfail *-*-* } } */
18 break;
20 case 1:
21 return 1;
23 return 0;
26 int
27 h (int i)
29 switch (i)
31 case 0:
34 if (f ()) /* { dg-warning "statement may fall through" } */
35 break;
37 while (0);
38 case 1:
39 return 1;
41 return 0;