Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / Wswitch-unreachable-1.c
blobee6ecc1c37cf44f739afff5a370ee370877f8e88
1 /* PR c/49859 */
2 /* { dg-do compile } */
4 extern void foo (int);
5 extern int j;
7 void
8 fn0 (int i)
10 switch (i)
12 int k;
13 case 1:
14 k = 11;
15 foo (k);
18 switch (i)
19 j = 10; /* { dg-warning "statement will never be executed" } */
21 switch (i)
24 switch (i)
26 j = 12; /* { dg-warning "statement will never be executed" } */
27 default:
28 foo (j);
31 int o;
32 switch (i)
34 o = 333; /* { dg-warning "statement will never be executed" } */
35 case 4: break;
36 default:
37 foo (o);
40 switch (i)
41 switch (j) /* { dg-warning "statement will never be executed" } */
43 o = 42; /* { dg-warning "statement will never be executed" } */
44 case 8:;
47 switch (i)
49 int l = 3; /* { dg-warning "statement will never be executed" } */
50 o = 5;
51 j = 7;
52 ++l;
55 switch (i)
57 int x;
58 int l = 3; /* { dg-warning "statement will never be executed" } */
59 ++l, ++x;
62 switch (i)
63 if (j != 3) /* { dg-warning "statement will never be executed" } */
64 foo (j);
66 switch (i)
67 while (1)
68 foo (0);
70 switch (i)
71 while (i > 5) { }
73 switch (i)
74 goto X; /* { dg-warning "statement will never be executed" } */
77 switch (i)
79 foo (1);
80 while (1);
82 switch (i)
83 for (;;)
84 foo (-1);
86 switch (i)
87 default:
88 j = 6;
90 switch (i)
92 typedef int T;
93 case 3:
95 T x = 5;
96 foo (x);
100 switch (i)
102 static int g;
103 default:
104 foo (g);
107 switch (i)
110 j = 16;
111 default:
112 if (j < 5)
113 goto L;
114 break;