summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/adjust-callstack-sp.ll
diff options
context:
space:
mode:
authorVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-04-02 10:14:54 +0000
committerVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>2015-04-02 10:14:54 +0000
commitcb64898a22659c897575b091594fbb45da0f2964 (patch)
tree6c16b6da0169967e113c59411f4d54e322aa7be2 /test/CodeGen/Mips/adjust-callstack-sp.ll
parent2278d23c53a6aaf9bbbb032eb05f55fc960a5c58 (diff)
[mips] Make sure that we don't adjust the stack pointer by zero amount.
Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8638 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/adjust-callstack-sp.ll')
-rw-r--r--test/CodeGen/Mips/adjust-callstack-sp.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/adjust-callstack-sp.ll b/test/CodeGen/Mips/adjust-callstack-sp.ll
new file mode 100644
index 00000000000..8c61a650a96
--- /dev/null
+++ b/test/CodeGen/Mips/adjust-callstack-sp.ll
@@ -0,0 +1,20 @@
+; RUN: llc < %s -march=mips -mcpu=mips16 | FileCheck %s -check-prefix=M16
+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefix=GP32
+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s -check-prefix=GP32
+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s -check-prefix=GP32
+; RUN: llc < %s -march=mips -mcpu=mips3 | FileCheck %s -check-prefix=GP64
+; RUN: llc < %s -march=mips -mcpu=mips64 | FileCheck %s -check-prefix=GP64
+; RUN: llc < %s -march=mips -mcpu=mips64r6 | FileCheck %s -check-prefix=GP64
+
+declare void @bar(i32*)
+
+define void @foo(i32 %sz) {
+ ; ALL-LABEL: foo:
+
+ ; M16-NOT: addiu $sp, 0 # 16 bit inst
+ ; GP32-NOT: addiu $sp, $sp, 0
+ ; GP64-NOT: daddiu $sp, $sp, 0
+ %a = alloca i32, i32 %sz
+ call void @bar(i32* %a)
+ ret void
+}