2009-12-16 04:14:24 +08:00
|
|
|
/* RUN: %clang_cc1 -fsyntax-only -verify %s
|
2006-11-06 07:47:55 +08:00
|
|
|
*/
|
2009-07-22 08:43:08 +08:00
|
|
|
void foo() {
|
2007-06-27 12:30:12 +08:00
|
|
|
break; /* expected-error {{'break' statement not in loop or switch statement}} */
|
2006-11-06 07:47:55 +08:00
|
|
|
}
|
|
|
|
|
2009-07-22 08:43:08 +08:00
|
|
|
void foo2() {
|
2007-06-27 12:30:12 +08:00
|
|
|
continue; /* expected-error {{'continue' statement not in loop statement}} */
|
2006-11-06 07:47:55 +08:00
|
|
|
}
|
2014-01-23 23:05:00 +08:00
|
|
|
|
|
|
|
int pr8880_9 (int first) {
|
|
|
|
switch(({ if (first) { first = 0; break; } 1; })) { // expected-error {{'break' statement not in loop or switch statement}}
|
|
|
|
case 2: return 2;
|
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pr8880_24() {
|
|
|
|
for (({break;});;); // expected-error {{'break' statement not in loop or switch statement}}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pr8880_25() {
|
|
|
|
for (({continue;});;); // expected-error {{'continue' statement not in loop statement}}
|
|
|
|
}
|