summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/reg-stackify.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/reg-stackify.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/reg-stackify.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/reg-stackify.ll b/llvm/test/CodeGen/WebAssembly/reg-stackify.ll
index c9814cce350..4c667d58eb9 100644
--- a/llvm/test/CodeGen/WebAssembly/reg-stackify.ll
+++ b/llvm/test/CodeGen/WebAssembly/reg-stackify.ll
@@ -357,6 +357,18 @@ define void @ignore_dbg_value() {
unreachable
}
+; Don't stackify an expression that might use the stack into a return, since we
+; might insert a prologue before the return.
+
+; CHECK-LABEL: no_stackify_past_epilogue:
+; CHECK: return ${{[0-9]+}}{{$}}
+declare i32 @use_memory(i32*)
+define i32 @no_stackify_past_epilogue() {
+ %x = alloca i32
+ %call = call i32 @use_memory(i32* %x)
+ ret i32 %call
+}
+
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}
OpenPOWER on IntegriCloud