Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/Wswitch-unreachable-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* PR c/49859 */ /* { dg-do compile } */ /* { dg-options "-Wswitch-unreachable" } */ extern void foo (int); extern int j; void fn0 (int i) { switch (i) { int t = 10; /* { dg-warning "statement will never be executed" } */ default: foo (t); } switch (i) { /* { dg-warning "statement will never be executed" } */ int A[i]; default: /* { dg-error "switch jumps into scope" } */ break; } switch (i) default: j = sizeof (struct { int i; }); switch (i) { int A[3]; default: break; } }