diff options
Diffstat (limited to 'test/CodeGen/SystemZ/cond-li.ll')
-rw-r--r-- | test/CodeGen/SystemZ/cond-li.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/cond-li.ll b/test/CodeGen/SystemZ/cond-li.ll new file mode 100644 index 000000000000..a3e2f3fd1252 --- /dev/null +++ b/test/CodeGen/SystemZ/cond-li.ll @@ -0,0 +1,23 @@ +; Test LOCHI/LOCGHI +; +; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s + +; CHECK-LABEL: bar1: +; CHECK: lhi [[REG:%r[0-5]]], 42 +; CHECK: chi %r2, 0 +; CHECK: lochie [[REG]], 0 +define signext i32 @bar1(i32 signext %x) { + %cmp = icmp ne i32 %x, 0 + %.x = select i1 %cmp, i32 42, i32 0 + ret i32 %.x +} + +; CHECK-LABEL: bar2: +; CHECK: ltgr [[REG:%r[0-5]]], %r2 +; CHECK: lghi %r2, 42 +; CHECK: locghie %r2, 0 +define signext i64 @bar2(i64 signext %x) { + %cmp = icmp ne i64 %x, 0 + %.x = select i1 %cmp, i64 42, i64 0 + ret i64 %.x +} |