summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode/tailcall.ll
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-04-24 20:14:34 +0000
committerReid Kleckner <reid@kleckner.net>2014-04-24 20:14:34 +0000
commit5772b77789728e045ccd8c93d79820632e81c4e6 (patch)
tree6f4029a3081e1f1e6a0f9e9576737c5506e59bd1 /llvm/test/Bitcode/tailcall.ll
parent0fbb1e91e57829d277bbea3ef1402ee7bc871dea (diff)
downloadbcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.tar.gz
bcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.zip
Add 'musttail' marker to call instructions
This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible. Reviewers: nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D3240 llvm-svn: 207143
Diffstat (limited to 'llvm/test/Bitcode/tailcall.ll')
-rw-r--r--llvm/test/Bitcode/tailcall.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/tailcall.ll b/llvm/test/Bitcode/tailcall.ll
new file mode 100644
index 00000000000..765b47054ca
--- /dev/null
+++ b/llvm/test/Bitcode/tailcall.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+
+; Check that musttail and tail roundtrip.
+
+declare cc8191 void @t1_callee()
+define cc8191 void @t1() {
+; CHECK: tail call cc8191 void @t1_callee()
+ tail call cc8191 void @t1_callee()
+ ret void
+}
+
+declare cc8191 void @t2_callee()
+define cc8191 void @t2() {
+; CHECK: musttail call cc8191 void @t2_callee()
+ musttail call cc8191 void @t2_callee()
+ ret void
+}
OpenPOWER on IntegriCloud