Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / conversion-target-dep.c
blob1b22cb8209343ee510604df3b8c6c4e899c9d178
1 // RUN: %clang_cc1 -Wdouble-promotion -Wimplicit-float-conversion %s -triple x86_64-apple-macosx10.12 -verify=x86,expected
2 // RUN: %clang_cc1 -Wdouble-promotion -Wimplicit-float-conversion %s -triple armv7-apple-ios9.0 -verify=arm,expected
4 // On ARM, long double and double both map to double precision 754s, so there
5 // isn't any reason to warn on conversions back and forth.
7 long double ld;
8 double d;
9 _Float16 f16;
11 int main(void) {
12 ld = d; // x86-warning {{implicit conversion increases floating-point precision: 'double' to 'long double'}}
13 d = ld; // x86-warning {{implicit conversion loses floating-point precision: 'long double' to 'double'}}
15 ld += d; // x86-warning {{implicit conversion increases floating-point precision: 'double' to 'long double'}}
16 d += ld; // x86-warning {{implicit conversion when assigning computation result loses floating-point precision: 'long double' to 'double'}}
18 f16 = ld; // expected-warning {{implicit conversion loses floating-point precision: 'long double' to '_Float16'}}
19 ld = f16; // expected-warning {{implicit conversion increases floating-point precision: '_Float16' to 'long double'}}
21 f16 += ld; // expected-warning {{implicit conversion when assigning computation result loses floating-point precision: 'long double' to '_Float16'}}
22 ld += f16; // expected-warning {{implicit conversion increases floating-point precision: '_Float16' to 'long double'}}