1## Check interpretation of the packed unwind info format. 2 3// REQUIRES: aarch64-registered-target 4// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o %t.o 5// RUN: llvm-readobj --unwind %t.o | FileCheck %s 6 7// CHECK: UnwindInformation [ 8// CHECK-NEXT: RuntimeFunction { 9// CHECK-NEXT: Function: func1 10// CHECK-NEXT: Fragment: No 11// CHECK-NEXT: FunctionLength: 88 12// CHECK-NEXT: RegF: 7 13// CHECK-NEXT: RegI: 10 14// CHECK-NEXT: HomedParameters: No 15// CHECK-NEXT: CR: 0 16// CHECK-NEXT: FrameSize: 160 17// CHECK-NEXT: Prologue [ 18// CHECK-NEXT: sub sp, sp, #16 19// CHECK-NEXT: stp d14, d15, [sp, #128] 20// CHECK-NEXT: stp d12, d13, [sp, #112] 21// CHECK-NEXT: stp d10, d11, [sp, #96] 22// CHECK-NEXT: stp d8, d9, [sp, #80] 23// CHECK-NEXT: stp x27, x28, [sp, #64] 24// CHECK-NEXT: stp x25, x26, [sp, #48] 25// CHECK-NEXT: stp x23, x24, [sp, #32] 26// CHECK-NEXT: stp x21, x22, [sp, #16] 27// CHECK-NEXT: stp x19, x20, [sp, #-144]! 28// CHECK-NEXT: end 29// CHECK-NEXT: ] 30// CHECK-NEXT: } 31// CHECK-NEXT: RuntimeFunction { 32// CHECK-NEXT: Function: func2 33// CHECK-NEXT: Fragment: No 34// CHECK-NEXT: FunctionLength: 48 35// CHECK-NEXT: RegF: 2 36// CHECK-NEXT: RegI: 3 37// CHECK-NEXT: HomedParameters: No 38// CHECK-NEXT: CR: 0 39// CHECK-NEXT: FrameSize: 48 40// CHECK-NEXT: Prologue [ 41// CHECK-NEXT: str d10, [sp, #40] 42// CHECK-NEXT: stp d8, d9, [sp, #24] 43// CHECK-NEXT: str x21, [sp, #16] 44// CHECK-NEXT: stp x19, x20, [sp, #-48]! 45// CHECK-NEXT: end 46// CHECK-NEXT: ] 47// CHECK-NEXT: } 48// CHECK-NEXT: RuntimeFunction { 49// CHECK-NEXT: Function: func3 50// CHECK-NEXT: Fragment: No 51// CHECK-NEXT: FunctionLength: 40 52// CHECK-NEXT: RegF: 3 53// CHECK-NEXT: RegI: 1 54// CHECK-NEXT: HomedParameters: No 55// CHECK-NEXT: CR: 0 56// CHECK-NEXT: FrameSize: 48 57// CHECK-NEXT: Prologue [ 58// CHECK-NEXT: stp d10, d11, [sp, #24] 59// CHECK-NEXT: stp d8, d9, [sp, #8] 60// CHECK-NEXT: str x19, [sp, #-48]! 61// CHECK-NEXT: end 62// CHECK-NEXT: ] 63// CHECK-NEXT: } 64// CHECK-NEXT: RuntimeFunction { 65// CHECK-NEXT: Function: func4 66// CHECK-NEXT: Fragment: No 67// CHECK-NEXT: FunctionLength: 24 68// CHECK-NEXT: RegF: 1 69// CHECK-NEXT: RegI: 0 70// CHECK-NEXT: HomedParameters: No 71// CHECK-NEXT: CR: 0 72// CHECK-NEXT: FrameSize: 48 73// CHECK-NEXT: Prologue [ 74// CHECK-NEXT: sub sp, sp, #32 75// CHECK-NEXT: stp d8, d9, [sp, #-16]! 76// CHECK-NEXT: end 77// CHECK-NEXT: ] 78// CHECK-NEXT: } 79// CHECK-NEXT: RuntimeFunction { 80// CHECK-NEXT: Function: func5 81// CHECK-NEXT: Fragment: No 82// CHECK-NEXT: FunctionLength: 56 83// CHECK-NEXT: RegF: 0 84// CHECK-NEXT: RegI: 1 85// CHECK-NEXT: HomedParameters: Yes 86// CHECK-NEXT: CR: 0 87// CHECK-NEXT: FrameSize: 112 88// CHECK-NEXT: Prologue [ 89// CHECK-NEXT: sub sp, sp, #32 90// CHECK-NEXT: stp x6, x7, [sp, #56] 91// CHECK-NEXT: stp x4, x5, [sp, #40] 92// CHECK-NEXT: stp x2, x3, [sp, #24] 93// CHECK-NEXT: stp x0, x1, [sp, #8] 94// CHECK-NEXT: str x19, [sp, #-80]! 95// CHECK-NEXT: end 96// CHECK-NEXT: ] 97// CHECK-NEXT: } 98// CHECK-NEXT: RuntimeFunction { 99// CHECK-NEXT: Function: func6 100// CHECK-NEXT: Fragment: No 101// CHECK-NEXT: FunctionLength: 48 102// CHECK-NEXT: RegF: 0 103// CHECK-NEXT: RegI: 0 104// CHECK-NEXT: HomedParameters: Yes 105// CHECK-NEXT: CR: 0 106// CHECK-NEXT: FrameSize: 112 107// CHECK-NEXT: Prologue [ 108// CHECK-NEXT: sub sp, sp, #48 109// CHECK-NEXT: stp x6, x7, [sp, #48] 110// CHECK-NEXT: stp x4, x5, [sp, #32] 111// CHECK-NEXT: stp x2, x3, [sp, #16] 112// CHECK-NEXT: stp x0, x1, [sp, #-64]! 113// CHECK-NEXT: end 114// CHECK-NEXT: ] 115// CHECK-NEXT: } 116// CHECK-NEXT: RuntimeFunction { 117// CHECK-NEXT: Function: func7 118// CHECK-NEXT: Fragment: No 119// CHECK-NEXT: FunctionLength: 24 120// CHECK-NEXT: RegF: 0 121// CHECK-NEXT: RegI: 0 122// CHECK-NEXT: HomedParameters: No 123// CHECK-NEXT: CR: 1 124// CHECK-NEXT: FrameSize: 32 125// CHECK-NEXT: Prologue [ 126// CHECK-NEXT: sub sp, sp, #16 127// CHECK-NEXT: str lr, [sp, #-16]! 128// CHECK-NEXT: end 129// CHECK-NEXT: ] 130// CHECK-NEXT: } 131// CHECK-NEXT: RuntimeFunction { 132// CHECK-NEXT: Function: func8 133// CHECK-NEXT: Fragment: No 134// CHECK-NEXT: FunctionLength: 24 135// CHECK-NEXT: RegF: 0 136// CHECK-NEXT: RegI: 1 137// CHECK-NEXT: HomedParameters: No 138// CHECK-NEXT: CR: 1 139// CHECK-NEXT: FrameSize: 32 140// CHECK-NEXT: Prologue [ 141// CHECK-NEXT: sub sp, sp, #16 142// CHECK-NEXT: stp x19, lr, [sp, #-16]! 143// CHECK-NEXT: end 144// CHECK-NEXT: ] 145// CHECK-NEXT: } 146// CHECK-NEXT: RuntimeFunction { 147// CHECK-NEXT: Function: func9 148// CHECK-NEXT: Fragment: No 149// CHECK-NEXT: FunctionLength: 32 150// CHECK-NEXT: RegF: 0 151// CHECK-NEXT: RegI: 2 152// CHECK-NEXT: HomedParameters: No 153// CHECK-NEXT: CR: 1 154// CHECK-NEXT: FrameSize: 32 155// CHECK-NEXT: Prologue [ 156// CHECK-NEXT: str lr, [sp, #16] 157// CHECK-NEXT: stp x19, x20, [sp, #-32]! 158// CHECK-NEXT: end 159// CHECK-NEXT: ] 160// CHECK-NEXT: } 161// CHECK-NEXT: RuntimeFunction { 162// CHECK-NEXT: Function: func10 163// CHECK-NEXT: Fragment: No 164// CHECK-NEXT: FunctionLength: 32 165// CHECK-NEXT: RegF: 0 166// CHECK-NEXT: RegI: 3 167// CHECK-NEXT: HomedParameters: No 168// CHECK-NEXT: CR: 1 169// CHECK-NEXT: FrameSize: 48 170// CHECK-NEXT: Prologue [ 171// CHECK-NEXT: sub sp, sp, #16 172// CHECK-NEXT: stp x21, lr, [sp, #16] 173// CHECK-NEXT: stp x19, x20, [sp, #-32]! 174// CHECK-NEXT: end 175// CHECK-NEXT: ] 176// CHECK-NEXT: } 177// CHECK-NEXT: RuntimeFunction { 178// CHECK-NEXT: Function: func11 179// CHECK-NEXT: Fragment: No 180// CHECK-NEXT: FunctionLength: 32 181// CHECK-NEXT: RegF: 0 182// CHECK-NEXT: RegI: 2 183// CHECK-NEXT: HomedParameters: No 184// CHECK-NEXT: CR: 3 185// CHECK-NEXT: FrameSize: 48 186// CHECK-NEXT: Prologue [ 187// CHECK-NEXT: mov x29, sp 188// CHECK-NEXT: stp x29, lr, [sp, #-32]! 189// CHECK-NEXT: stp x19, x20, [sp, #-16]! 190// CHECK-NEXT: end 191// CHECK-NEXT: ] 192// CHECK-NEXT: } 193// CHECK-NEXT: RuntimeFunction { 194// CHECK-NEXT: Function: func12 195// CHECK-NEXT: Fragment: No 196// CHECK-NEXT: FunctionLength: 40 197// CHECK-NEXT: RegF: 0 198// CHECK-NEXT: RegI: 2 199// CHECK-NEXT: HomedParameters: No 200// CHECK-NEXT: CR: 3 201// CHECK-NEXT: FrameSize: 544 202// CHECK-NEXT: Prologue [ 203// CHECK-NEXT: mov x29, sp 204// CHECK-NEXT: stp x29, lr, [sp, #0] 205// CHECK-NEXT: sub sp, sp, #528 206// CHECK-NEXT: stp x19, x20, [sp, #-16]! 207// CHECK-NEXT: end 208// CHECK-NEXT: ] 209// CHECK-NEXT: } 210// CHECK-NEXT: RuntimeFunction { 211// CHECK-NEXT: Function: func13 212// CHECK-NEXT: Fragment: No 213// CHECK-NEXT: FunctionLength: 48 214// CHECK-NEXT: RegF: 0 215// CHECK-NEXT: RegI: 2 216// CHECK-NEXT: HomedParameters: No 217// CHECK-NEXT: CR: 3 218// CHECK-NEXT: FrameSize: 4112 219// CHECK-NEXT: Prologue [ 220// CHECK-NEXT: mov x29, sp 221// CHECK-NEXT: stp x29, lr, [sp, #0] 222// CHECK-NEXT: sub sp, sp, #16 223// CHECK-NEXT: sub sp, sp, #4080 224// CHECK-NEXT: stp x19, x20, [sp, #-16]! 225// CHECK-NEXT: end 226// CHECK-NEXT: ] 227// CHECK-NEXT: } 228// CHECK-NEXT: RuntimeFunction { 229// CHECK-NEXT: Function: func14 230// CHECK-NEXT: Fragment: No 231// CHECK-NEXT: FunctionLength: 32 232// CHECK-NEXT: RegF: 0 233// CHECK-NEXT: RegI: 2 234// CHECK-NEXT: HomedParameters: No 235// CHECK-NEXT: CR: 0 236// CHECK-NEXT: FrameSize: 4112 237// CHECK-NEXT: Prologue [ 238// CHECK-NEXT: sub sp, sp, #16 239// CHECK-NEXT: sub sp, sp, #4080 240// CHECK-NEXT: stp x19, x20, [sp, #-16]! 241// CHECK-NEXT: end 242// CHECK-NEXT: ] 243// CHECK-NEXT: } 244// CHECK-NEXT: RuntimeFunction { 245// CHECK-NEXT: Function: func15 246// CHECK-NEXT: Fragment: No 247// CHECK-NEXT: FunctionLength: 24 248// CHECK-NEXT: RegF: 0 249// CHECK-NEXT: RegI: 2 250// CHECK-NEXT: HomedParameters: No 251// CHECK-NEXT: CR: 0 252// CHECK-NEXT: FrameSize: 560 253// CHECK-NEXT: Prologue [ 254// CHECK-NEXT: sub sp, sp, #544 255// CHECK-NEXT: stp x19, x20, [sp, #-16]! 256// CHECK-NEXT: end 257// CHECK-NEXT: ] 258// CHECK-NEXT: } 259// CHECK-NEXT: RuntimeFunction { 260// CHECK-NEXT: Function: func16 261// CHECK-NEXT: Fragment: No 262// CHECK-NEXT: FunctionLength: 56 263// CHECK-NEXT: RegF: 0 264// CHECK-NEXT: RegI: 0 265// CHECK-NEXT: HomedParameters: Yes 266// CHECK-NEXT: CR: 1 267// CHECK-NEXT: FrameSize: 112 268// CHECK-NEXT: Prologue [ 269// CHECK-NEXT: sub sp, sp, #32 270// CHECK-NEXT: stp x6, x7, [sp, #56] 271// CHECK-NEXT: stp x4, x5, [sp, #40] 272// CHECK-NEXT: stp x2, x3, [sp, #24] 273// CHECK-NEXT: stp x0, x1, [sp, #8] 274// CHECK-NEXT: str lr, [sp, #-80]! 275// CHECK-NEXT: end 276// CHECK-NEXT: ] 277// CHECK-NEXT: } 278// CHECK-NEXT: ] 279 280 .text 281 .globl func1 282func1: 283func2: 284func3: 285func4: 286func5: 287func6: 288func7: 289func8: 290func9: 291func10: 292func11: 293func12: 294func13: 295func14: 296func15: 297func16: 298 ret 299 300 .section .pdata,"dr" 301 .long func1@IMGREL 302 .long 0x050ae059 // FunctionLength=22 RegF=7 RegI=10 H=0 CR=0 FrameSize=10 303 .long func2@IMGREL 304 .long 0x01834031 // FunctionLength=12 RegF=2 RegI=3 H=0 CR=0 FrameSize=3 305 .long func3@IMGREL 306 .long 0x01816029 // FunctionLength=10 RegF=3 RegI=1 H=0 CR=0 FrameSize=3 307 .long func4@IMGREL 308 .long 0x01802019 // FunctionLength=6 RegF=1 RegI=0 H=0 CR=0 FrameSize=3 309 .long func5@IMGREL 310 .long 0x03910039 // FunctionLength=14 RegF=0 RegI=1 H=1 CR=0 FrameSize=7 311 .long func6@IMGREL 312 .long 0x03900031 // FunctionLength=12 RegF=0 RegI=0 H=1 CR=0 FrameSize=7 313 .long func7@IMGREL 314 .long 0x01200019 // FunctionLength=6 RegF=0 RegI=0 H=0 CR=1 FrameSize=2 315 .long func8@IMGREL 316 .long 0x01210019 // FunctionLength=6 RegF=0 RegI=1 H=0 CR=1 FrameSize=2 317 .long func9@IMGREL 318 .long 0x01220021 // FunctionLength=8 RegF=0 RegI=2 H=0 CR=1 FrameSize=2 319 .long func10@IMGREL 320 .long 0x01a30021 // FunctionLength=8 RegF=0 RegI=3 H=0 CR=1 FrameSize=3 321 .long func11@IMGREL 322 .long 0x01e20021 // FunctionLength=8 RegF=0 RegI=2 H=0 CR=3 FrameSize=3 323 .long func12@IMGREL 324 .long 0x11620029 // FunctionLength=10 RegF=0 RegI=2 H=0 CR=3 FrameSize=34 325 .long func13@IMGREL 326 .long 0x80e20031 // FunctionLength=12 RegF=0 RegI=2 H=0 CR=3 FrameSize=257 327 .long func14@IMGREL 328 .long 0x80820021 // FunctionLength=8 RegF=0 RegI=2 H=0 CR=0 FrameSize=257 329 .long func15@IMGREL 330 .long 0x11820019 // FunctionLength=6 RegF=0 RegI=2 H=0 CR=0 FrameSize=34 331 .long func16@IMGREL 332 .long 0x03b00039 // FunctionLength=14 RegF=0 RegI=0 H=1 CR=1 FrameSize=7 333