]> granicus.if.org Git - clang/commitdiff
Added to test case for "self-comparison check" uses of relation operators: x < x...
authorTed Kremenek <kremenek@apple.com>
Mon, 29 Oct 2007 17:02:56 +0000 (17:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 29 Oct 2007 17:02:56 +0000 (17:02 +0000)
should emit warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43451 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/self-comparison.c

index 450673c69c327d898af33082b72673efdf9a7377..023afb7926f029cda7cf5938cbf29907fe4666e5 100644 (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
-}
\ No newline at end of file
+}