mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-26 14:15:53 +00:00
dc21e16bb4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29225 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
700 B
LLVM
25 lines
700 B
LLVM
; RUN: llvm-as < %s | llc -march=x86
|
|
; PR833
|
|
|
|
%G = weak global int 0 ; <int*> [#uses=3]
|
|
|
|
implementation ; Functions:
|
|
|
|
int %foo(int %X) {
|
|
entry:
|
|
%X_addr = alloca int ; <int*> [#uses=3]
|
|
store int %X, int* %X_addr
|
|
call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "==m,==r,m,1,~{dirflag},~{fpsr},~{flags}"( int* %G, int* %X_addr, int* %G, int %X )
|
|
%tmp1 = load int* %X_addr ; <int> [#uses=1]
|
|
ret int %tmp1
|
|
}
|
|
|
|
int %foo2(int %X) {
|
|
entry:
|
|
%X_addr = alloca int ; <int*> [#uses=3]
|
|
store int %X, int* %X_addr
|
|
call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "==m,==r,1,~{dirflag},~{fpsr},~{flags}"( int* %G, int* %X_addr, int %X )
|
|
%tmp1 = load int* %X_addr ; <int> [#uses=1]
|
|
ret int %tmp1
|
|
}
|