* testsuite/libgomp.fortran/vla7.f90: Add -w to options.
[official-gcc.git] / gcc / testsuite / gcc.dg / nested-func-1.c
blobcb26e895e5c0d6e13c6febce90a86264fa2b002c
1 /* Test for proper errors for break and continue in nested functions. */
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "" } */
6 void
7 foo (int a)
9 switch (a) {
10 void bar1 (void) { break; } /* { dg-error "break statement" "break switch 1" } */
12 switch (a) {
13 case 0:
14 (void) 0;
15 void bar2 (void) { break; } /* { dg-error "break statement" "break switch 2" } */
17 while (1) {
18 void bar3 (void) { break; } /* { dg-error "break statement" "break while" } */
20 do {
21 void bar4 (void) { break; } /* { dg-error "break statement" "break do" } */
22 } while (1);
23 for (;;) {
24 void bar5 (void) { break; } /* { dg-error "break statement" "break for" } */
26 while (1) {
27 void bar6 (void) { continue; } /* { dg-error "continue statement" "continue while" } */
29 do {
30 void bar7 (void) { continue; } /* { dg-error "continue statement" "continue do" } */
31 } while (1);
32 for (;;) {
33 void bar8 (void) { continue; } /* { dg-error "continue statement" "continue for" } */