Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / warn-implicit-conversion-floating-point-to-bool.cpp
blob1d8037aceb730ef26a28ad0aef3092e920ed6eca
1 // RUN: %clang_cc1 -verify -fsyntax-only %s
3 float foof(float x);
4 double food(double x);
5 void foo(bool b, float f);
7 void bar() {
9 float c = 1.7;
10 bool b = c;
12 double e = 1.7;
13 b = e;
15 b = foof(4.0);
17 b = foof(c < 1); // expected-warning {{implicit conversion turns floating-point number into bool: 'float' to 'bool'}}
19 b = food(e < 2); // expected-warning {{implicit conversion turns floating-point number into bool: 'double' to 'bool'}}
21 foo(c, b); // expected-warning {{implicit conversion turns floating-point number into bool: 'float' to 'bool'}}
22 foo(c, c);