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.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fpcast.ll b/test/Transforms/InstCombine/fpcast.ll
index 09f0532..05d1b48 100644
--- a/test/Transforms/InstCombine/fpcast.ll
+++ b/test/Transforms/InstCombine/fpcast.ll
@@ -31,4 +31,16 @@ define half @test4(float %a) {
ret half %c
}
+; CHECK: test5
+define half @test5(float %a, float %b, float %c) {
+; CHECK: fcmp ogt
+; CHECK: fptrunc
+; CHECK: select
+; CHECK: half 0xH3C00
+ %d = fcmp ogt float %a, %b
+ %e = select i1 %d, float %c, float 1.0
+ %f = fptrunc float %e to half
+ ret half %f
+}
+
declare float @llvm.fabs.f32(float) nounwind readonly