Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-readobj / COFF / arm-unwind-opcodes.s
blob98faf1b6b380389321613f1831eb1c731a5c4d6a
1 // REQUIRES: arm-registered-target
2 // RUN: llvm-mc -filetype=obj -triple thumbv7-windows-gnu %s -o %t.o
3 // RUN: llvm-readobj --unwind %t.o | FileCheck --strict-whitespace %s
5 // CHECK: RuntimeFunction {
6 // CHECK-NEXT: Function: func0
7 // CHECK: Prologue [
8 // CHECK-NEXT: 0xcb ; mov r11, sp
9 // CHECK-NEXT: 0x95 0x00 ; push.w {r8, r10, r12}
10 // CHECK-NEXT: 0xf6 0x13 ; vpush {d17-d19}
11 // CHECK-NEXT: 0xfc ; nop.w
12 // CHECK-NEXT: 0xf5 0x35 ; vpush {d3-d5}
13 // CHECK-NEXT: 0xfb ; nop
14 // CHECK-NEXT: 0xe2 ; vpush {d8-d10}
15 // CHECK-NEXT: 0x08 ; sub sp, #(8 * 4)
16 // CHECK-NEXT: 0xd6 ; push {r4-r6, lr}
17 // CHECK-NEXT: ]
18 // CHECK-NEXT: EpilogueScopes [
19 // CHECK-NEXT: EpilogueScope {
20 // CHECK-NEXT: StartOffset: 15
21 // CHECK-NEXT: Condition: 14
22 // CHECK-NEXT: EpilogueStartIndex: 13
23 // CHECK-NEXT: Opcodes [
24 // CHECK-NEXT: 0xe2 ; vpop {d8-d10}
25 // CHECK-NEXT: 0xcb ; mov sp, r11
26 // CHECK-NEXT: 0x08 ; add sp, #(8 * 4)
27 // CHECK-NEXT: 0xd6 ; pop {r4-r6, pc}
28 // CHECK-NEXT: ]
29 // CHECK-NEXT: }
30 // CHECK-NEXT: ]
31 // CHECK: RuntimeFunction {
32 // CHECK-NEXT: Function: func1
33 // CHECK: Prologue [
34 // CHECK-NEXT: 0xef 0x08 ; str.w lr, [sp, #-32]!
35 // CHECK-NEXT: 0xd1 ; push {r4-r5}
36 // CHECK-NEXT: 0xfd ; bx <reg>
37 // CHECK-NEXT: ]
38 // CHECK-NEXT: EpilogueScopes [
39 // CHECK-NEXT: EpilogueScope {
40 // CHECK-NEXT: StartOffset: 4
41 // CHECK-NEXT: Condition: 14
42 // CHECK-NEXT: EpilogueStartIndex: 4
43 // CHECK-NEXT: Opcodes [
44 // CHECK-NEXT: 0xef 0x08 ; ldr.w lr, [sp], #32
45 // CHECK-NEXT: 0xd1 ; pop {r4-r5}
46 // CHECK-NEXT: 0xfd ; bx <reg>
47 // CHECK-NEXT: ]
48 // CHECK-NEXT: }
49 // CHECK-NEXT: ]
50 // CHECK: RuntimeFunction {
51 // CHECK-NEXT: Function: func2
52 // CHECK-NEXT: ExceptionRecord:
53 // CHECK-NEXT: ExceptionData {
54 // CHECK-NEXT: FunctionLength:
55 // CHECK-NEXT: Version:
56 // CHECK-NEXT: ExceptionData: No
57 // CHECK-NEXT: EpiloguePacked: Yes
58 // CHECK-NEXT: Fragment: No
59 // CHECK-NEXT: EpilogueOffset: 0
60 // CHECK-NEXT: ByteCodeLength:
61 // CHECK-NEXT: Prologue [
62 // CHECK-NEXT: 0x04 ; sub sp, #(4 * 4)
63 // CHECK-NEXT: 0xec 0x80 ; push {r7}
64 // CHECK-NEXT: 0xc7 ; mov r7, sp
65 // CHECK-NEXT: 0xfe ; b.w <target>
66 // CHECK-NEXT: ]
67 // CHECK-NEXT: }
68 // CHECK-NEXT: }
69 // CHECK-NEXT: RuntimeFunction {
70 // CHECK-NEXT: Function: func3
71 // CHECK-NEXT: ExceptionRecord:
72 // CHECK-NEXT: ExceptionData {
73 // CHECK-NEXT: FunctionLength:
74 // CHECK-NEXT: Version:
75 // CHECK-NEXT: ExceptionData: No
76 // CHECK-NEXT: EpiloguePacked: Yes
77 // CHECK-NEXT: Fragment: Yes
78 // CHECK-NEXT: EpilogueOffset: 1
79 // CHECK-NEXT: ByteCodeLength:
80 // CHECK-NEXT: Prologue [
81 // CHECK-NEXT: 0x04 ; sub sp, #(4 * 4)
82 // CHECK-NEXT: 0xdf ; push.w {r4-r11, lr}
83 // CHECK-NEXT: ]
84 // CHECK-NEXT: Epilogue [
85 // CHECK-NEXT: 0xdf ; pop.w {r4-r11, pc}
86 // CHECK-NEXT: ]
87 // CHECK-NEXT: }
88 // CHECK-NEXT: }
89 // CHECK-NEXT: RuntimeFunction {
90 // CHECK-NEXT: Function: func4
91 // CHECK-NEXT: ExceptionRecord:
92 // CHECK-NEXT: ExceptionData {
93 // CHECK-NEXT: FunctionLength:
94 // CHECK-NEXT: Version:
95 // CHECK-NEXT: ExceptionData: No
96 // CHECK-NEXT: EpiloguePacked: Yes
97 // CHECK-NEXT: Fragment: No
98 // CHECK-NEXT: EpilogueOffset: 0
99 // CHECK-NEXT: ByteCodeLength:
100 // CHECK-NEXT: Prologue [
101 // CHECK-NEXT: 0xec 0x50 ; push {r4, r6}
102 // CHECK-NEXT: 0xb5 0x00 ; push.w {r8, r10, r12, lr}
103 // CHECK-NEXT: ]
104 // CHECK-NEXT: }
105 // CHECK-NEXT: }
106 // CHECK-NEXT: RuntimeFunction {
107 // CHECK-NEXT: Function: func5
108 // CHECK-NEXT: ExceptionRecord:
109 // CHECK-NEXT: ExceptionData {
110 // CHECK-NEXT: FunctionLength:
111 // CHECK-NEXT: Version:
112 // CHECK-NEXT: ExceptionData: No
113 // CHECK-NEXT: EpiloguePacked: Yes
114 // CHECK-NEXT: Fragment: No
115 // CHECK-NEXT: EpilogueOffset: 16
116 // CHECK-NEXT: ByteCodeLength:
117 // CHECK-NEXT: Prologue [
118 // CHECK-NEXT: 0xfa 0x00 0x00 0x20 ; sub.w sp, sp, #(32 * 4)
119 // CHECK-NEXT: 0xf9 0x00 0x10 ; sub.w sp, sp, #(16 * 4)
120 // CHECK-NEXT: 0xf8 0x00 0x00 0x08 ; sub sp, sp, #(8 * 4)
121 // CHECK-NEXT: 0xf7 0x00 0x04 ; sub sp, sp, #(4 * 4)
122 // CHECK-NEXT: 0xe8 0x02 ; sub.w sp, #(2 * 4)
123 // CHECK-NEXT: 0xed 0x50 ; push {r4, r6, lr}
124 // CHECK-NEXT: ]
125 // CHECK-NEXT: Epilogue [
126 // CHECK-NEXT: 0xed 0x50 ; pop {r4, r6, pc}
127 // CHECK-NEXT: ]
128 // CHECK-NEXT: }
129 // CHECK-NEXT: }
131 .thumb
132 .syntax unified
133 func0:
134 push {r4-r6, lr}
135 sub sp, sp, #32
136 vpush {d8-d10}
138 vpush {d3-d5}
139 nop.w
140 vpush {d17-d19}
141 push {r8, r10, r12}
142 mov r11, sp
144 vpop {d8-d10}
145 mov sp, r11
146 add sp, sp, #32
147 pop {r4-r6, pc}
149 func1:
150 push {r4-r5}
151 str lr, [sp, #-32]!
153 ldr lr, [sp], #32
154 pop {r4-r5}
155 bx lr
157 func2:
158 mov r7, sp
159 push {r7}
160 sub sp, sp, #16
162 add sp, sp, #16
163 pop {r7}
164 mov sp, r7
165 b tailcall
167 func3:
168 nop.w
171 add sp, sp, #16
172 pop {r4-r11, pc}
174 func4:
175 push {r8, r10, r12, lr}
176 push {r4, r6}
178 pop {r4, r6}
179 pop {r8, r10, r12, pc}
181 func5:
182 push {r4, r6, lr}
183 subw sp, sp, #8
184 sub sp, sp, #16
185 sub sp, sp, #32
186 subw sp, sp, #64
187 subw sp, sp, #128
189 pop {r4, r6, pc}
191 .section .pdata,"dr"
192 .rva func0
193 .rva .Lunwind_func0
194 .rva func1
195 .rva .Lunwind_func1
196 .rva func2
197 .rva .Lunwind_func2
198 .rva func3
199 .rva .Lunwind_func3
200 .rva func4
201 .rva .Lunwind_func4
202 .rva func5
203 .rva .Lunwind_func5
205 .section .xdata,"dr"
206 .Lunwind_func0:
207 .byte 0x14, 0x00, 0x80, 0x50
208 .byte 0x0f, 0x00, 0xe0, 0x0d
209 .byte 0xcb, 0x95, 0x00, 0xf6
210 .byte 0x13, 0xfc, 0xf5, 0x35
211 .byte 0xfb, 0xe2, 0x08, 0xd6
212 .byte 0xff, 0xe2, 0xcb, 0x08
213 .byte 0xd6, 0xff, 0x00, 0x00
215 .Lunwind_func1:
216 .byte 0x08, 0x00, 0x00, 0x00
217 .byte 0x01, 0x00, 0x02, 0x00
218 .byte 0x04, 0x00, 0xe0, 0x04
219 .byte 0xef, 0x08, 0xd1, 0xfd
220 .byte 0xef, 0x08, 0xd1, 0xfd
222 .Lunwind_func2:
223 .byte 0x09, 0x00, 0x20, 0x20
224 .byte 0x04, 0xec, 0x80, 0xc7
225 .byte 0xfe, 0x00, 0x00, 0x00
226 .Lunwind_func3:
227 .byte 0x07, 0x00, 0xe0, 0x10
228 .byte 0x04, 0xdf, 0xff, 0x00
229 .Lunwind_func4:
230 .byte 0x07, 0x00, 0x20, 0x20
231 .byte 0xec, 0x50, 0xb5, 0x00
232 .byte 0xff, 0x00, 0x00, 0x00
233 .Lunwind_func5:
234 .byte 0x0b, 0x00, 0x20, 0x58
235 .byte 0xfa, 0x00, 0x00, 0x20
236 .byte 0xf9, 0x00, 0x10, 0xf8
237 .byte 0x00, 0x00, 0x08, 0xf7
238 .byte 0x00, 0x04, 0xe8, 0x02
239 .byte 0xed, 0x50, 0xff, 0x00