@@ -70,3 +70,49 @@ define bfloat @nan_bf16_trunc() {
70
70
%f = fptrunc double 0x7FF0000000000001 to bfloat
71
71
ret bfloat %f
72
72
}
73
+
74
+ define float @trunc_denorm_lost_fraction0 () {
75
+ ; CHECK-LABEL: @trunc_denorm_lost_fraction0(
76
+ ; CHECK-NEXT: ret float 0.000000e+00
77
+ ;
78
+ %b = fptrunc double 0x0000000010000000 to float
79
+ ret float %b
80
+ }
81
+
82
+ ; FIXME: This should be 0.0.
83
+
84
+ define float @trunc_denorm_lost_fraction1 () {
85
+ ; CHECK-LABEL: @trunc_denorm_lost_fraction1(
86
+ ; CHECK-NEXT: ret float 0x36A0000000000000
87
+ ;
88
+ %b = fptrunc double 0x0000000010000001 to float
89
+ ret float %b
90
+ }
91
+
92
+ ; FIXME: This should be 0.0.
93
+
94
+ define float @trunc_denorm_lost_fraction2 () {
95
+ ; CHECK-LABEL: @trunc_denorm_lost_fraction2(
96
+ ; CHECK-NEXT: ret float 0x36A0000000000000
97
+ ;
98
+ %b = fptrunc double 0x000000001fffffff to float
99
+ ret float %b
100
+ }
101
+
102
+ define float @trunc_denorm_lost_fraction3 () {
103
+ ; CHECK-LABEL: @trunc_denorm_lost_fraction3(
104
+ ; CHECK-NEXT: ret float 0.000000e+00
105
+ ;
106
+ %b = fptrunc double 0x0000000020000000 to float
107
+ ret float %b
108
+ }
109
+
110
+ ; FIXME: This should be -0.0.
111
+
112
+ define float @trunc_denorm_lost_fraction4 () {
113
+ ; CHECK-LABEL: @trunc_denorm_lost_fraction4(
114
+ ; CHECK-NEXT: ret float 0xB6A0000000000000
115
+ ;
116
+ %b = fptrunc double 0x8000000010000001 to float
117
+ ret float %b
118
+ }
0 commit comments