PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / Wimplicit-fallthrough-20.c
blobd37a840a0d930a08276c5b4c4448662ebda32b73
1 /* PR c/7652 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wimplicit-fallthrough" } */
5 int
6 f (int i)
8 switch (i)
10 case -1:
11 __attribute__((fallthrough));
12 default:
13 __attribute__((fallthrough));
14 case 1:
15 return 6;
16 case 2 ... 4:
17 __attribute__((fallthrough));
18 case 5:
19 return 7;
21 return 0;
24 int
25 g (int i)
27 switch (i)
29 case -1:
30 __attribute__((used)); /* { dg-warning "ignored|only attribute" } */
31 default:
32 __attribute__((used)); /* { dg-warning "ignored|only attribute" } */
33 case 1:
34 return 6;
35 case 2 ... 4:
36 __attribute__((used)); /* { dg-warning "ignored|only attribute" } */
37 case 5:
38 return 7;
40 return 0;