From: Chris Lattner Date: Sat, 18 Apr 2009 23:07:55 +0000 (+0000) Subject: add some testcases that we do not correctly handle. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c78476b711902757f3600d75b180e8fe299c3f33;p=clang add some testcases that we do not correctly handle. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69492 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 7a35f07be0..98662be621 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -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}}