blob: 6d466639890b4c52017085511019711321ab0d7d [file] [log] [blame]
Eli Bendersky597fc122013-01-25 22:07:43 +00001; 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
10define void @foo(i32* nocapture %out, i32 %in) nounwind {
11entry:
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
23define void @bar(i32* nocapture %pOut, i32* nocapture %pIn) nounwind {
24entry:
25 %0 = load i32* %pIn, align 4
26 store i32 %0, i32* %pOut, align 4
27 ret void
28}
29