aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/fpcast.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/fpcast.ll')
-rw-r--r--test/Transforms/InstCombine/fpcast.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fpcast.ll b/test/Transforms/InstCombine/fpcast.ll
index 9be66fd42c..ac034028b2 100644
--- a/test/Transforms/InstCombine/fpcast.ll
+++ b/test/Transforms/InstCombine/fpcast.ll
@@ -53,3 +53,23 @@ define half @test5(float %a, float %b, float %c) {
}
declare float @llvm.fabs.f32(float) nounwind readonly
+
+define <1 x float> @test6(<1 x double> %V) {
+ %frem = frem <1 x double> %V, %V
+ %trunc = fptrunc <1 x double> %frem to <1 x float>
+ ret <1 x float> %trunc
+; CHECK-LABEL: @test6
+; CHECK-NEXT: %[[frem:.*]] = frem <1 x double> %V, %V
+; CHECK-NEXT: %[[trunc:.*]] = fptrunc <1 x double> %[[frem]] to <1 x float>
+; CHECK-NEXT: ret <1 x float> %trunc
+}
+
+define float @test7(double %V) {
+ %frem = frem double %V, 1.000000e+00
+ %trunc = fptrunc double %frem to float
+ ret float %trunc
+; CHECK-LABEL: @test7
+; CHECK-NEXT: %[[frem:.*]] = frem double %V, 1.000000e+00
+; CHECK-NEXT: %[[trunc:.*]] = fptrunc double %frem to float
+; CHECK-NEXT: ret float %trunc
+}