aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/2006-07-20-InlineAsm.ll
blob: 16ad579ccef74dbb031298a482a773c49c7a1a0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: llvm-upgrade < %s | llvm-as | 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
}