aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CodeGen/stacksave-restore.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/stacksave-restore.ll b/test/CodeGen/stacksave-restore.ll
new file mode 100644
index 0000000000..8ef0dac46d
--- /dev/null
+++ b/test/CodeGen/stacksave-restore.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc
+
+declare sbyte* %llvm.stacksave()
+declare void %llvm.stackrestore(sbyte*)
+
+int *%test(uint %N) {
+ %tmp = call sbyte* %llvm.stacksave()
+ %P = alloca int, uint %N
+ call void %llvm.stackrestore(sbyte* %tmp)
+ %Q = alloca int, uint %N
+ ret int* %P
+}