summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/int-cmp-01.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/SystemZ/int-cmp-01.ll')
-rw-r--r--test/CodeGen/SystemZ/int-cmp-01.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/int-cmp-01.ll b/test/CodeGen/SystemZ/int-cmp-01.ll
index dbfe0dfd64..6653b6f706 100644
--- a/test/CodeGen/SystemZ/int-cmp-01.ll
+++ b/test/CodeGen/SystemZ/int-cmp-01.ll
@@ -149,3 +149,17 @@ define void @f10(i32 %lhs, i64 %base, i64 %index, i32 *%dst) {
store i32 %res, i32 *%dst
ret void
}
+
+; Check the comparison can be reversed if that allows CH to be used.
+define double @f11(double %a, double %b, i32 %rhs, i16 *%src) {
+; CHECK-LABEL: f11:
+; CHECK: ch %r2, 0(%r3)
+; CHECK-NEXT: jh {{\.L.*}}
+; CHECK: ldr %f0, %f2
+; CHECK: br %r14
+ %half = load i16 *%src
+ %lhs = sext i16 %half to i32
+ %cond = icmp slt i32 %lhs, %rhs
+ %res = select i1 %cond, double %a, double %b
+ ret double %res
+}