[cfe-commits] r141346 - /cfe/trunk/test/Sema/uninit-variables.c
Ted Kremenek
kremenek at apple.com
Thu Oct 6 17:52:56 PDT 2011
Author: kremenek
Date: Thu Oct 6 19:52:56 2011
New Revision: 141346
URL: http://llvm.org/viewvc/llvm-project?rev=141346&view=rev
Log:
r141345 also fixed a -Wuninitialized bug where loop conditions were not always flagged as being uninitialized. Addresses <rdar://problem/9432305>.
Modified:
cfe/trunk/test/Sema/uninit-variables.c
Modified: cfe/trunk/test/Sema/uninit-variables.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/uninit-variables.c?rev=141346&r1=141345&r2=141346&view=diff
==============================================================================
--- cfe/trunk/test/Sema/uninit-variables.c (original)
+++ cfe/trunk/test/Sema/uninit-variables.c Thu Oct 6 19:52:56 2011
@@ -404,4 +404,10 @@
}
}
+// 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;
+}
More information about the cfe-commits
mailing list