1 // RUN: %clang_cc1 -fexperimental-strict-floating-point -S -emit-llvm -ffp-exception-behavior=strict -Wno-unknown-pragmas %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -fexperimental-strict-floating-point -S -emit-llvm -frounding-math -Wno-unknown-pragmas %s -o - | FileCheck %s
3
4 float PR47807 = -8.6563630030e-03;
5
6 // nextUp(1.F) == 0x1.000002p0F
7
8 struct S {
9 float f;
10 };
11
12 static struct S var_01 = {0x1.000001p0};
func_01()13 struct S *func_01() {
14 return &var_01;
15 }
16
17 struct S var_02 = {0x1.000001p0};
18
func_03()19 struct S *func_03() {
20 static struct S var_03 = {0x1.000001p0};
21 return &var_03;
22 }
23
24 // CHECK: @var_01 = {{.*}} %struct.S { float 1.000000e+00 }
25 // CHECK: @var_02 = {{.*}} %struct.S { float 1.000000e+00 }
26 // CHECK: @func_03.var_03 = {{.*}} %struct.S { float 1.000000e+00 }
27
28 #pragma STDC FENV_ROUND FE_UPWARD
29
30 static struct S var_04 = {0x1.000001p0};
func_04()31 struct S *func_04() {
32 return &var_04;
33 }
34
35 struct S var_05 = {0x1.000001p0};
36
func_06()37 struct S *func_06() {
38 static struct S var_06 = {0x1.000001p0};
39 return &var_06;
40 }
41
42 // CHECK: @var_04 = {{.*}} %struct.S { float 0x3FF0000020000000 }
43 // CHECK: @var_05 = {{.*}} %struct.S { float 0x3FF0000020000000 }
44 // CHECK: @func_06.var_06 = {{.*}} %struct.S { float 0x3FF0000020000000 }
45
46