summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/tailcallpic3.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-09 19:06:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-09 19:06:30 +0000
commit85d8b2bbe386bcfe669575d05b61482d7be07e5d (patch)
tree1dc5e75ab222a9ead44c699eceafab7a6ca7b310 /test/CodeGen/X86/tailcallpic3.ll
parent5a5ac124e1efaf208671f01c46edb15f29ed2a0b (diff)
Notes
Diffstat (limited to 'test/CodeGen/X86/tailcallpic3.ll')
-rw-r--r--test/CodeGen/X86/tailcallpic3.ll73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/CodeGen/X86/tailcallpic3.ll b/test/CodeGen/X86/tailcallpic3.ll
new file mode 100644
index 000000000000..edc58052d82f
--- /dev/null
+++ b/test/CodeGen/X86/tailcallpic3.ll
@@ -0,0 +1,73 @@
+; RUN: llc < %s -mtriple=i686-pc-linux-gnu -relocation-model=pic | FileCheck %s
+
+; While many of these could be tail called, we don't do it because it forces
+; early binding.
+
+declare void @external()
+
+define hidden void @tailcallee_hidden() {
+entry:
+ ret void
+}
+
+define void @tailcall_hidden() {
+entry:
+ tail call void @tailcallee_hidden()
+ ret void
+}
+; CHECK: tailcall_hidden:
+; CHECK: jmp tailcallee_hidden
+
+define internal void @tailcallee_internal() {
+entry:
+ ret void
+}
+
+define void @tailcall_internal() {
+entry:
+ tail call void @tailcallee_internal()
+ ret void
+}
+; CHECK: tailcall_internal:
+; CHECK: jmp tailcallee_internal
+
+define default void @tailcallee_default() {
+entry:
+ ret void
+}
+
+define void @tailcall_default() {
+entry:
+ tail call void @tailcallee_default()
+ ret void
+}
+; CHECK: tailcall_default:
+; CHECK: calll tailcallee_default@PLT
+
+define void @tailcallee_default_implicit() {
+entry:
+ ret void
+}
+
+define void @tailcall_default_implicit() {
+entry:
+ tail call void @tailcallee_default_implicit()
+ ret void
+}
+; CHECK: tailcall_default_implicit:
+; CHECK: calll tailcallee_default_implicit@PLT
+
+define void @tailcall_external() {
+ tail call void @external()
+ ret void
+}
+; CHECK: tailcall_external:
+; CHECK: calll external@PLT
+
+define void @musttail_external() {
+ musttail call void @external()
+ ret void
+}
+; CHECK: musttail_external:
+; CHECK: movl external@GOT
+; CHECK: jmpl