Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / builtin-nan-legacy.c
blobde6c15379a4ddd4ea0c992a92cb26a9745f4df1f
1 // RUN: %clang -target mipsel-unknown-linux -mnan=legacy -emit-llvm -S %s -o - | FileCheck %s
2 // CHECK: float 0x7FFC000000000000, float 0x7FF8000000000000
3 // CHECK: double 0x7FF4000000000000, double 0x7FF8000000000000
5 // The first line shows an unintended consequence.
6 // __builtin_nan() creates a legacy QNAN double with an empty payload
7 // (the first bit of the significand is clear to indicate quiet, so
8 // the second bit of the payload is set to maintain NAN-ness).
9 // The value is then truncated, but llvm::APFloat does not know about
10 // the inverted quiet bit, so it sets the first bit on conversion
11 // to indicate 'quiet' independently of the setting in clang.
13 float f[] = {
14 __builtin_nan(""),
15 __builtin_nans(""),
18 double d[] = {
19 __builtin_nan(""),
20 __builtin_nans(""),