Ted Kremenek | 3ca0bf2 | 2007-10-29 16:58:49 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify %s |
2 | |||||
3 | int foo(int x) { | ||||
4 | return x == x; // expected-warning {{self-comparison always results}} | ||||
5 | } | ||||
6 | |||||
7 | int foo2(int x) { | ||||
8 | return (x) != (((x))); // expected-warning {{self-comparison always results}} | ||||
9 | } | ||||
10 | |||||
11 | int bar(float x) { | ||||
12 | return x == x; // no-warning | ||||
13 | } | ||||
14 | |||||
15 | int bar2(float x) { | ||||
16 | return x != x; // no-warning | ||||
17 | } |