aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/floating-point-compare.c
blob: cc96be0fd365f8d914421b4d8e05099b2e1c8391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: clang -fsyntax-only -Wfloat-equal -verify %s

int foo(float x, float y) {
  return x == y; // expected-warning {{comparing floating point with ==}}
} 

int bar(float x, float y) {
  return x != y; // expected-warning {{comparing floating point with ==}}
}

int qux(float x) {
  return x == x; // no-warning
}