First half of jump scope checking for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c
index 98662be..4605e02 100644
--- a/test/Sema/scope-check.c
+++ b/test/Sema/scope-check.c
@@ -83,6 +83,7 @@
                        goto L6;
                    4; }); 
   L6:; // ok.
+    if (x) goto L6; // ok
   }
   
   {
@@ -113,6 +114,13 @@
     //int A[({   L11: 4; })];
   }
   
+  {
+    goto L12;
+    
+    int y = 4;   // fixme-warn: skips initializer.
+  L12:
+    ;
+  }
   
   // Statement expressions 2.
   goto L1;     // expected-error {{illegal goto into protected scope}}
@@ -121,3 +129,21 @@
                L1:
                  42; });
 }
+
+void test9(int n, void *P) {
+  int Y;
+  int Z = 4;
+  goto *P;  // ok.
+
+L2: ;
+  int a[n];  // expected-note {{jump bypasses initialization of variable length array}}
+
+L3:
+  goto *P;  // expected-error {{illegal indirect goto in protected scope, unknown effect on scopes}}
+  
+  void *Ptrs[] = {
+    &&L2,
+    &&L3   // FIXME: Not Ok.
+  };
+}
+