1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=skylake | FileCheck %s
4 declare void @capture(ptr)
6 define void @test_natural() "no-realign-stack" {
7 ; CHECK-LABEL: test_natural:
9 ; CHECK-NEXT: pushq %rax
10 ; CHECK-NEXT: .cfi_def_cfa_offset 16
11 ; CHECK-NEXT: movq %rsp, %rdi
12 ; CHECK-NEXT: callq capture@PLT
13 ; CHECK-NEXT: popq %rax
14 ; CHECK-NEXT: .cfi_def_cfa_offset 8
17 call void @capture(ptr %a)
21 define void @test_realign() {
22 ; CHECK-LABEL: test_realign:
24 ; CHECK-NEXT: pushq %rbp
25 ; CHECK-NEXT: .cfi_def_cfa_offset 16
26 ; CHECK-NEXT: .cfi_offset %rbp, -16
27 ; CHECK-NEXT: movq %rsp, %rbp
28 ; CHECK-NEXT: .cfi_def_cfa_register %rbp
29 ; CHECK-NEXT: andq $-64, %rsp
30 ; CHECK-NEXT: subq $64, %rsp
31 ; CHECK-NEXT: movq %rsp, %rdi
32 ; CHECK-NEXT: callq capture@PLT
33 ; CHECK-NEXT: movq %rbp, %rsp
34 ; CHECK-NEXT: popq %rbp
35 ; CHECK-NEXT: .cfi_def_cfa %rsp, 8
37 %a = alloca i64, align 64
38 call void @capture(ptr %a)
42 define void @test_norealign() "no-realign-stack" {
43 ; CHECK-LABEL: test_norealign:
45 ; CHECK-NEXT: pushq %rax
46 ; CHECK-NEXT: .cfi_def_cfa_offset 16
47 ; CHECK-NEXT: movq %rsp, %rdi
48 ; CHECK-NEXT: callq capture@PLT
49 ; CHECK-NEXT: popq %rax
50 ; CHECK-NEXT: .cfi_def_cfa_offset 8
52 %a = alloca i64, align 64
53 call void @capture(ptr %a)