[llvm] 13e145f - X86: add test for realignment fix committed earlier.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 4 04:10:24 PDT 2021
Author: Tim Northover
Date: 2021-08-04T12:10:20+01:00
New Revision: 13e145fe76c4c24c0f76115250b9249015fbf7ee
URL: https://github.com/llvm/llvm-project/commit/13e145fe76c4c24c0f76115250b9249015fbf7ee
DIFF: https://github.com/llvm/llvm-project/commit/13e145fe76c4c24c0f76115250b9249015fbf7ee.diff
LOG: X86: add test for realignment fix committed earlier.
Forgot "git add" for a new file.
Added:
llvm/test/CodeGen/X86/swifttail-realign.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/swifttail-realign.ll b/llvm/test/CodeGen/X86/swifttail-realign.ll
new file mode 100644
index 000000000000..c43787dc4733
--- /dev/null
+++ b/llvm/test/CodeGen/X86/swifttail-realign.ll
@@ -0,0 +1,29 @@
+; RUN: llc -mtriple=x86_64-linux-gnu %s -o - | FileCheck %s
+
+declare swifttailcc void @callee([6 x i64], i64, i64)
+
+ at var = external global i8*
+
+define swifttailcc void @caller(i64 %n) {
+; CHECK-LABEL: caller:
+; CHECK: subq $16, %rsp
+; CHECK: pushq %rbp
+; CHECK: movq %rsp, %rbp
+; CHECK: pushq %rbx
+; CHECK: andq $-32, %rsp
+; [... don't really care what happens to rsp to allocate %ptr ...]
+; CHECK: movq 24(%rbp), [[RETADDR:%.*]]
+; CHECK: movq [[RETADDR]], 8(%rbp)
+; CHECK: movq $42, 16(%rbp)
+; CHECK: movq $0, 24(%rbp)
+; CHECK: leaq -8(%rbp), %rsp
+; CHECK: popq %rbx
+; CHECK: popq %rbp
+; CHECK: jmp callee
+
+ call void asm sideeffect "", "~{rbx}"()
+ %ptr = alloca i8, i64 %n, align 32
+ store i8* %ptr, i8** @var
+ tail call swifttailcc void @callee([6 x i64] undef, i64 42, i64 0)
+ ret void
+}
More information about the llvm-commits
mailing list