Add a test case to check handling of dbg-declare by fast-isel.
[oota-llvm.git] / test / CodeGen / X86 / tailcallstack64.ll
1 ; RUN: llc < %s -tailcallopt -march=x86-64 -post-RA-scheduler=true | FileCheck %s
2
3 ; Check that lowered arguments on the stack do not overwrite each other.
4 ; Add %in1 %p1 to a different temporary register (%eax).
5 ; CHECK: movl  32(%rsp), %eax
6 ; Move param %in1 to temp register (%r10d).
7 ; CHECK: movl  40(%rsp), %r10d
8 ; Add %in1 %p1 to a different temporary register (%eax).
9 ; CHECK: addl %edi, %eax
10 ; Move param %in2 to stack.
11 ; CHECK: movl  %r10d, 32(%rsp)
12 ; Move result of addition to stack.
13 ; CHECK: movl  %eax, 40(%rsp)
14 ; Eventually, do a TAILCALL
15 ; CHECK: TAILCALL
16
17 declare fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6, i32 %a, i32 %b) nounwind
18
19 define fastcc i32 @tailcaller(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6, i32 %in1, i32 %in2) nounwind {
20 entry:
21         %tmp = add i32 %in1, %p1
22         %retval = tail call fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6, i32 %in2,i32 %tmp)
23         ret i32 %retval
24 }
25