aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-19 05:20:37 +0000
committerChris Lattner <sabre@nondot.org>2009-04-19 05:20:37 +0000
commit4f9c06ae362c10af797957b92a46fe91d5874899 (patch)
tree454ebae9d5a7734a87d666f712945c1a5abcf3f2
parentdeae3a735d92b999bfc3b43f2bbe75a6c5b9a1a1 (diff)
test that vlas are checked in an objc method context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69508 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaObjC/scope-check.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaObjC/scope-check.m b/test/SemaObjC/scope-check.m
index 6659562bab..7da4e429a6 100644
--- a/test/SemaObjC/scope-check.m
+++ b/test/SemaObjC/scope-check.m
@@ -74,4 +74,20 @@ void test3() {
blargh: ;
}
}
+
++ (void)meth2 {
+ int n; void *P;
+ goto L0; // expected-error {{illegal goto into protected scope}}
+ typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}}
+ L0:
+
+ goto L1; // expected-error {{illegal goto into protected scope}}
+ A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}}
+ L1:
+ goto L2; // expected-error {{illegal goto into protected scope}}
+ A d[n]; // expected-note {{jump bypasses initialization of variable length array}}
+ L2:
+ return;
+}
+
@end