1# RUN: llc -o - %s -mtriple=aarch64-windows -start-after=prologepilog \
2# RUN:    -filetype=obj | llvm-readobj --unwind - | FileCheck %s
3# Test that the register pairing of both general purpose and floating point
4# registers is correctly saved in the .xdata section, as well as the pre/post
5# increment of floating point register pairs.
6
7# CHECK:        ExceptionData {
8# CHECK-NEXT:      FunctionLength: 124
9# CHECK-NEXT:      Version: 0
10# CHECK-NEXT:      ExceptionData: No
11# CHECK-NEXT:      EpiloguePacked: Yes
12# CHECK-NEXT:      EpilogueOffset: 0
13# CHECK-NEXT:      ByteCodeLength: 16
14# CHECK-NEXT:      Prologue [
15# CHECK-NEXT:        0xc80c              ; stp x19, x20, [sp, #96]
16# CHECK-NEXT:        0xc88a              ; stp x21, x22, [sp, #80]
17# CHECK-NEXT:        0xc908              ; stp x23, x24, [sp, #64]
18# CHECK-NEXT:        0xc986              ; stp x25, x26, [sp, #48]
19# CHECK-NEXT:        0xca04              ; stp x27, x28, [sp, #32]
20# CHECK-NEXT:        0xd802              ; stp d8, d9, [sp, #16]
21# CHECK-NEXT:        0xda8d              ; stp d10, d11, [sp, #-112]!
22# CHECK-NEXT:        0xe4                ; end
23# CHECK-NEXT:      ]
24# CHECK-NEXT:    }
25...
26---
27name:            test
28alignment:       4
29exposesReturnsTwice: false
30legalized:       false
31regBankSelected: false
32selected:        false
33failedISel:      false
34tracksRegLiveness: true
35hasWinCFI:       true
36registers:
37liveins:
38  - { reg: '$w0', virtual-reg: '' }
39frameInfo:
40  isFrameAddressTaken: false
41  isReturnAddressTaken: false
42  hasStackMap:     false
43  hasPatchPoint:   false
44  stackSize:       112
45  offsetAdjustment: 0
46  maxAlignment:    8
47  adjustsStack:    false
48  hasCalls:        false
49  stackProtector:  ''
50  maxCallFrameSize: 0
51  hasOpaqueSPAdjustment: true
52  hasVAStart:      false
53  hasMustTailInVarArgFunc: false
54  localFrameSize:  0
55  savePoint:       ''
56  restorePoint:    ''
57fixedStack:
58stack:
59  - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
60      stack-id: default, callee-saved-register: '$x19', callee-saved-restored: true,
61      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
62  - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
63      stack-id: default, callee-saved-register: '$x20', callee-saved-restored: true,
64      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
65  - { id: 2, name: '', type: spill-slot, offset: -24, size: 8, alignment: 8,
66      stack-id: default, callee-saved-register: '$x21', callee-saved-restored: true,
67      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
68  - { id: 3, name: '', type: spill-slot, offset: -32, size: 8, alignment: 8,
69      stack-id: default, callee-saved-register: '$x22', callee-saved-restored: true,
70      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
71  - { id: 4, name: '', type: spill-slot, offset: -40, size: 8, alignment: 8,
72      stack-id: default, callee-saved-register: '$x23', callee-saved-restored: true,
73      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
74  - { id: 5, name: '', type: spill-slot, offset: -48, size: 8, alignment: 8,
75      stack-id: default, callee-saved-register: '$x24', callee-saved-restored: true,
76      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
77  - { id: 6, name: '', type: spill-slot, offset: -56, size: 8, alignment: 8,
78      stack-id: default, callee-saved-register: '$x25', callee-saved-restored: true,
79      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
80  - { id: 7, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
81      stack-id: default, callee-saved-register: '$x26', callee-saved-restored: true,
82      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
83  - { id: 8, name: '', type: spill-slot, offset: -72, size: 8, alignment: 8,
84      stack-id: default, callee-saved-register: '$x27', callee-saved-restored: true,
85      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
86  - { id: 9, name: '', type: spill-slot, offset: -80, size: 8, alignment: 8,
87      stack-id: default, callee-saved-register: '$x28', callee-saved-restored: true,
88      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
89  - { id: 10, name: '', type: spill-slot, offset: -88, size: 8, alignment: 8,
90      stack-id: default, callee-saved-register: '$d8', callee-saved-restored: true,
91      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
92  - { id: 11, name: '', type: spill-slot, offset: -96, size: 8, alignment: 8,
93      stack-id: default, callee-saved-register: '$d9', callee-saved-restored: true,
94      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
95  - { id: 12, name: '', type: spill-slot, offset: -104, size: 8, alignment: 8,
96      stack-id: default, callee-saved-register: '$d10', callee-saved-restored: true,
97      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
98  - { id: 13, name: '', type: spill-slot, offset: -112, size: 8, alignment: 8,
99      stack-id: default, callee-saved-register: '$d11', callee-saved-restored: true,
100      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
101constants:
102body:             |
103  bb.0.entry:
104    liveins: $x0, $x1, $d0, $d1, $d10, $d11, $d8, $d9, $x27, $x28, $x25, $x26, $x23, $x24, $x21, $x22, $x19, $x20
105
106    early-clobber $sp = frame-setup STPDpre killed $d10, killed $d11, $sp, -14 :: (store 8 into %stack.12), (store 8 into %stack.13)
107    frame-setup SEH_SaveFRegP_X 10, 11, -112
108    frame-setup STPDi killed $d8, killed $d9, $sp, 2 :: (store 8 into %stack.10), (store 8 into %stack.11)
109    frame-setup SEH_SaveFRegP 8, 9, 16
110    frame-setup STPXi killed $x27, killed $x28, $sp, 4 :: (store 8 into %stack.8), (store 8 into %stack.9)
111    frame-setup SEH_SaveRegP 27, 28, 32
112    frame-setup STPXi killed $x25, killed $x26, $sp, 6 :: (store 8 into %stack.6), (store 8 into %stack.7)
113    frame-setup SEH_SaveRegP 25, 26, 48
114    frame-setup STPXi killed $x23, killed $x24, $sp, 8 :: (store 8 into %stack.4), (store 8 into %stack.5)
115    frame-setup SEH_SaveRegP 23, 24, 64
116    frame-setup STPXi killed $x21, killed $x22, $sp, 10 :: (store 8 into %stack.2), (store 8 into %stack.3)
117    frame-setup SEH_SaveRegP 21, 22, 80
118    frame-setup STPXi killed $x19, killed $x20, $sp, 12 :: (store 8 into %stack.0), (store 8 into %stack.1)
119    frame-setup SEH_SaveRegP 19, 20, 96
120    frame-setup SEH_PrologEnd
121    $x19 = ADDXrr $x0, killed $x1
122    $d8 = FADDDrr killed $d0, $d1
123    $d9 = FADDDrr $d8, $d1
124    $d10 = FADDDrr $d9, $d8
125    $d11 = FADDDrr killed $d9, $d10
126    $x20 = ADDXrr $x19, killed $x0
127    $x21 = ADDXrr $x20, killed $x19
128    $x22 = ADDXrr $x21, killed $x20
129    $x23 = ADDXrr $x22, killed $x21
130    $x24 = ADDXrr $x23, killed $x22
131    $x25 = ADDXrr $x24, killed $x23
132    $x26 = ADDXrr $x25, killed $x24
133    $x27 = ADDXrr $x26, killed $x25
134    $x28 = ADDXrr $x27, killed $x26
135    $x0 = COPY $d11
136    $x0 = ADDXrr $x0, killed $x28
137    frame-destroy SEH_EpilogStart
138    $x19, $x20 = frame-destroy LDPXi $sp, 12 :: (load 8 from %stack.0), (load 8 from %stack.1)
139    frame-destroy SEH_SaveRegP 19, 20, 96
140    $x21, $x22 = frame-destroy LDPXi $sp, 10 :: (load 8 from %stack.2), (load 8 from %stack.3)
141    frame-destroy SEH_SaveRegP 21, 22, 80
142    $x23, $x24 = frame-destroy LDPXi $sp, 8 :: (load 8 from %stack.4), (load 8 from %stack.5)
143    frame-destroy SEH_SaveRegP 23, 24, 64
144    $x25, $x26 = frame-destroy LDPXi $sp, 6 :: (load 8 from %stack.6), (load 8 from %stack.7)
145    frame-destroy SEH_SaveRegP 25, 26, 48
146    $x27, $x28 = frame-destroy LDPXi $sp, 4 :: (load 8 from %stack.8), (load 8 from %stack.9)
147    frame-destroy SEH_SaveRegP 27, 28, 32
148    $d8, $d9 = frame-destroy LDPDi $sp, 2 :: (load 8 from %stack.10), (load 8 from %stack.11)
149    frame-destroy SEH_SaveFRegP 8, 9, 16
150    early-clobber $sp, $d10, $d11 = frame-destroy LDPDpost $sp, 14 :: (load 8 from %stack.12), (load 8 from %stack.13)
151    frame-destroy SEH_SaveFRegP_X 10, 11, -112
152    frame-destroy SEH_EpilogEnd
153    RET_ReallyLR implicit $x0
154
155...
156