]> granicus.if.org Git - clang/commitdiff
add another testcase
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 07:54:11 +0000 (07:54 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 07:54:11 +0000 (07:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69432 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/scope-check.c

index d09ad9c5d5526ec43cf74e4db59362326a777f29..1d068a2de43c53fb59c0dc65aa2a6be881647a3f 100644 (file)
@@ -18,15 +18,27 @@ void test3clean(int*);
 
 int test3() {
   goto L; // expected-error{{illegal jump}}
-  int a __attribute((cleanup(test3clean)));
-  L:
+int a __attribute((cleanup(test3clean)));
+L:
   return a;
 }
 
 int test4(int x) {
- goto L; // expected-error{{illegal jump}}
- int a[x];
- test4(x);
- L:
- return sizeof a;
 goto L; // expected-error{{illegal jump}}
+int a[x];
 test4(x);
+L:
 return sizeof a;
 }
+
+int test5(int x) {
+  int a[x];
+  test5(x);
+  goto L;  // Ok.
+L:
+  goto L;  // Ok.
+  return sizeof a;
+}
+
+
+// FIXME: Switch cases etc.