InstCombine: Fix another infinite loop caused by visitFPTrunc
[oota-llvm.git] / test / Transforms / InstCombine / fpcast.ll
index c4c8578198b557f2a04ff986e390ca324e7f463b..ac034028b22d6938a9763728c424393fa4d434e4 100644 (file)
@@ -63,3 +63,13 @@ define <1 x float> @test6(<1 x double> %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
+}