diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-19 04:48:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-19 04:48:07 +0000 |
commit | 4be550ec68ac1ac4d9a66517a65863ac06836ee1 (patch) | |
tree | be0befa1b8cbc933aea80cd6205daac0cd47c935 /clang | |
parent | 1a1fdbd75d2c69f4e3b034ddc416da974794ba0c (diff) | |
download | bcm5719-llvm-4be550ec68ac1ac4d9a66517a65863ac06836ee1.tar.gz bcm5719-llvm-4be550ec68ac1ac4d9a66517a65863ac06836ee1.zip |
more testcases of variably modified types.
llvm-svn: 69506
Diffstat (limited to 'clang')
-rw-r--r-- | clang/test/Sema/scope-check.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 83b84777a93..1eb47e76439 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=gnu99 %s +// RUN: clang-cc -fsyntax-only -verify -fblocks -std=gnu99 %s int test1(int x) { goto L; // expected-error{{illegal goto into protected scope}} @@ -150,3 +150,17 @@ L4: }; } +void test10(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; +} + |