xref: /llvm-project/llvm/test/ExecutionEngine/JITLink/AArch64/ELF_ehframe.s (revision bfb0a518e73623732c6567916d066df817e0cb0c)
1# REQUIRES: asserts
2# RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj -o %t %s
3# RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
4# RUN:              -phony-externals %t 2>&1 | FileCheck %s
5#
6# Check that splitting of eh-frame sections works.
7#
8# CHECK: DWARFRecordSectionSplitter: Processing .eh_frame...
9# CHECK:  Processing block at
10# CHECK:    Processing CFI record at
11# CHECK:    Processing CFI record at
12# CHECK: EHFrameEdgeFixer: Processing .eh_frame in "{{.*}}"...
13# CHECK:   Processing block at
14# CHECK:     Record is CIE
15# CHECK:   Processing block at
16# CHECK:     Record is FDE
17# CHECK:       Adding edge at {{.*}} to CIE at: {{.*}}
18# CHECK:       Existing edge at {{.*}} to PC begin at {{.*}}
19# CHECK:       Adding keep-alive edge from target at {{.*}} to FDE at {{.*}}
20# CHECK:   Processing block at
21# CHECK:     Record is FDE
22# CHECK:       Adding edge at {{.*}} to CIE at: {{.*}}
23# CHECK:       Existing edge at {{.*}} to PC begin at {{.*}}
24# CHECK:       Adding keep-alive edge from target at {{.*}} to FDE at {{.*}}
25
26	.text
27	.globl	main
28	.p2align	2
29	.type	main,@function
30main:
31	.cfi_startproc
32	sub	sp, sp, #32
33	.cfi_def_cfa_offset 32
34	stp	x29, x30, [sp, #16]
35	add	x29, sp, #16
36	.cfi_def_cfa w29, 16
37	.cfi_offset w30, -8
38	.cfi_offset w29, -16
39	stur	wzr, [x29, #-4]
40	mov	x0, #4
41	bl	__cxa_allocate_exception
42	mov	w8, #1
43	str	w8, [x0]
44	adrp	x1, :got:_ZTIi
45	ldr	x1, [x1, :got_lo12:_ZTIi]
46	mov	x2, xzr
47	bl	__cxa_throw
48.main_end:
49	.size	main, .main_end-main
50	.cfi_endproc
51
52	.globl	dup
53	.p2align	2
54	.type	dup,@function
55dup:
56	.cfi_startproc
57	sub	sp, sp, #32
58	.cfi_def_cfa_offset 32
59	stp	x29, x30, [sp, #16]
60	add	x29, sp, #16
61	.cfi_def_cfa w29, 16
62	.cfi_offset w30, -8
63	.cfi_offset w29, -16
64	stur	wzr, [x29, #-4]
65	mov	x0, #4
66	bl	__cxa_allocate_exception
67	mov	w8, #1
68	str	w8, [x0]
69	adrp	x1, :got:_ZTIi
70	ldr	x1, [x1, :got_lo12:_ZTIi]
71	mov	x2, xzr
72	bl	__cxa_throw
73.dup_end:
74	.size	dup, .dup_end-dup
75	.cfi_endproc
76