summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/tailcallbyval.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/tailcallbyval.ll')
-rw-r--r--test/CodeGen/X86/tailcallbyval.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/tailcallbyval.ll b/test/CodeGen/X86/tailcallbyval.ll
new file mode 100644
index 0000000000..dc1dea7e11
--- /dev/null
+++ b/test/CodeGen/X86/tailcallbyval.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
+%struct.s = type { i32, i32, i32 }
+
+define fastcc i32 @tailcallee(%struct.s* byval %a) {
+entry:
+ %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
+ %tmp3 = load i32* %tmp2
+ ret i32 %tmp3
+}
+
+define fastcc i32 @tailcaller(%struct.s* byval %a) {
+entry:
+ %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
+ ret i32 %tmp4
+}