xref: /llvm-project/llvm/test/CodeGen/AArch64/stack-guard-reassign-sve.mir (revision 1ee315ae7964c8433b772e0b5d667834994ba753)
1# RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve -start-before=localstackalloc -stop-after=prologepilog -o - %s | FileCheck %s
2
3--- |
4  @__stack_chk_guard = external global ptr
5  define i32 @main(i32, ptr) {
6    %StackGuardSlot = alloca ptr
7    unreachable
8  }
9...
10---
11name:            main
12tracksRegLiveness: true
13frameInfo:
14# CHECK: stackSize: 544
15# CHECK: localFrameSize: 516
16  stackProtector:  '%stack.3.StackGuardSlot'
17stack:
18# Stack objects 0 and 1 should end up in the local stack area, objects 2 and 3
19# should end up in the SVE stack area with 3 (the stack guard) on top.
20  - { id: 0, size: 512, alignment: 1, stack-id: default }
21# CHECK:       - { id: 0, name: '', type: default, offset: -528, size: 512, alignment: 1,
22# CHECK-NEXT:      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
23# CHECK-NEXT:      local-offset: -512, debug-info-variable: '', debug-info-expression: '',
24# CHECK-NEXT:      debug-info-location: '' }
25  - { id: 1, size: 4, alignment: 4, stack-id: default }
26# CHECK:       - { id: 1, name: '', type: default, offset: -532, size: 4, alignment: 4,
27# CHECK-NEXT:      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
28# CHECK-NEXT:      local-offset: -516, debug-info-variable: '', debug-info-expression: '',
29# CHECK-NEXT:      debug-info-location: '' }
30  - { id: 2, size: 16, alignment: 16, stack-id: scalable-vector }
31# CHECK:       - { id: 2, name: '', type: default, offset: -32, size: 16, alignment: 16,
32# CHECK-NEXT:      stack-id: scalable-vector, callee-saved-register: '', callee-saved-restored: true,
33# CHECK-NEXT:      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
34  - { id: 3, name: StackGuardSlot, size: 8, alignment: 16, stack-id: scalable-vector }
35# CHECK:       - { id: 3, name: StackGuardSlot, type: default, offset: -16, size: 8,
36# CHECK-NEXT:      alignment: 16, stack-id: scalable-vector, callee-saved-register: '',
37# CHECK-NEXT:      callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
38# CHECK-NEXT:      debug-info-location: '' }
39body:             |
40  bb.0:
41    %25:gpr64common = LOAD_STACK_GUARD :: (dereferenceable invariant load (s64) from @__stack_chk_guard)
42    STRXui killed %25, %stack.3.StackGuardSlot, 0 :: (volatile store (s64) into %stack.3.StackGuardSlot)
43    %28:gpr64 = LDRXui %stack.3.StackGuardSlot, 0 :: (volatile load (s64) from %stack.3.StackGuardSlot)
44    %29:gpr64common = LOAD_STACK_GUARD :: (dereferenceable invariant load (s64) from @__stack_chk_guard)
45    RET_ReallyLR implicit undef $w0, implicit killed %28, implicit killed %29
46
47...
48