Skip to content

Commit

Permalink
X86: add test for realignment fix committed earlier.
Browse files Browse the repository at this point in the history
Forgot "git add" for a new file.
  • Loading branch information
TNorthover committed Aug 4, 2021
1 parent f968bd7 commit 13e145f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 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)

@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
}

0 comments on commit 13e145f

Please sign in to comment.