summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/stack-update-frame-opcode.ll
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2013-02-05 23:31:48 +0000
committerEli Bendersky <eliben@google.com>2013-02-05 23:31:48 +0000
commit61b057a6fd259888101c106c60e145c0dee89add (patch)
treef49684e4c5b56aa29e46a6a583db5abb4e8f2072 /test/CodeGen/X86/stack-update-frame-opcode.ll
parent60bdc5b16e2fc17be184b515a00c2e2a2eb40b89 (diff)
downloadllvm-61b057a6fd259888101c106c60e145c0dee89add.tar.gz
llvm-61b057a6fd259888101c106c60e145c0dee89add.tar.bz2
llvm-61b057a6fd259888101c106c60e145c0dee89add.tar.xz
Test for r174446
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/stack-update-frame-opcode.ll')
-rw-r--r--test/CodeGen/X86/stack-update-frame-opcode.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/X86/stack-update-frame-opcode.ll b/test/CodeGen/X86/stack-update-frame-opcode.ll
new file mode 100644
index 0000000000..1838c896bf
--- /dev/null
+++ b/test/CodeGen/X86/stack-update-frame-opcode.ll
@@ -0,0 +1,22 @@
+; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-pc-linux-gnux32 < %s | FileCheck -check-prefix=X32ABI %s
+
+define i32 @bar(i32 %a) nounwind {
+entry:
+ %arr = alloca [400 x i32], align 16
+
+; In the x32 ABI, the stack pointer is treated as a 32-bit value.
+; CHECK: subq $1608
+; X32ABI: subl $1608
+
+ %arraydecay = getelementptr inbounds [400 x i32]* %arr, i64 0, i64 0
+ %call = call i32 @foo(i32 %a, i32* %arraydecay) nounwind
+ ret i32 %call
+
+; CHECK: addq $1608
+; X32ABI: addl $1608
+
+}
+
+declare i32 @foo(i32, i32*)
+