Added to test case for "self-comparison check" uses of relation operators: x < x and x > x
should emit warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43451 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/self-comparison.c b/test/Sema/self-comparison.c
index 450673c..023afb7 100644
--- a/test/Sema/self-comparison.c
+++ b/test/Sema/self-comparison.c
@@ -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
+}