Added to test case for "self-comparison check" uses of relation operators: x < x and x > x

should emit warnings.

llvm-svn: 43451
This commit is contained in:
Ted Kremenek 2007-10-29 17:02:56 +00:00
parent e451eae8d7
commit 5d18ce750a
1 changed files with 9 additions and 1 deletions

View File

@ -8,10 +8,18 @@ int foo2(int x) {
return (x) != (((x))); // expected-warning {{self-comparison always results}}
}
int qux(int x) {
return x < x; // expected-warning {{self-comparison}}
}
int qux2(int x) {
return x > x; // expected-warning {{self-comparison}}
}
int bar(float x) {
return x == x; // no-warning
}
int bar2(float x) {
return x != x; // no-warning
}
}