aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-10-07 00:52:56 +0000
committerTed Kremenek <kremenek@apple.com>2011-10-07 00:52:56 +0000
commitaa2176b4cd1115adb29f29eca3e6e2fc6d543170 (patch)
tree8a0f701f37755a2a83b5b31e984b34f75839869d /test/Sema/uninit-variables.c
parentc5f740ecdbc21d5ba08f97b89cc05c9d4f230fda (diff)
r141345 also fixed a -Wuninitialized bug where loop conditions were not always flagged as being uninitialized. Addresses <rdar://problem/9432305>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r--test/Sema/uninit-variables.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c
index bcffbd6a3d..f716124bcb 100644
--- a/test/Sema/uninit-variables.c
+++ b/test/Sema/uninit-variables.c
@@ -404,4 +404,10 @@ void PR11069(int a, int b) {
}
}
+// Test uninitialized value used in loop condition.
+void rdar9432305(float *P) {
+ int i; // expected-note {{initialize the variable 'i' to silence this warning}}
+ for (; i < 10000; ++i) // expected-warning {{variable 'i' is uninitialized when used here}}
+ P[i] = 0.0f;
+}