* gcc.dg/nested-func-1.c: New test.
From-SVN: r73701
This commit is contained in:
parent
0d77ab84bb
commit
fc6d6d62cf
@ -1,3 +1,7 @@
|
||||
2003-11-18 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
* gcc.dg/nested-func-1.c: New test.
|
||||
|
||||
2003-11-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* gcc.dg/cpp/assert4.c: New test.
|
||||
|
35
gcc/testsuite/gcc.dg/nested-func-1.c
Normal file
35
gcc/testsuite/gcc.dg/nested-func-1.c
Normal file
@ -0,0 +1,35 @@
|
||||
/* Test for proper errors for break and continue in nested functions. */
|
||||
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "" } */
|
||||
|
||||
void
|
||||
foo (int a)
|
||||
{
|
||||
switch (a) {
|
||||
void bar1 (void) { break; } /* { dg-error "break statement" "break switch 1" } */
|
||||
}
|
||||
switch (a) {
|
||||
case 0:
|
||||
(void) 0;
|
||||
void bar2 (void) { break; } /* { dg-error "break statement" "break switch 2" } */
|
||||
}
|
||||
while (1) {
|
||||
void bar3 (void) { break; } /* { dg-error "break statement" "break while" } */
|
||||
}
|
||||
do {
|
||||
void bar4 (void) { break; } /* { dg-error "break statement" "break do" } */
|
||||
} while (1);
|
||||
for (;;) {
|
||||
void bar5 (void) { break; } /* { dg-error "break statement" "break for" } */
|
||||
}
|
||||
while (1) {
|
||||
void bar6 (void) { continue; } /* { dg-error "continue statement" "continue while" } */
|
||||
}
|
||||
do {
|
||||
void bar7 (void) { continue; } /* { dg-error "continue statement" "continue do" } */
|
||||
} while (1);
|
||||
for (;;) {
|
||||
void bar8 (void) { continue; } /* { dg-error "continue statement" "continue for" } */
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user