[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.
[oota-llvm.git] / test / CodeGen / X86 / win64_params.ll
1 ; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s -check-prefix=LINUX
3
4 ; Verify that the 5th and 6th parameters are coming from the correct location
5 ; on the stack.
6 define i32 @f6(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
7 entry:
8 ; CHECK: movl    48(%rsp), %eax
9 ; CHECK: addl    40(%rsp), %eax
10 ; LINUX: leal    (%r8,%r9), %eax
11   %add = add nsw i32 %p6, %p5
12   ret i32 %add
13 }
14
15 define x86_64_win64cc i32 @f7(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
16 entry:
17 ; CHECK: movl    48(%rsp), %eax
18 ; CHECK: addl    40(%rsp), %eax
19 ; LINUX: movl    48(%rsp), %eax
20 ; LINUX: addl    40(%rsp), %eax
21   %add = add nsw i32 %p6, %p5
22   ret i32 %add
23 }
24
25 ; Verify that even though we're compiling for Windows, parameters behave as
26 ; on other platforms here (note the x86_64_sysvcc calling convention).
27 define x86_64_sysvcc i32 @f8(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
28 entry:
29 ; CHECK: leal    (%r8,%r9), %eax
30 ; LINUX: leal    (%r8,%r9), %eax
31   %add = add nsw i32 %p6, %p5
32   ret i32 %add
33 }