From: Ted Kremenek Date: Mon, 29 Oct 2007 17:02:56 +0000 (+0000) Subject: Added to test case for "self-comparison check" uses of relation operators: x < x... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8335a9c35a52ba174d4d31badfe4806312f866c;p=clang 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 450673c69c..023afb7926 100644 --- a/test/Sema/self-comparison.c +++ b/test/Sema/self-comparison.c @@ -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 +}