summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-30 21:10:13 +0000
committerChris Lattner <sabre@nondot.org>2007-04-30 21:10:13 +0000
commit27679be2c0af6bd2b5316f9c15f883c253e6495d (patch)
treeb4ac5efe9d6400e49c9273852a2207830b6c47d6 /test
parent99eaef9b06ca8326fd2a6eca6f9eb2c546ace088 (diff)
downloadllvm-27679be2c0af6bd2b5316f9c15f883c253e6495d.tar.gz
llvm-27679be2c0af6bd2b5316f9c15f883c253e6495d.tar.bz2
llvm-27679be2c0af6bd2b5316f9c15f883c253e6495d.tar.xz
testcase for PR1357
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll b/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll
new file mode 100644
index 0000000000..f43b87c76d
--- /dev/null
+++ b/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | llc | grep {subfc r2,r5,r4}
+; RUN: llvm-as < %s | llc | grep {subfze r4,r3}
+
+; PR1357
+
+target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "powerpc-apple-darwin8.8.0"
+
+;long long test(int A, int B, int C) {
+; unsigned X, Y;
+; __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2"
+; : "=r" (X), "=&r" (Y)
+; : "r" (A), "rI" (B), "r" (C));
+; return ((long long)Y << 32) | X;
+;}
+
+define i64 @test(i32 %A, i32 %B, i32 %C) {
+entry:
+ %Y = alloca i32, align 4 ; <i32*> [#uses=2]
+ %tmp4 = call i32 asm "subf${3:I}c $1,$4,$3\0A\09subfze $0,$2", "=r,=*&r,r,rI,r"( i32* %Y, i32 %A, i32 %B, i32 %C ) ; <i32> [#uses=1]
+ %tmp5 = load i32* %Y ; <i32> [#uses=1]
+ %tmp56 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
+ %tmp7 = shl i64 %tmp56, 32 ; <i64> [#uses=1]
+ %tmp89 = zext i32 %tmp4 to i64 ; <i64> [#uses=1]
+ %tmp10 = or i64 %tmp7, %tmp89 ; <i64> [#uses=1]
+ ret i64 %tmp10
+}