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 200fc83b10..1bcfc8ad64 100644 --- a/test/Sema/uninit-variables.c +++ b/test/Sema/uninit-variables.c @@ -212,3 +212,14 @@ void test32() { (void) ^{ (void) test32_x; }; // no-warning } +void test_33() { + int x; // no-warning + (void) x; +} + +int test_34() { + int x; // expected-warning{{use of uninitialized variable 'x'}} expected-note{{add initialization to silence this warning}} + (void) x; + return x; // expected-note{{variable 'x' is possibly uninitialized when used here}} +} + |