[cfe-commits] r44307 - /cfe/trunk/test/Analysis/uninit-vals.c
Ted Kremenek
kremenek at apple.com
Sat Nov 24 15:06:59 PST 2007
Author: kremenek
Date: Sat Nov 24 17:06:58 2007
New Revision: 44307
URL: http://llvm.org/viewvc/llvm-project?rev=44307&view=rev
Log:
Added more test cases for uninitialized values checker.
Modified:
cfe/trunk/test/Analysis/uninit-vals.c
Modified: cfe/trunk/test/Analysis/uninit-vals.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals.c?rev=44307&r1=44306&r2=44307&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals.c Sat Nov 24 17:06:58 2007
@@ -27,3 +27,18 @@
int a;
a = 30; // no-warning
}
+
+void f6(int i) {
+ int x;
+ for (i = 0 ; i < 10; i++)
+ printf("%d",x++); // expected-warning {use of uninitialized variable}
+}
+
+void f7(int i) {
+ int x = i;
+ int y;
+ for (i = 0; i < 10; i++ ) {
+ printf("%d",x++); // no-warning
+ x += y; // expected-warning {use of uninitialized variable}
+ }
+}
\ No newline at end of file
More information about the cfe-commits
mailing list