]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Wswitch-unreachable-1.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Wswitch-unreachable-1.c
CommitLineData
a7dc5980
MP
1/* PR c/49859 */
2/* { dg-do compile } */
3/* { dg-options "-Wswitch-unreachable" } */
4
5extern void foo (int);
6extern int j;
7
8void
9fn0 (int i)
10{
11 switch (i)
12 {
13 int t = 10; /* { dg-warning "statement will never be executed" } */
14 default:
15 foo (t);
16 }
17
18 switch (i)
19 { /* { dg-warning "statement will never be executed" } */
20 int A[i];
21 default: /* { dg-error "switch jumps into scope" } */
22 break;
23 }
24
25 switch (i)
26 default:
27 j = sizeof (struct { int i; });
28
29 switch (i)
30 {
31 int A[3];
32 default:
33 break;
34 }
35}