summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/uninit-variables.c')
-rw-r--r--clang/test/Sema/uninit-variables.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c
index 513298d9ac8..f52c1b5fc28 100644
--- a/clang/test/Sema/uninit-variables.c
+++ b/clang/test/Sema/uninit-variables.c
@@ -229,3 +229,14 @@ void test35(int x) {
^{ y = (x == 0); }();
}
+// Test handling of indirect goto.
+void test36()
+{
+ void **pc; // expected-warning{{use of uninitialized variable 'pc'}} expected-note{{ add initialization to silence this warning}}
+ void *dummy[] = { &&L1, &&L2 };
+ L1:
+ goto *pc; // expected-note{{variable 'pc' is possibly uninitialized when used here}}
+ L2:
+ goto *pc;
+}
+
OpenPOWER on IntegriCloud