llvm-project
24 строки · 690.0 Байт
1/* RUN: %clang_cc1 -fsyntax-only -verify %s
2*/
3void foo(void) {
4break; /* expected-error {{'break' statement not in loop or switch statement}} */
5}
6
7void foo2(void) {
8continue; /* expected-error {{'continue' statement not in loop statement}} */
9}
10
11int pr8880_9 (int first) {
12switch(({ if (first) { first = 0; break; } 1; })) { // expected-error {{'break' statement not in loop or switch statement}}
13case 2: return 2;
14default: return 0;
15}
16}
17
18void pr8880_24(void) {
19for (({break;});;); // expected-error {{'break' statement not in loop or switch statement}}
20}
21
22void pr8880_25(void) {
23for (({continue;});;); // expected-error {{'continue' statement not in loop statement}}
24}
25