summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-01-27 18:51:39 +0000
committerTed Kremenek <kremenek@apple.com>2011-01-27 18:51:39 +0000
commit1be4a59a110ba71682a70b352c36e80fb143929b (patch)
treede09feb59314216c2068d51d6e1b37e69b87d7ed /clang/test/Sema/uninit-variables.c
parent5fcfb2fe0c1e0a82bb8d200b91826bf2325cbc3f (diff)
downloadbcm5719-llvm-1be4a59a110ba71682a70b352c36e80fb143929b.tar.gz
bcm5719-llvm-1be4a59a110ba71682a70b352c36e80fb143929b.zip
Teach -Wuninitialized about indirect goto. Fixes PR 9071.
llvm-svn: 124394
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