blob: 22c33040b26b8cc4c959f1f010517d89778b1cc7 [file] [log] [blame]
Richard Trieud19d9dd2014-04-23 21:53:59 +00001// RUN: %clang_cc1 -verify -fsyntax-only %s -Wfloat-conversion
Richard Trieu393197a2014-04-22 01:01:05 +00002
3bool ReturnBool(float f) {
4 return f; //expected-warning{{conversion}}
5}
6
7char ReturnChar(float f) {
8 return f; //expected-warning{{conversion}}
9}
10
11int ReturnInt(float f) {
12 return f; //expected-warning{{conversion}}
13}
14
15long ReturnLong(float f) {
16 return f; //expected-warning{{conversion}}
17}
18
19void Convert(float f, double d, long double ld) {
20 bool b;
21 char c;
22 int i;
23 long l;
24
25 b = f; //expected-warning{{conversion}}
26 b = d; //expected-warning{{conversion}}
27 b = ld; //expected-warning{{conversion}}
28 c = f; //expected-warning{{conversion}}
29 c = d; //expected-warning{{conversion}}
30 c = ld; //expected-warning{{conversion}}
31 i = f; //expected-warning{{conversion}}
32 i = d; //expected-warning{{conversion}}
33 i = ld; //expected-warning{{conversion}}
34 l = f; //expected-warning{{conversion}}
35 l = d; //expected-warning{{conversion}}
36 l = ld; //expected-warning{{conversion}}
37}
38