From: Chris Lattner Date: Sat, 18 Apr 2009 22:42:18 +0000 (+0000) Subject: add testcases for some more scary/horrible things that work. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35562d18ea134f88ec09f12626f403a28adb4306;p=clang add testcases for some more scary/horrible things that work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69488 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index b7e3a21d55..181b6c5aa4 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -56,5 +56,18 @@ void test7(int x) { } } - -// FIXME: Switch cases etc. +int test8(int x) { + if (x) goto L; // expected-error {{illegal goto into protected scope}} + goto L2; // expected-error {{illegal goto into protected scope}} + + for (int arr[x]; // expected-note {{jump bypasses initialization of variable length array}} + ; ++x) { + + L2:; + } + + return x == ({ + int a[x]; // expected-note {{jump bypasses initialization of variable length array}} + L: + 42; }); +}