1// Generated from g++ exception4.cpp -fomit-frame-pointer -S -O3
2// Manually modified to trigger shrink-wrapping in function main
3 .text
4 .p2align 4,,15
5 .globl _Z3fooi
6 .type _Z3fooi, @function
7_Z3fooi:
8.LFB12:
9 .cfi_startproc
10 subq $8, %rsp
11 .cfi_def_cfa_offset 16
12 cmpl $1, %edi
13 movl $1, %edi
14 jle .L2
15 call __cxa_allocate_exception
16 xorl %edx, %edx
17 movl $_ZTI4ExcG, %esi
18 movq %rax, %rdi
19 call __cxa_throw
20.L2:
21 call __cxa_allocate_exception
22 xorl %edx, %edx
23 movl $_ZTI4ExcC, %esi
24 movq %rax, %rdi
25 call __cxa_throw
26 .cfi_endproc
27.LFE12:
28 .size _Z3fooi, .-_Z3fooi
29 .p2align 4,,15
30 .globl _Z11filter_onlyi
31 .type _Z11filter_onlyi, @function
32_Z11filter_onlyi:
33.LFB13:
34 .cfi_startproc
35 .cfi_personality 0x3,__gxx_personality_v0
36 .cfi_lsda 0x3,.LLSDA13
37 subq $8, %rsp
38 .cfi_def_cfa_offset 16
39.LEHB0:
40 call _Z3fooi
41.LEHE0:
42.L8:
43 addq $1, %rdx
44 movq %rax, %rdi
45 je .L7
46.LEHB1:
47 call _Unwind_Resume
48.L7:
49 call __cxa_call_unexpected
50.LEHE1:
51 .cfi_endproc
52.LFE13:
53 .globl __gxx_personality_v0
54 .section .gcc_except_table,"a",@progbits
55 .align 4
56.LLSDA13:
57 .byte 0xff
58 .byte 0x3
59 .uleb128 .LLSDATT13-.LLSDATTD13
60.LLSDATTD13:
61 .byte 0x1
62 .uleb128 .LLSDACSE13-.LLSDACSB13
63.LLSDACSB13:
64 .uleb128 .LEHB0-.LFB13
65 .uleb128 .LEHE0-.LEHB0
66 .uleb128 .L8-.LFB13
67 .uleb128 0x1
68 .uleb128 .LEHB1-.LFB13
69 .uleb128 .LEHE1-.LEHB1
70 .uleb128 0
71 .uleb128 0
72.LLSDACSE13:
73 .byte 0x7f
74 .byte 0
75 .align 4
76 .long _ZTI4ExcA
77 .long _ZTI4ExcB
78 .long _ZTI4ExcC
79 .long _ZTI4ExcD
80 .long _ZTI4ExcE
81 .long _ZTI4ExcF
82.LLSDATT13:
83 .byte 0x1
84 .byte 0x2
85 .byte 0x3
86 .byte 0x4
87 .byte 0x5
88 .byte 0x6
89 .byte 0
90 .text
91 .size _Z11filter_onlyi, .-_Z11filter_onlyi
92 .section .rodata.str1.8,"aMS",@progbits,1
93 .align 8
94.LC0:
95 .string "this statement is cold and should be outlined"
96 .text
97 .p2align 4,,15
98 .globl _Z12never_throwsv
99 .type _Z12never_throwsv, @function
100_Z12never_throwsv:
101.LFB14:
102 .cfi_startproc
103 .cfi_personality 0x3,__gxx_personality_v0
104 .cfi_lsda 0x3,.LLSDA14
105 subq $8, %rsp
106 .cfi_def_cfa_offset 16
107 movl $.LC0, %edi
108.LEHB2:
109 call puts
110.LEHE2:
111 addq $8, %rsp
112 .cfi_remember_state
113 .cfi_def_cfa_offset 8
114 ret
115.L13:
116 .cfi_restore_state
117 addq $1, %rdx
118 movq %rax, %rdi
119 je .L12
120.LEHB3:
121 call _Unwind_Resume
122.L12:
123 call __cxa_call_unexpected
124.LEHE3:
125 .cfi_endproc
126.LFE14:
127 .section .gcc_except_table,"a",@progbits
128 .align 4
129.LLSDA14:
130 .byte 0xff
131 .byte 0x3
132 .uleb128 .LLSDATT14-.LLSDATTD14
133.LLSDATTD14:
134 .byte 0x1
135 .uleb128 .LLSDACSE14-.LLSDACSB14
136.LLSDACSB14:
137 .uleb128 .LEHB2-.LFB14
138 .uleb128 .LEHE2-.LEHB2
139 .uleb128 .L13-.LFB14
140 .uleb128 0x1
141 .uleb128 .LEHB3-.LFB14
142 .uleb128 .LEHE3-.LEHB3
143 .uleb128 0
144 .uleb128 0
145.LLSDACSE14:
146 .byte 0x7f
147 .byte 0
148 .align 4
149.LLSDATT14:
150 .byte 0
151 .text
152 .size _Z12never_throwsv, .-_Z12never_throwsv
153 .section .rodata.str1.1,"aMS",@progbits,1
154.LC1:
155 .string "catch 2"
156.LC2:
157 .string "catch 1"
158.LC3:
159 .string "caught ExcC"
160.LC4:
161 .string "caught ExcG"
162 .section .text.startup,"ax",@progbits
163 .p2align 4,,15
164 .globl main
165 .type main, @function
166main:
167.LFB15:
168 .cfi_startproc
169 .cfi_personality 0x3,__gxx_personality_v0
170 .cfi_lsda 0x3,.LLSDA15
171 pushq %r13
172 .cfi_def_cfa_offset 16
173 .cfi_offset 13, -16
174 pushq %r12
175 .cfi_def_cfa_offset 24
176 .cfi_offset 12, -24
177 pushq %rbp
178 .cfi_def_cfa_offset 32
179 .cfi_offset 6, -32
180 movl $10, %ebp
181 pushq %rbx
182 .cfi_def_cfa_offset 40
183 .cfi_offset 3, -40
184 movl %edi, %ebx
185 subq $8, %rsp
186 .cfi_def_cfa_offset 48
187.Lcheck:
188 cmpl $2, %ebx
189 je .Lmyexit
190.Lloop_pre_header:
191 movl $10, %ebp
192 jmp .L18
193.L18:
194 cmpl $2, %ebx
195 je .Lmyexit
196.L17:
197 movl $1, %edi
198 call __cxa_allocate_exception
199 xorl %edx, %edx
200 movl $_ZTI4ExcA, %esi
201 movq %rax, %rdi
202.LEHB4:
203 call __cxa_throw
204.LEHE4:
205.L47:
206 call _Z12never_throwsv
207 call _Z12never_throwsv
208 .p2align 4,,5
209 jmp .L17
210.L37:
211 cmpq $2, %rdx
212 movq %rax, %rdi
213 jne .L22
214 call __cxa_begin_catch
215 movl $.LC1, %edi
216.LEHB5:
217 call puts
218.LEHE5:
219 movl $8, %edi
220 call __cxa_allocate_exception
221 movl $4, %edi
222 movq %rax, %r12
223.LEHB6:
224 call _Znwm
225.LEHE6:
226 movl $0, (%rax)
227 xorl %edx, %edx
228 movq %rax, (%r12)
229 movl $_ZTIPi, %esi
230 movq %r12, %rdi
231.LEHB7:
232 call __cxa_throw
233.LEHE7:
234.L39:
235 movq %rax, %r13
236 movq %r12, %rdi
237 movq %r13, %r12
238 call __cxa_free_exception
239.L24:
240 call __cxa_end_catch
241 movq %r12, %rdi
242.L22:
243 call __cxa_begin_catch
244 movl $.LC2, %edi
245.LEHB8:
246 call puts
247.LEHE8:
248.LEHB9:
249 call __cxa_end_catch
250.LEHE9:
251 movl %ebx, %edi
252.LEHB10:
253 call _Z11filter_onlyi
254.LEHE10:
255.L38:
256 movq %rax, %r12
257 jmp .L24
258.L41:
259 cmpq $4, %rdx
260 movq %rax, %rdi
261 movq %rdx, %rax
262 jne .L29
263 call __cxa_begin_catch
264 movl $.LC3, %edi
265.LEHB11:
266 call puts
267.LEHE11:
268.L35:
269 call __cxa_end_catch
270 subl $1, %ebp
271 jne .L18
272.Lmyexit:
273 popq %rdx
274 .cfi_remember_state
275 .cfi_def_cfa_offset 40
276 popq %rbx
277 .cfi_def_cfa_offset 32
278 popq %rbp
279 .cfi_def_cfa_offset 24
280 popq %r12
281 .cfi_def_cfa_offset 16
282 xorl %eax, %eax
283 popq %r13
284 .cfi_def_cfa_offset 8
285 ret
286.L40:
287 .cfi_restore_state
288 movq %rax, %rbx
289 call __cxa_end_catch
290 movq %rbx, %rdi
291.LEHB12:
292 call _Unwind_Resume
293.LEHE12:
294.L42:
295 movq %rax, %r13
296 movq %rdx, %r12
297 call __cxa_end_catch
298 movq %r13, %rdi
299 movq %r12, %rax
300.L29:
301 cmpq $3, %rax
302 jne .L46
303 call __cxa_begin_catch
304 movl $.LC4, %edi
305.LEHB13:
306 call puts
307.LEHE13:
308 jmp .L35
309.L43:
310 movq %rax, %rbx
311 call __cxa_end_catch
312 movq %rbx, %rdi
313.L46:
314.LEHB14:
315 call _Unwind_Resume
316 jmp .L43
317.LEHE14:
318 .cfi_endproc
319.LFE15:
320 .section .gcc_except_table,"a",@progbits
321 .align 4
322.LLSDA15:
323 .byte 0xff
324 .byte 0x3
325 .uleb128 .LLSDATT15-.LLSDATTD15
326.LLSDATTD15:
327 .byte 0x1
328 .uleb128 .LLSDACSE15-.LLSDACSB15
329.LLSDACSB15:
330 .uleb128 .LEHB4-.LFB15
331 .uleb128 .LEHE4-.LEHB4
332 .uleb128 .L37-.LFB15
333 .uleb128 0x3
334 .uleb128 .LEHB5-.LFB15
335 .uleb128 .LEHE5-.LEHB5
336 .uleb128 .L38-.LFB15
337 .uleb128 0x5
338 .uleb128 .LEHB6-.LFB15
339 .uleb128 .LEHE6-.LEHB6
340 .uleb128 .L39-.LFB15
341 .uleb128 0x5
342 .uleb128 .LEHB7-.LFB15
343 .uleb128 .LEHE7-.LEHB7
344 .uleb128 .L38-.LFB15
345 .uleb128 0x5
346 .uleb128 .LEHB8-.LFB15
347 .uleb128 .LEHE8-.LEHB8
348 .uleb128 .L40-.LFB15
349 .uleb128 0
350 .uleb128 .LEHB9-.LFB15
351 .uleb128 .LEHE9-.LEHB9
352 .uleb128 0
353 .uleb128 0
354 .uleb128 .LEHB10-.LFB15
355 .uleb128 .LEHE10-.LEHB10
356 .uleb128 .L41-.LFB15
357 .uleb128 0x9
358 .uleb128 .LEHB11-.LFB15
359 .uleb128 .LEHE11-.LEHB11
360 .uleb128 .L42-.LFB15
361 .uleb128 0xb
362 .uleb128 .LEHB12-.LFB15
363 .uleb128 .LEHE12-.LEHB12
364 .uleb128 0
365 .uleb128 0
366 .uleb128 .LEHB13-.LFB15
367 .uleb128 .LEHE13-.LEHB13
368 .uleb128 .L43-.LFB15
369 .uleb128 0
370 .uleb128 .LEHB14-.LFB15
371 .uleb128 .LEHE14-.LEHB14
372 .uleb128 0
373 .uleb128 0
374.LLSDACSE15:
375 .byte 0x1
376 .byte 0
377 .byte 0x2
378 .byte 0x7d
379 .byte 0
380 .byte 0x7b
381 .byte 0x3
382 .byte 0
383 .byte 0x4
384 .byte 0x7d
385 .byte 0
386 .byte 0x7b
387 .align 4
388 .long _ZTI4ExcC
389 .long _ZTI4ExcG
390 .long _ZTI4ExcA
391 .long 0
392
393.LLSDATT15:
394 .section .text.startup
395 .size main, .-main
396 .weak _ZTI4ExcG
397 .section .rodata._ZTI4ExcG,"aG",@progbits,_ZTI4ExcG,comdat
398 .align 16
399 .type _ZTI4ExcG, @object
400 .size _ZTI4ExcG, 16
401_ZTI4ExcG:
402 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
403 .quad _ZTS4ExcG
404 .weak _ZTS4ExcG
405 .section .rodata._ZTS4ExcG,"aG",@progbits,_ZTS4ExcG,comdat
406 .type _ZTS4ExcG, @object
407 .size _ZTS4ExcG, 6
408_ZTS4ExcG:
409 .string "4ExcG"
410 .weak _ZTI4ExcC
411 .section .rodata._ZTI4ExcC,"aG",@progbits,_ZTI4ExcC,comdat
412 .align 16
413 .type _ZTI4ExcC, @object
414 .size _ZTI4ExcC, 16
415_ZTI4ExcC:
416 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
417 .quad _ZTS4ExcC
418 .weak _ZTS4ExcC
419 .section .rodata._ZTS4ExcC,"aG",@progbits,_ZTS4ExcC,comdat
420 .type _ZTS4ExcC, @object
421 .size _ZTS4ExcC, 6
422_ZTS4ExcC:
423 .string "4ExcC"
424 .weak _ZTI4ExcA
425 .section .rodata._ZTI4ExcA,"aG",@progbits,_ZTI4ExcA,comdat
426 .align 16
427 .type _ZTI4ExcA, @object
428 .size _ZTI4ExcA, 16
429_ZTI4ExcA:
430 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
431 .quad _ZTS4ExcA
432 .weak _ZTS4ExcA
433 .section .rodata._ZTS4ExcA,"aG",@progbits,_ZTS4ExcA,comdat
434 .type _ZTS4ExcA, @object
435 .size _ZTS4ExcA, 6
436_ZTS4ExcA:
437 .string "4ExcA"
438 .weak _ZTI4ExcB
439 .section .rodata._ZTI4ExcB,"aG",@progbits,_ZTI4ExcB,comdat
440 .align 16
441 .type _ZTI4ExcB, @object
442 .size _ZTI4ExcB, 16
443_ZTI4ExcB:
444 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
445 .quad _ZTS4ExcB
446 .weak _ZTS4ExcB
447 .section .rodata._ZTS4ExcB,"aG",@progbits,_ZTS4ExcB,comdat
448 .type _ZTS4ExcB, @object
449 .size _ZTS4ExcB, 6
450_ZTS4ExcB:
451 .string "4ExcB"
452 .weak _ZTI4ExcD
453 .section .rodata._ZTI4ExcD,"aG",@progbits,_ZTI4ExcD,comdat
454 .align 16
455 .type _ZTI4ExcD, @object
456 .size _ZTI4ExcD, 16
457_ZTI4ExcD:
458 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
459 .quad _ZTS4ExcD
460 .weak _ZTS4ExcD
461 .section .rodata._ZTS4ExcD,"aG",@progbits,_ZTS4ExcD,comdat
462 .type _ZTS4ExcD, @object
463 .size _ZTS4ExcD, 6
464_ZTS4ExcD:
465 .string "4ExcD"
466 .weak _ZTI4ExcE
467 .section .rodata._ZTI4ExcE,"aG",@progbits,_ZTI4ExcE,comdat
468 .align 16
469 .type _ZTI4ExcE, @object
470 .size _ZTI4ExcE, 16
471_ZTI4ExcE:
472 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
473 .quad _ZTS4ExcE
474 .weak _ZTS4ExcE
475 .section .rodata._ZTS4ExcE,"aG",@progbits,_ZTS4ExcE,comdat
476 .type _ZTS4ExcE, @object
477 .size _ZTS4ExcE, 6
478_ZTS4ExcE:
479 .string "4ExcE"
480 .weak _ZTI4ExcF
481 .section .rodata._ZTI4ExcF,"aG",@progbits,_ZTI4ExcF,comdat
482 .align 16
483 .type _ZTI4ExcF, @object
484 .size _ZTI4ExcF, 16
485_ZTI4ExcF:
486 .quad _ZTVN10__cxxabiv117__class_type_infoE+16
487 .quad _ZTS4ExcF
488 .weak _ZTS4ExcF
489 .section .rodata._ZTS4ExcF,"aG",@progbits,_ZTS4ExcF,comdat
490 .type _ZTS4ExcF, @object
491 .size _ZTS4ExcF, 6
492_ZTS4ExcF:
493 .string "4ExcF"
494

source code of bolt/test/X86/Inputs/exc4sw.S