From: Chris Lattner Date: Sun, 19 Apr 2009 04:48:07 +0000 (+0000) Subject: more testcases of variably modified types. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3037a822388348eb16f462c2c8aee77b2fdc286c;p=clang more testcases of variably modified types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69506 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 83b84777a9..1eb47e7643 100644 --- a/test/Sema/scope-check.c +++ b/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; +} +