Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 |
| 2 | ; PR833 |
| 3 | |
| 4 | %G = weak global int 0 ; <int*> [#uses=3] |
| 5 | |
| 6 | implementation ; Functions: |
| 7 | |
| 8 | int %foo(int %X) { |
| 9 | entry: |
| 10 | %X_addr = alloca int ; <int*> [#uses=3] |
| 11 | store int %X, int* %X_addr |
| 12 | 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 ) |
| 13 | %tmp1 = load int* %X_addr ; <int> [#uses=1] |
| 14 | ret int %tmp1 |
| 15 | } |
| 16 | |
| 17 | int %foo2(int %X) { |
| 18 | entry: |
| 19 | %X_addr = alloca int ; <int*> [#uses=3] |
| 20 | store int %X, int* %X_addr |
| 21 | call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,1,~{dirflag},~{fpsr},~{flags}"( int* %G, int* %X_addr, int %X ) |
| 22 | %tmp1 = load int* %X_addr ; <int> [#uses=1] |
| 23 | ret int %tmp1 |
| 24 | } |