aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 23:07:55 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 23:07:55 +0000
commitc78476b711902757f3600d75b180e8fe299c3f33 (patch)
treee4dc3cc764f05bb4499169639ff95ca28a871fd0
parent2b7b2ca64ad8d293d10909a7ac119fa3fc10c95c (diff)
add some testcases that we do not correctly handle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69492 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Sema/scope-check.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c
index 7a35f07be0..98662be621 100644
--- a/test/Sema/scope-check.c
+++ b/test/Sema/scope-check.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -verify -std=gnu99 %s
int test1(int x) {
goto L; // expected-error{{illegal goto into protected scope}}
@@ -61,7 +61,7 @@ int test8(int x) {
goto L2; // expected-error {{illegal goto into protected scope}}
for (int arr[x]; // expected-note {{jump bypasses initialization of variable length array}}
; ++x)
- L2:;
+ L2:;
// Statement expressions.
goto L3; // expected-error {{illegal goto into protected scope}}
@@ -96,6 +96,23 @@ int test8(int x) {
L8:; // bad
}
+ {
+ L9: ;// ok
+ int A[({ if (x)
+ goto L9;
+ else
+ // FIXME:
+ goto L10; // fixme-error {{illegal goto into protected scope}}
+ 4; })];
+ L10:; // bad
+ }
+
+ {
+ // FIXME: Crashes goto checker.
+ //goto L11;// ok
+ //int A[({ L11: 4; })];
+ }
+
// Statement expressions 2.
goto L1; // expected-error {{illegal goto into protected scope}}