• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
6define i32 @f6(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
7entry:
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
15define x86_64_win64cc i32 @f7(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
16entry:
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).
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), %eax
30; LINUX: leal    (%r8,%r9), %eax
31  %add = add nsw i32 %p6, %p5
32  ret i32 %add
33}
34