blob: 2861bb12582acf8ac15f039af79bce3792120916 [file] [log] [blame]
Arnold Schwaighofer97794942007-11-10 10:48:01 +00001; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
Arnold Schwaighofera38df102008-04-12 18:11:06 +00002; check for the 2 byval moves
Arnold Schwaighofer4da27f62008-09-22 14:50:07 +00003; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep movl | grep ecx | grep eax | wc -l | grep 1
Arnold Schwaighofera38df102008-04-12 18:11:06 +00004%struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
5 i32, i32, i32, i32, i32, i32, i32, i32,
6 i32, i32, i32, i32, i32, i32, i32, i32 }
Arnold Schwaighofer97794942007-11-10 10:48:01 +00007
Dan Gohmanbafd3872008-12-03 01:10:18 +00008define fastcc i32 @tailcallee(%struct.s* byval %a) nounwind {
Arnold Schwaighofer97794942007-11-10 10:48:01 +00009entry:
10 %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
11 %tmp3 = load i32* %tmp2
12 ret i32 %tmp3
13}
14
Dan Gohmanbafd3872008-12-03 01:10:18 +000015define fastcc i32 @tailcaller(%struct.s* byval %a) nounwind {
Arnold Schwaighofer97794942007-11-10 10:48:01 +000016entry:
17 %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
18 ret i32 %tmp4
19}