]> granicus.if.org Git - clang/commitdiff
add some testcases that we do not correctly handle.
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 23:07:55 +0000 (23:07 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 23:07:55 +0000 (23:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69492 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/scope-check.c

index 7a35f07be0846c7bac7c17e27fbd80cf4b2ba5ba..98662be621bcabae47c6ea9dc272759725ced3bb 100644 (file)
@@ -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}}