Fix byval arguments in the fastcc calling convention. The fastcc convention
[oota-llvm.git] / test / CodeGen / X86 / tailcallbyval.ll
1 ; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
2 ; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
3 %struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
4                   i32, i32, i32, i32, i32, i32, i32, i32,
5                   i32, i32, i32, i32, i32, i32, i32, i32 }
6
7 define  fastcc i32 @tailcallee(%struct.s* byval %a) nounwind {
8 entry:
9         %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
10         %tmp3 = load i32* %tmp2
11         ret i32 %tmp3
12 }
13
14 define  fastcc i32 @tailcaller(%struct.s* byval %a) nounwind {
15 entry:
16         %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
17         ret i32 %tmp4
18 }