aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r--test/Sema/uninit-variables.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c
index f26e478bdf..dbde333d75 100644
--- a/test/Sema/uninit-variables.c
+++ b/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
+}
+