aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/scope-check.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-19 05:28:12 +0000
committerChris Lattner <sabre@nondot.org>2009-04-19 05:28:12 +0000
commit17a783055a41a44fda76b1747ebe6fd8ac2ba00a (patch)
treeeb87344b5fc3eaf7c6cf5d0d6ed06ef01882793a /test/Sema/scope-check.c
parent38c5ebd7b1b65304c7b5c7b9bf3f9162df22e77d (diff)
run the jump checker on blocks, even though they don't have gotos,
they do allow switches. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/scope-check.c')
-rw-r--r--test/Sema/scope-check.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c
index 59fd832dc6..76041c4916 100644
--- a/test/Sema/scope-check.c
+++ b/test/Sema/scope-check.c
@@ -164,9 +164,22 @@ L2:
return;
}
+void test11(int n) {
+ void *P = ^{
+ switch (n) {
+ case 1:;
+ case 2:
+ case 3:;
+ int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}}
+ case 4: // expected-error {{illegal switch case into protected scope}}
+ return;
+ }
+ };
+}
+
// TODO: When and if gotos are allowed in blocks, this should work.
-void test13(int n) {
+void test12(int n) {
void *P = ^{
goto L1; // expected-error {{goto not allowed in block literal}}
L1: