diff options
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r-- | test/Sema/uninit-variables.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c index 513298d9ac..f52c1b5fc2 100644 --- a/test/Sema/uninit-variables.c +++ b/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; +} + |