summaryrefslogtreecommitdiff
path: root/test/CodeGen/MSP430
diff options
context:
space:
mode:
authorJob Noorman <jobnoorman@gmail.com>2013-10-24 09:32:31 +0000
committerJob Noorman <jobnoorman@gmail.com>2013-10-24 09:32:31 +0000
commitcb8c3d1e490f6b26c71cad11558c6c642d8544e0 (patch)
treecf593f84de73be95244322f0559333f7b89558b1 /test/CodeGen/MSP430
parent5e1d0d39db5fefe013f58c124a94694f96bce2f1 (diff)
downloadllvm-cb8c3d1e490f6b26c71cad11558c6c642d8544e0.tar.gz
llvm-cb8c3d1e490f6b26c71cad11558c6c642d8544e0.tar.bz2
llvm-cb8c3d1e490f6b26c71cad11558c6c642d8544e0.tar.xz
Make sure SP is always aligned on a 2 byte boundary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MSP430')
-rw-r--r--test/CodeGen/MSP430/transient-stack-alignment.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/MSP430/transient-stack-alignment.ll b/test/CodeGen/MSP430/transient-stack-alignment.ll
new file mode 100644
index 0000000000..cca83509cf
--- /dev/null
+++ b/test/CodeGen/MSP430/transient-stack-alignment.ll
@@ -0,0 +1,17 @@
+; RUN: llc < %s | FileCheck %s
+
+target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16-a0:16:16"
+target triple = "msp430---elf"
+
+define void @test() #0 {
+; CHECK-LABEL: test:
+; CHECK: sub.w #2, r1
+ %1 = alloca i8, align 1
+; CHECK-NEXT: mov.b #0, 1(r1)
+ store i8 0, i8* %1, align 1
+; CHECK-NEXT: add.w #2, r1
+; CHECK-NEXT: ret
+ ret void
+}
+
+attributes #0 = { nounwind "no-frame-pointer-elim"="false" }