xref: /llvm-project/llvm/test/tools/llvm-readobj/COFF/arm64-win-error2.s (revision 7f7dac712694ed661b2e774573b9ee1f99208882)
1## Check that the error for an inconsistent header works.
2## The first word contains the bad value for CodeWords, 0xf, which indicates
3## that we need 0x11110 << 2 =  120 bytes of space for the unwind codes.
4## It follows that the .xdata section is badly formed as only 8 bytes are
5## allocated for the unwind codes.
6
7// REQUIRES: aarch64-registered-target
8// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o - \
9// RUN:   | not --crash llvm-readobj --unwind - 2>&1 | FileCheck %s
10
11// CHECK: LLVM ERROR: Malformed unwind data
12
13	.text
14	.globl	"?func@@YAHXZ"
15	.p2align	3
16"?func@@YAHXZ":
17	sub     sp,sp,#0x10
18	stp     x19,lr,[sp]
19	sub     sp,sp,#0x1F0
20	mov     w19,w0
21	bl	"?func2@@YAXXZ"
22	cmp     w19,#2
23	ble     .LBB0_1
24	bl      "?func2@@YAHXZ"
25	add      sp,sp,#0x1F0
26	ldp      x19,lr,[sp]
27	add      sp,sp,#0x10
28	ret
29.LBB0_1:
30	mov      x0,sp
31	bl       "?func3@@YAHPEAH@Z"
32	add      sp,sp,#0x1F0
33	ldp      x19,lr,[sp]
34	add      sp,sp,#0x10
35	ret
36
37.section .pdata,"dr"
38	.long "?func@@YAHXZ"@IMGREL
39        .long "$unwind$func@@YAHXZ"@IMGREL
40
41
42.section	.xdata,"dr"
43"$unwind$func@@YAHXZ":
44        .p2align	3
45	.long		0xf0800012
46	.long 		0x8
47	.long 		0xe
48	.long 		0x100d61f
49	.long 		0xe3e3e3e4
50
51