[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / builtin-nan-exception.c
blob7445411ddf89eaea56d875d1837ee705a5da2630
1 // RUN: %clang -target aarch64 -emit-llvm -S %s -o - | FileCheck %s
2 // RUN: %clang -target lanai -emit-llvm -S %s -o - | FileCheck %s
3 // RUN: %clang -target riscv64 -emit-llvm -S %s -o - | FileCheck %s
4 // RUN: %clang -target x86_64 -emit-llvm -S %s -o - | FileCheck %s
6 // Run a variety of targets to ensure there's no target-based difference.
8 // An SNaN with no payload is formed by setting the bit after the
9 // the quiet bit (MSB of the significand).
11 // CHECK: float 0x7FF8000000000000, float 0x7FF4000000000000
13 float f[] = {
14 __builtin_nanf(""),
15 __builtin_nansf(""),
19 // Doubles are created and converted to floats.
20 // Converting (truncating) to float quiets the NaN (sets the MSB
21 // of the significand) and raises the APFloat invalidOp exception
22 // but that should not cause a compilation error in the default
23 // (ignore FP exceptions) mode.
25 // CHECK: float 0x7FF8000000000000, float 0x7FFC000000000000
27 float converted_to_float[] = {
28 __builtin_nan(""),
29 __builtin_nans(""),
32 // CHECK: double 0x7FF8000000000000, double 0x7FF4000000000000
34 double d[] = {
35 __builtin_nan(""),
36 __builtin_nans(""),