Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / Wimplicit-fallthrough-8.c
blobd146c788b7409487736d22ad547aa0e430d1e1bf
1 /* PR c/7652 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wimplicit-fallthrough" } */
5 extern void grace (int);
7 void
8 fn1 (int i)
10 switch (i)
11 case 1:
12 if (i == 5)
13 grace (0);
14 else
15 goto done;
16 done:;
19 void
20 fn2 (int i)
22 switch (i)
24 case 1:
25 if (i == 5) /* { dg-warning "statement may fall through" } */
26 grace (0);
27 else
28 goto done;
29 case 2:
30 --i;
32 done:;
35 void
36 fn3 (int i)
38 switch (i)
40 case 1:
41 if (i == 5)
42 goto done;
43 else
44 goto done;
46 done:;
49 void
50 fn4 (int i)
52 switch (i)
54 case 1:
55 if (i == 5)
57 grace (1);
58 goto done;
60 else
61 goto done;
62 case 2:;
64 done:;
67 void
68 fn5 (int i)
70 switch (i)
72 case 1:
73 if (i == 5)
75 grace (1);
76 goto done;
78 else
79 grace (4); /* { dg-warning "statement may fall through" } */
80 case 2:
81 grace (9);
83 done:;
86 void
87 fn6 (int i)
89 switch (i)
91 case 1:
92 if (i == 5) /* { dg-warning "statement may fall through" } */
94 grace (1);
95 goto done;
97 case 2:
98 grace (8);
100 done:;