34 lines · plain
1; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s2; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s -check-prefix=LINUX3 4; Verify that the 5th and 6th parameters are coming from the correct location5; on the stack.6define i32 @f6(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {7entry:8; CHECK: movl 48(%rsp), %eax9; CHECK: addl 40(%rsp), %eax10; LINUX: leal (%r8,%r9), %eax11 %add = add nsw i32 %p6, %p512 ret i32 %add13}14 15define win64cc i32 @f7(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {16entry:17; CHECK: movl 48(%rsp), %eax18; CHECK: addl 40(%rsp), %eax19; LINUX: movl 48(%rsp), %eax20; LINUX: addl 40(%rsp), %eax21 %add = add nsw i32 %p6, %p522 ret i32 %add23}24 25; Verify that even though we're compiling for Windows, parameters behave as26; on other platforms here (note the x86_64_sysvcc calling convention).27define x86_64_sysvcc i32 @f8(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {28entry:29; CHECK: leal (%r8,%r9), %eax30; LINUX: leal (%r8,%r9), %eax31 %add = add nsw i32 %p6, %p532 ret i32 %add33}34