* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-vla-jump-5.c
blob5b5fc74f2e9dc9623ad3649ab7bd30c21abab770
1 /* Test for labels and VM declarations: bug 12913.
2 switch statements must not jump into the scope of VM declarations.
4 c99-vla-jump-1.c tests with just that label and goto, VLAs.
5 c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
6 c99-vla-jump-3.c tests with just that label and goto, VM.
7 c99-vla-jump-4.c tests with many other labels and gotos, VM.
8 c99-vla-jump-5.c tests with switch statements. */
10 /* Origin: Joseph Myers <joseph@codesourcery.com> */
11 /* { dg-do compile } */
12 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
14 void
15 f (int a, int b)
17 switch (a) { /* { dg-warning "statement will never be executed" } */
18 int v[b];
19 case 2: /* { dg-error "switch jumps into scope of identifier with variably modified type" } */
20 default: /* { dg-error "switch jumps into scope of identifier with variably modified type" } */
21 switch (a)
23 case 4:
24 { int z[b]; }
25 default:
27 int w[b];
32 /* Match extra informative notes. */
33 /* { dg-message "note: switch starts here" "note: starts" { target *-*-* } 0 } */
34 /* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */