File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
llvm/test/Transforms/InstSimplify/ConstProp Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1
2
; RUN: opt < %s -instsimplify -S | FileCheck %s
2
3
3
4
; Overflow on a float to int or int to float conversion is undefined (PR21130).
@@ -38,3 +39,20 @@ define float @overflow_sitofp() {
38
39
ret float %i
39
40
}
40
41
42
+ ; https://llvm.org/PR43907
43
+
44
+ define float @nan_f64_trunc () {
45
+ ; CHECK-LABEL: @nan_f64_trunc(
46
+ ; CHECK-NEXT: ret float 0x7FF0000000000000
47
+ ;
48
+ %f = fptrunc double 0x7FF0000000000001 to float
49
+ ret float %f
50
+ }
51
+
52
+ define <2 x half > @nan_v2f32_trunc () {
53
+ ; CHECK-LABEL: @nan_v2f32_trunc(
54
+ ; CHECK-NEXT: ret <2 x half> <half 0xH7C00, half 0xH7C37>
55
+ ;
56
+ %f = fptrunc <2 x float > <float 0x7FF0000100000000 , float 0x7FF0DEAD00000000 > to <2 x half >
57
+ ret <2 x half > %f
58
+ }
You can’t perform that action at this time.
0 commit comments