blob: cc96be0fd365f8d914421b4d8e05099b2e1c8391 [file] [log] [blame]
Ted Kremenek24f59fb2007-11-13 18:37:02 +00001// RUN: clang -fsyntax-only -Wfloat-equal -verify %s
Ted Kremenekec761af2007-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 Kremenek56b70862007-09-26 20:14:22 +00009}
Ted Kremenek75439142007-10-29 16:40:01 +000010
11int qux(float x) {
12 return x == x; // no-warning
13}