diff options
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r-- | test/Sema/uninit-variables.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c index faf94c024b..200fc83b10 100644 --- a/test/Sema/uninit-variables.c +++ b/test/Sema/uninit-variables.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only %s -verify +// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only -fblocks %s -verify int test1() { int x; // expected-warning{{use of uninitialized variable 'x'}} expected-note{{add initialization to silence this warning}} @@ -192,3 +192,23 @@ int test28() { return sizeof(int[len]); // expected-note{{variable 'len' is possibly uninitialized when used here}} } +void test29() { + int x; // expected-warning{{use of uninitialized variable 'x'}} expected-note{{add initialization to silence this warning}} + (void) ^{ (void) x; }; // expected-note{{variable 'x' is possibly uninitialized when captured by block}} +} + +void test30() { + static int x; // no-warning + (void) ^{ (void) x; }; +} + +void test31() { + __block int x; // no-warning + (void) ^{ (void) x; }; +} + +int test32_x; +void test32() { + (void) ^{ (void) test32_x; }; // no-warning +} + |