Eli Bendersky | 597fc12 | 2013-01-25 22:07:43 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s |
| 2 | ; RUN: llc -mtriple=x86_64-pc-linux-gnux32 < %s | FileCheck -check-prefix=X32ABI %s |
| 3 | |
| 4 | ; %in is kept in %esi for both ABIs. But the pointer will be passed in %edi |
| 5 | ; for x32, not %rdi |
| 6 | |
| 7 | ; CHECK: movl %esi, (%rdi) |
| 8 | ; X32ABI: movl %esi, (%edi) |
| 9 | |
| 10 | define void @foo(i32* nocapture %out, i32 %in) nounwind { |
| 11 | entry: |
| 12 | store i32 %in, i32* %out, align 4 |
| 13 | ret void |
| 14 | } |
| 15 | |
| 16 | ; CHECK: bar |
| 17 | ; CHECK: movl (%rsi), %eax |
| 18 | |
| 19 | ; Similarly here, but for loading |
| 20 | ; X32ABI: bar |
| 21 | ; X32ABI: movl (%esi), %eax |
| 22 | |
| 23 | define void @bar(i32* nocapture %pOut, i32* nocapture %pIn) nounwind { |
| 24 | entry: |
| 25 | %0 = load i32* %pIn, align 4 |
| 26 | store i32 %0, i32* %pOut, align 4 |
| 27 | ret void |
| 28 | } |
| 29 | |