summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/segmented-stacks.ll
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2018-06-26 14:11:30 +0000
committerThan McIntosh <thanm@google.com>2018-06-26 14:11:30 +0000
commit3190993a023d5f4faf68f98a13bbf5272f23e650 (patch)
tree051699a33ae217690513ce9bd58d97c6c06e46b8 /llvm/test/CodeGen/ARM/segmented-stacks.ll
parentcfe2f9d4d2d65417a9b28e439901b7a3f6de4dc0 (diff)
downloadbcm5719-llvm-3190993a023d5f4faf68f98a13bbf5272f23e650.tar.gz
bcm5719-llvm-3190993a023d5f4faf68f98a13bbf5272f23e650.zip
[X86,ARM] Retain split-stack prolog check for sibling calls
Summary: If a routine with no stack frame makes a sibling call, we need to preserve the stack space check even if the local stack frame is empty, since the call target could be a "no-split" function (in which case the linker needs to be able to fix up the prolog sequence in order to switch to a larger stack). This fixes PR37807. Reviewers: cherry, javed.absar Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D48444 llvm-svn: 335604
Diffstat (limited to 'llvm/test/CodeGen/ARM/segmented-stacks.ll')
-rw-r--r--llvm/test/CodeGen/ARM/segmented-stacks.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/segmented-stacks.ll b/llvm/test/CodeGen/ARM/segmented-stacks.ll
index 4fe84faa17f..971fdd96606 100644
--- a/llvm/test/CodeGen/ARM/segmented-stacks.ll
+++ b/llvm/test/CodeGen/ARM/segmented-stacks.ll
@@ -246,4 +246,22 @@ define void @test_nostack() #0 {
; ARM-android-NOT: bl __morestack
}
+; Test to make sure that a morestack call is generated if there is a
+; sibling call, even if the function in question has no stack frame
+; (PR37807).
+
+declare i32 @callee(i32)
+
+define i32 @test_sibling_call_empty_frame(i32 %x) #0 {
+ %call = tail call i32 @callee(i32 %x) #0
+ ret i32 %call
+
+; ARM-linux: test_sibling_call_empty_frame:
+; ARM-linux: bl __morestack
+
+; ARM-android: test_sibling_call_empty_frame:
+; ARM-android: bl __morestack
+
+}
+
attributes #0 = { "split-stack" }
OpenPOWER on IntegriCloud