Added more test cases for uninitialized values checker.

llvm-svn: 44307
This commit is contained in:
Ted Kremenek 2007-11-24 23:06:58 +00:00
parent 2e04d73d83
commit 0d20033c6a
1 changed files with 15 additions and 0 deletions

View File

@ -27,3 +27,18 @@ int f5() {
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}
}
}