summaryrefslogtreecommitdiffstats
path: root/test/Sema/scope-check.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/scope-check.c')
-rw-r--r--test/Sema/scope-check.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c
index 6f86402..f3881ed 100644
--- a/test/Sema/scope-check.c
+++ b/test/Sema/scope-check.c
@@ -19,7 +19,7 @@ void test3clean(int*);
int test3() {
goto L; // expected-error{{illegal goto into protected scope}}
-int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of declaration with __attribute__((cleanup))}}
+int a __attribute((cleanup(test3clean))); // expected-note {{jump bypasses initialization of variable with __attribute__((cleanup))}}
L:
return a;
}
@@ -133,20 +133,20 @@ int test8(int x) {
void test9(int n, void *P) {
int Y;
int Z = 4;
- goto *P; // ok.
+ goto *P; // expected-warning {{indirect goto might cross protected scopes}}
L2: ;
- int a[n]; // expected-note 2 {{jump bypasses initialization of variable length array}}
+ int a[n]; // expected-note {{jump bypasses initialization of variable length array}}
-L3:
+L3: // expected-note {{possible target of indirect goto}}
L4:
- goto *P; // expected-warning {{illegal indirect goto in protected scope, unknown effect on scopes}}
+ goto *P;
goto L3; // ok
goto L4; // ok
void *Ptrs[] = {
- &&L2, // Ok.
- &&L3 // expected-warning {{address taken of label in protected scope, jump to it would have unknown effect on scope}}
+ &&L2,
+ &&L3
};
}
@@ -193,3 +193,9 @@ void test12(int n) {
};
}
+void test13(int n, void *p) {
+ int vla[n];
+ goto *p;
+ a0: ;
+ static void *ps[] = { &&a0 };
+}
OpenPOWER on IntegriCloud