diff options
Diffstat (limited to 'clang/test/Sema/scope-check.c')
| -rw-r--r-- | clang/test/Sema/scope-check.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 21908fc285d..4c3480ea275 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -1,27 +1,16 @@ // RUN: clang-cc -fsyntax-only -verify %s -/* -"/tmp/bug.c", line 2: error: transfer of control bypasses initialization of: - variable length array "a" (declared at line 3) - variable length array "b" (declared at line 3) - goto L; - ^ -"/tmp/bug.c", line 3: warning: variable "b" was declared but never referenced - int a[x], b[x]; - ^ -*/ - int test1(int x) { goto L; // expected-error{{illegal goto into protected scope}} - int a[x]; // expected-note {{scope created by variable length array}} - int b[x]; // expected-note {{scope created by variable length array}} + int a[x]; // expected-note {{jump bypasses initialization of variable length array}} + int b[x]; // expected-note {{jump bypasses initialization of variable length array}} L: return sizeof a; } int test2(int x) { goto L; // expected-error{{illegal goto into protected scope}} - typedef int a[x]; // expected-note {{scope created by VLA typedef}} + typedef int a[x]; // expected-note {{jump bypasses initialization of VLA typedef}} L: return sizeof(a); } @@ -30,14 +19,14 @@ void test3clean(int*); int test3() { goto L; // expected-error{{illegal goto into protected scope}} -int a __attribute((cleanup(test3clean))); // expected-note {{scope created by declaration with __attribute__((cleanup))}} +int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of declaration with __attribute__((cleanup))}} L: return a; } int test4(int x) { goto L; // expected-error{{illegal goto into protected scope}} -int a[x]; // expected-note {{scope created by variable length array}} +int a[x]; // expected-note {{jump bypasses initialization of variable length array}} test4(x); L: return sizeof a; |

