From 710c1a449dd7bee747ecf9c344a6f6d5461a158d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 24 Apr 2014 20:14:34 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207143 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Bitcode/tailcall.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/Bitcode/tailcall.ll (limited to 'test/Bitcode') diff --git a/test/Bitcode/tailcall.ll b/test/Bitcode/tailcall.ll new file mode 100644 index 0000000000..765b47054c --- /dev/null +++ b/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 +} -- cgit v1.2.3