diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2016-08-30 00:59:23 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2016-08-30 00:59:23 +0000 |
| commit | b074a608ceb2514ff5c8967b0f36c168fb54576e (patch) | |
| tree | f34276831928cad569fd5763ac8d398a78a8fc32 /llvm/test | |
| parent | 455d3569d84c0e999257b7e7b87b9b7e46dd8774 (diff) | |
| download | bcm5719-llvm-b074a608ceb2514ff5c8967b0f36c168fb54576e.tar.gz bcm5719-llvm-b074a608ceb2514ff5c8967b0f36c168fb54576e.zip | |
[PowerPC] Add support for -mlongcall
The "long call" option forces the use of the indirect calling sequence for all
calls (even those that don't really need it). GCC provides this option; This is
helpful, under certain circumstances, for building very-large binaries, and
some other specialized use cases.
Fixes PR19098.
llvm-svn: 280040
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/longcall.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/longcall.ll b/llvm/test/CodeGen/PowerPC/longcall.ll new file mode 100644 index 00000000000..9645ca8d31f --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/longcall.ll @@ -0,0 +1,26 @@ +; RUN: llc < %s | FileCheck %s +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +; Function Attrs: nounwind +define void @bar() local_unnamed_addr #0 { +entry: + tail call void @foo() #1 + ret void + +; CHECK-LABEL: @bar +; CHECK: ld [[FD:[0-9]+]], .LC0@toc@l({{[0-9]+}}) +; CHECK: ld [[ADDR:[0-9]+]], 0([[FD]]) +; CHECK: mtctr [[ADDR]] +; CHECK: bctrl +; CHECK-NOT: bl foo +; CHECK: blr +} + +; CHECK: .tc foo + +declare void @foo() local_unnamed_addr + +attributes #0 = { nounwind "target-cpu"="ppc64" "target-features"="+longcall" } +attributes #1 = { nounwind } + |

