From 35562d18ea134f88ec09f12626f403a28adb4306 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 18 Apr 2009 22:42:18 +0000 Subject: [PATCH] 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 --- test/Sema/scope-check.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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; }); +} -- 2.40.0