diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll index 170e2d55421c8..b1b879da1fbd3 100644 --- a/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll +++ b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instsimplify -S | FileCheck %s ; Overflow on a float to int or int to float conversion is undefined (PR21130). @@ -38,3 +39,20 @@ define float @overflow_sitofp() { ret float %i } +; https://llvm.org/PR43907 + +define float @nan_f64_trunc() { +; CHECK-LABEL: @nan_f64_trunc( +; CHECK-NEXT: ret float 0x7FF0000000000000 +; + %f = fptrunc double 0x7FF0000000000001 to float + ret float %f +} + +define <2 x half> @nan_v2f32_trunc() { +; CHECK-LABEL: @nan_v2f32_trunc( +; CHECK-NEXT: ret <2 x half> +; + %f = fptrunc <2 x float> to <2 x half> + ret <2 x half> %f +}