llvm.org GIT mirror llvm / 27679be
testcase for PR1357 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36598 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc | grep {subfc r2,r5,r4}
1 ; RUN: llvm-as < %s | llc | grep {subfze r4,r3}
2
3 ; PR1357
4
5 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"
6 target triple = "powerpc-apple-darwin8.8.0"
7
8 ;long long test(int A, int B, int C) {
9 ; unsigned X, Y;
10 ; __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2"
11 ; : "=r" (X), "=&r" (Y)
12 ; : "r" (A), "rI" (B), "r" (C));
13 ; return ((long long)Y << 32) | X;
14 ;}
15
16 define i64 @test(i32 %A, i32 %B, i32 %C) {
17 entry:
18 %Y = alloca i32, align 4 ; [#uses=2]
19 %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 ) ; [#uses=1]
20 %tmp5 = load i32* %Y ; [#uses=1]
21 %tmp56 = zext i32 %tmp5 to i64 ; [#uses=1]
22 %tmp7 = shl i64 %tmp56, 32 ; [#uses=1]
23 %tmp89 = zext i32 %tmp4 to i64 ; [#uses=1]
24 %tmp10 = or i64 %tmp7, %tmp89 ; [#uses=1]
25 ret i64 %tmp10
26 }