From 566fb9fe3ed767be7218fb1608ec6a284067d3b0 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 12 Jul 2013 09:20:14 +0000 Subject: [PATCH] [SystemZ] Add test missing from r186148 Sigh, twice in two days sorry. One day I'll remember... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186150 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/SystemZ/asm-17.ll | 82 ++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test/CodeGen/SystemZ/asm-17.ll diff --git a/test/CodeGen/SystemZ/asm-17.ll b/test/CodeGen/SystemZ/asm-17.ll new file mode 100644 index 00000000000..f2fbba6d4c5 --- /dev/null +++ b/test/CodeGen/SystemZ/asm-17.ll @@ -0,0 +1,82 @@ +; Test explicit register names. +; +; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s + +; Test i32 GPRs. +define i32 @f1() { +; CHECK: f1: +; CHECK: lhi %r4, 1 +; CHECK: blah %r4 +; CHECK: lr %r2, %r4 +; CHECK: br %r14 + %ret = call i32 asm "blah $0", "={r4},0" (i32 1) + ret i32 %ret +} + +; Test i64 GPRs. +define i64 @f2() { +; CHECK: f2: +; CHECK: lghi %r4, 1 +; CHECK: blah %r4 +; CHECK: lgr %r2, %r4 +; CHECK: br %r14 + %ret = call i64 asm "blah $0", "={r4},0" (i64 1) + ret i64 %ret +} + +; Test i32 FPRs. +define float @f3() { +; CHECK: f3: +; CHECK: lzer %f4 +; CHECK: blah %f4 +; CHECK: ler %f0, %f4 +; CHECK: br %r14 + %ret = call float asm "blah $0", "={f4},0" (float 0.0) + ret float %ret +} + +; Test i64 FPRs. +define double @f4() { +; CHECK: f4: +; CHECK: lzdr %f4 +; CHECK: blah %f4 +; CHECK: ldr %f0, %f4 +; CHECK: br %r14 + %ret = call double asm "blah $0", "={f4},0" (double 0.0) + ret double %ret +} + +; Test i128 FPRs. +define void @f5(fp128 *%dest) { +; CHECK: f5: +; CHECK: lzxr %f4 +; CHECK: blah %f4 +; CHECK-DAG: std %f4, 0(%r2) +; CHECK-DAG: std %f6, 8(%r2) +; CHECK: br %r14 + %ret = call fp128 asm "blah $0", "={f4},0" (fp128 0xL00000000000000000000000000000000) + store fp128 %ret, fp128 *%dest + ret void +} + +; Test clobbers of GPRs and CC. +define i32 @f6(i32 %in) { +; CHECK: f6: +; CHECK: lr [[REG:%r[01345]]], %r2 +; CHECK: blah +; CHECK: lr %r2, [[REG]] +; CHECK: br %r14 + call void asm sideeffect "blah", "~{r2},~{cc}"() + ret i32 %in +} + +; Test clobbers of FPRs and CC. +define float @f7(float %in) { +; CHECK: f7: +; CHECK: ler [[REG:%f[1-7]]], %f0 +; CHECK: blah +; CHECK: ler %f0, [[REG]] +; CHECK: br %r14 + call void asm sideeffect "blah", "~{f0},~{cc}"() + ret float %in +} -- 2.34.1