diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-19 04:51:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-19 04:51:27 +0000 |
commit | de6240cd4570464fdfaebee37afedd50fa5eeb08 (patch) | |
tree | 6e500c2c947af864136295540c2a4b0031d6fcb5 | |
parent | 4be550ec68ac1ac4d9a66517a65863ac06836ee1 (diff) | |
download | bcm5719-llvm-de6240cd4570464fdfaebee37afedd50fa5eeb08.tar.gz bcm5719-llvm-de6240cd4570464fdfaebee37afedd50fa5eeb08.zip |
apparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if they are.
llvm-svn: 69507
-rw-r--r-- | clang/test/Sema/scope-check.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 1eb47e76439..1d1c5aa2f9b 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -164,3 +164,27 @@ L2: return; } +// TODO: When and if gotos are allowed in blocks, this should work. +void test11(int n) { + void *P = ^{ + goto L1; // expected-error {{goto not allowed in block literal}} + L1: + goto L2; // expected-error {{goto not allowed in block literal}} + 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}} + L3: + goto L4; // expected-error {{goto not allowed in block literal}} + L4: return; + }; +} + + + +#if 0 +// in Sema::CheckVariableDeclaration +// FIXME: This won't give the correct result for +// int a[10][n]; +#endif + |