blob: dd1c6116b72ea9e6a9abd09f98c39b013aa8c687 [file]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc < %s | FileCheck %s
target triple = "aarch64-pc-windows-msvc-elf"
; This test uses a Windows triple with ELF binaries. This triple does not use
; Windows CFI, although it still uses CSR_Win_AArch64_AAPCS_SaveList for
; callee-saves.
; This test checks we do not attempt to pair x28 with the frame pointer (x29).
; Previously we did not recognize aarch64-pc-windows-msvc-elf as Windows
; (in FrameLowering), and failed to invalidate the pairing because the code
; assumed it was using the default CSR_AArch64_AAPCS_SaveList instead of
; CSR_Win_AArch64_AAPCS_SaveList.
define i32 @large_stack_requires_frame_record() "frame-pointer"="all" nounwind {
; CHECK-LABEL: large_stack_requires_frame_record:
; CHECK: // %bb.0:
; CHECK-NEXT: str x28, [sp, #-32]! // 8-byte Folded Spill
; CHECK-NEXT: stp x29, x30, [sp, #8] // 16-byte Folded Spill
; CHECK-NEXT: add x29, sp, #8
; CHECK-NEXT: sub sp, sp, #512
; CHECK-NEXT: adrp x8, :got:baz
; CHECK-NEXT: mov x0, sp
; CHECK-NEXT: ldr x8, [x8, :got_lo12:baz]
; CHECK-NEXT: blr x8
; CHECK-NEXT: mov w0, wzr
; CHECK-NEXT: add sp, sp, #512
; CHECK-NEXT: ldp x29, x30, [sp, #8] // 16-byte Folded Reload
; CHECK-NEXT: ldr x28, [sp], #32 // 8-byte Folded Reload
; CHECK-NEXT: ret
%x = alloca [500 x i8], align 16
call void @baz(ptr %x)
ret i32 0
}
declare void @baz(ptr)