summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/fast-math.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fast-math.ll b/test/Transforms/InstCombine/fast-math.ll
index 47f1ec4804..edcbcc71df 100644
--- a/test/Transforms/InstCombine/fast-math.ll
+++ b/test/Transforms/InstCombine/fast-math.ll
@@ -130,6 +130,16 @@ define double @fail2(double %f1, double %f2) {
; CHECK: ret
}
+; c1 * x - x => (c1 - 1.0) * x
+define float @fold13(float %x) {
+ %mul = fmul fast float %x, 7.000000e+00
+ %sub = fsub fast float %mul, %x
+ ret float %sub
+; CHECK: fold13
+; CHECK: fmul fast float %x, 6.000000e+00
+; CHECK: ret
+}
+
; =========================================================================
;
; Testing-cases about fmul begin