[cfe-commits] r43451 - /cfe/trunk/test/Sema/self-comparison.c
Ted Kremenek
kremenek at apple.com
Mon Oct 29 10:02:56 PDT 2007
Author: kremenek
Date: Mon Oct 29 12:02:56 2007
New Revision: 43451
URL: http://llvm.org/viewvc/llvm-project?rev=43451&view=rev
Log:
Added to test case for "self-comparison check" uses of relation operators: x < x and x > x
should emit warnings.
Modified:
cfe/trunk/test/Sema/self-comparison.c
Modified: cfe/trunk/test/Sema/self-comparison.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/self-comparison.c?rev=43451&r1=43450&r2=43451&view=diff
==============================================================================
--- cfe/trunk/test/Sema/self-comparison.c (original)
+++ cfe/trunk/test/Sema/self-comparison.c Mon Oct 29 12:02:56 2007
@@ -8,10 +8,18 @@
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
-}
\ No newline at end of file
+}
More information about the cfe-commits
mailing list