From aed4677a1ceab01b3cee11300795febebd54d25f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 2 Sep 2011 19:39:26 +0000 Subject: -Wuninitialized: fix insidious bug resulting from interplay of blocks and dead code. Fixes . llvm-svn: 139027 --- clang/test/Sema/uninit-variables.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/test/Sema/uninit-variables.c') diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c index f26e478bdfc..dbde333d751 100644 --- a/clang/test/Sema/uninit-variables.c +++ b/clang/test/Sema/uninit-variables.c @@ -381,3 +381,13 @@ void test_vla_sizeof(int x) { double (*memory)[2][x] = malloc(sizeof(*memory)); // no-warning } +// Test absurd case of deadcode + use of blocks. This previously was a false positive +// due to an analysis bug. +int test_block_and_dead_code() { + __block int x; + ^{ x = 1; }(); + if (0) + return x; + return x; // no-warning +} + -- cgit v1.2.3