summaryrefslogtreecommitdiffstats
path: root/test/MC/ARM/eh-directive-unwind_raw.s
blob: c617aa37c497e82675decdbbb5ff7625cb3eabde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
@ RUN: llvm-mc -triple armv7-linux-eabi -filetype obj -o - %s | llvm-readobj -u \
@ RUN:   | FileCheck %s

	.syntax unified

	.type save,%function
	.thumb_func
save:
	.fnstart
	.unwind_raw 4, 0xb1, 0x01
	push {r0}
	pop {r0}
	bx lr
	.fnend

	.type empty,%function
	.thumb_func
empty:
	.fnstart
	.unwind_raw 0, 0xb0
	bx lr
	.fnend

	.type extended,%function
	.thumb_func
extended:
	.fnstart
	.unwind_raw 12, 0x9b, 0x40, 0x84, 0x80, 0xb0, 0xb0
	@ .save {fp, lr}
	stmfd sp!, {fp, lr}
	@ .setfp fp, sp, #4
	add fp, sp, #4
	@ .pad #8
	sub sp, sp, #8
	add sp, sp, #8
	sub fp, sp, #4
	ldmfd sp!, {fp, lr}
	bx lr
	.fnend

	.type refuse,%function
	.thumb_func
refuse:
	.fnstart
	.unwind_raw 0, 0x80, 0x00
	bx lr
	.fnend

	.type stack_adjust,%function
	.thumb_func
stack_adjust:
	.fnstart
	.setfp fp, sp, #32
	.unwind_raw 24, 0xc2
	.fnend

@ CHECK: UnwindInformation {
@ CHECK:   UnwindIndexTable {
@ CHECK:     SectionName: .ARM.exidx
@ CHECK:     Entries [
@ CHECK:       Entry {
@ CHECK:         Model: Compact (Inline)
@ CHECK:         PersonalityIndex: 0
@ CHECK:         Opcodes [
@ CHECK:           0xB1 0x01 ; pop {r0}
@ CHECK:           0xB0      ; finish
@ CHECK:         ]
@ CHECK:       }
@ CHECK:       Entry {
@ CHECK:         Model: Compact (Inline)
@ CHECK:         PersonalityIndex: 0
@ CHECK:         Opcodes [
@ CHECK:           0xB0      ; finish
@ CHECK:           0xB0      ; finish
@ CHECK:           0xB0      ; finish
@ CHECK:         ]
@ CHECK:       }
@ CHECK:       Entry {
@ CHECK:         ExceptionHandlingTable: .ARM.extab
@ CHECK:         Model: Compact
@ CHECK:         PersonalityIndex: 1
@ CHECK:         Opcodes [
@ CHECK:           0x9B      ; vsp = r11
@ CHECK:           0x40      ; vsp = vsp - 4
@ CHECK:           0x84 0x80 ; pop {fp, lr}
@ CHECK:           0xB0      ; finish
@ CHECK:           0xB0      ; finish
@ CHECK:         ]
@ CHECK:       }
@ CHECK:       Entry {
@ CHECK:         Model: Compact (Inline)
@ CHECK:         PersonalityIndex: 0
@ CHECK:         Opcodes [
@ CHECK:           0x80 0x00 ; refuse to unwind
@ CHECK:           0xB0      ; finish
@ CHECK:         ]
@ CHECK:       }
@ CHECK:       Entry {
@ CHECK:         Model: Compact (Inline)
@ CHECK:         PersonalityIndex: 0
@ CHECK:         Opcodes [
@ CHECK:           0x9B      ; vsp = r11
@ CHECK:           0x4D      ; vsp = vsp - 56
@ CHECK:           0xC2      ; pop {wR10, wR11, wR12}
@ CHECK:         ]
@ CHECK:       }
@ CHECK:     ]
@ CHECK:   }
@ CHECK: }