diff options
Diffstat (limited to 'test/Sema/scope-check.c')
-rw-r--r-- | test/Sema/scope-check.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index a9494d3e3fb4..fa37d10d070b 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=gnu99 %s -Wno-unreachable-code int test1(int x) { - goto L; // expected-error{{goto into protected scope}} + goto L; // expected-error{{cannot jump from this goto statement to its label}} 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: @@ -9,7 +9,7 @@ int test1(int x) { } int test2(int x) { - goto L; // expected-error{{goto into protected scope}} + goto L; // expected-error{{cannot jump from this goto statement to its label}} typedef int a[x]; // expected-note {{jump bypasses initialization of VLA typedef}} L: return sizeof(a); @@ -18,14 +18,14 @@ int test2(int x) { void test3clean(int*); int test3() { - goto L; // expected-error{{goto into protected scope}} + goto L; // expected-error{{cannot jump from this goto statement to its label}} int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of variable with __attribute__((cleanup))}} L: return a; } int test4(int x) { - goto L; // expected-error{{goto into protected scope}} + goto L; // expected-error{{cannot jump from this goto statement to its label}} int a[x]; // expected-note {{jump bypasses initialization of variable length array}} test4(x); L: @@ -50,7 +50,7 @@ void test7(int x) { switch (x) { case 1: ; int a[x]; // expected-note {{jump bypasses initialization of variable length array}} - case 2: // expected-error {{switch case is in protected scope}} + case 2: // expected-error {{cannot jump from switch statement to this case label}} a[1] = 2; break; } @@ -58,17 +58,17 @@ void test7(int x) { int test8(int x) { // For statement. - goto L2; // expected-error {{goto into protected scope}} + goto L2; // expected-error {{cannot jump from this goto statement to its label}} for (int arr[x]; // expected-note {{jump bypasses initialization of variable length array}} ; ++x) L2:; // Statement expressions. - goto L3; // expected-error {{goto into protected scope}} + goto L3; // expected-error {{cannot jump from this goto statement to its label}} int Y = ({ int a[x]; // expected-note {{jump bypasses initialization of variable length array}} L3: 4; }); - goto L4; // expected-error {{goto into protected scope}} + goto L4; // expected-error {{cannot jump from this goto statement to its label}} { int A[x], // expected-note {{jump bypasses initialization of variable length array}} B[x]; // expected-note {{jump bypasses initialization of variable length array}} @@ -91,7 +91,7 @@ int test8(int x) { int A[x], B = ({ if (x) goto L7; else - goto L8; // expected-error {{goto into protected scope}} + goto L8; // expected-error {{cannot jump from this goto statement to its label}} 4; }), C[x]; // expected-note {{jump bypasses initialization of variable length array}} L8:; // bad @@ -103,7 +103,7 @@ int test8(int x) { goto L9; else // FIXME: - goto L10; // fixme-error {{goto into protected scope}} + goto L10; // fixme-error {{cannot jump from this goto statement to its label}} 4; })]; L10:; // bad } @@ -123,7 +123,7 @@ int test8(int x) { } // Statement expressions 2. - goto L1; // expected-error {{goto into protected scope}} + goto L1; // expected-error {{cannot jump from this goto statement to its label}} return x == ({ int a[x]; // expected-note {{jump bypasses initialization of variable length array}} L1: @@ -133,7 +133,7 @@ int test8(int x) { void test9(int n, void *P) { int Y; int Z = 4; - goto *P; // expected-error {{indirect goto might cross protected scopes}} + goto *P; // expected-error {{cannot jump from this indirect goto statement to one of its possible targets}} L2: ; int a[n]; // expected-note {{jump bypasses initialization of variable length array}} @@ -151,14 +151,14 @@ L4: } void test10(int n, void *P) { - goto L0; // expected-error {{goto into protected scope}} + goto L0; // expected-error {{cannot jump from this goto statement to its label}} typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}} L0: - goto L1; // expected-error {{goto into protected scope}} + goto L1; // expected-error {{cannot jump from this goto statement to its label}} A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}} L1: - goto L2; // expected-error {{goto into protected scope}} + goto L2; // expected-error {{cannot jump from this goto statement to its label}} A d[n]; // expected-note {{jump bypasses initialization of variable length array}} L2: return; @@ -171,7 +171,7 @@ void test11(int n) { case 2: case 3:; int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}} - case 4: // expected-error {{switch case is in protected scope}} + case 4: // expected-error {{cannot jump from switch statement to this case label}} return; } }; @@ -185,7 +185,7 @@ void test12(int n) { L1: goto L2; L2: - goto L3; // expected-error {{goto into protected scope}} + goto L3; // expected-error {{cannot jump from this goto statement to its label}} int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}} L3: goto L4; @@ -220,7 +220,7 @@ int test14(int n) { void test15(int n, void *pc) { static const void *addrs[] = { &&L1, &&L2 }; - goto *pc; // expected-error {{indirect goto might cross protected scope}} + goto *pc; // expected-error {{cannot jump from this indirect goto statement to one of its possible targets}} L1: { |