blob: d8eff58e9225d65f57f14585d681d97fc033a453 [file] [log] [blame]
Ted Kremenekdb87bca2007-11-13 18:37:02 +00001// RUN: clang -fsyntax-only -Wfloat-equal -verify %s
Ted Kremenek9b3d3a92007-08-29 18:06:12 +00002
3int foo(float x, float y) {
4 return x == y; // expected-warning {{comparing floating point with ==}}
5}
6
7int bar(float x, float y) {
8 return x != y; // expected-warning {{comparing floating point with ==}}
Ted Kremenek9f3d9422007-09-26 20:14:22 +00009}
Ted Kremenek6a261552007-10-29 16:40:01 +000010
11int qux(float x) {
12 return x == x; // no-warning
13}
Ted Kremenekc8f488d2007-11-13 19:17:00 +000014
15int baz(float x) {
16 return x == 0.0; // no-warning
17}
18
19int taz(float x) {
20 return x == __builtin_inf(); // no-warning
21}