diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/block-literal.c | 3 | ||||
| -rw-r--r-- | clang/test/Sema/block-misc.c | 3 | ||||
| -rw-r--r-- | clang/test/Sema/scope-check.c | 11 |
3 files changed, 8 insertions, 9 deletions
diff --git a/clang/test/Sema/block-literal.c b/clang/test/Sema/block-literal.c index e9c2341a99c..c303b8417d9 100644 --- a/clang/test/Sema/block-literal.c +++ b/clang/test/Sema/block-literal.c @@ -33,7 +33,8 @@ void test2() { break; // expected-error {{'break' statement not in loop or switch statement}} continue; // expected-error {{'continue' statement not in loop statement}} while(1) break; // ok - goto foo; // expected-error {{goto not allowed}} + goto foo; // expected-error {{use of undeclared label 'foo'}} + a: goto a; // ok }); break; } diff --git a/clang/test/Sema/block-misc.c b/clang/test/Sema/block-misc.c index 52cebfe8922..1109be6311b 100644 --- a/clang/test/Sema/block-misc.c +++ b/clang/test/Sema/block-misc.c @@ -87,8 +87,7 @@ int test7(void (^p)()) { void test8() { somelabel: - // FIXME: This should say "jump out of block not legal" when gotos are allowed. - ^{ goto somelabel; }(); // expected-error {{goto not allowed in block literal}} + ^{ goto somelabel; }(); // expected-error {{use of undeclared label 'somelabel'}} } void test9() { diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 4d3f6cbcf2b..74bc7c46f8f 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -181,15 +181,14 @@ void test11(int n) { // TODO: When and if gotos are allowed in blocks, this should work. void test12(int n) { void *P = ^{ - goto L1; // expected-error {{goto not allowed in block literal}} + goto L1; L1: - goto L2; // expected-error {{goto not allowed in block literal}} + goto L2; L2: - goto L3; // expected-error {{goto not allowed in block literal}} - // todo-error {{illegal goto into protected scope}} - int Arr[n]; // todo-note {{jump bypasses initialization of variable length array}} + goto L3; // expected-error {{illegal goto into protected scope}} + int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}} L3: - goto L4; // expected-error {{goto not allowed in block literal}} + goto L4; L4: return; }; } |

