xref: /aosp_15_r20/external/llvm/test/MC/ARM/eh-compact-pr0.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \
2*9880d681SAndroid Build Coastguard Worker@ RUN:   | llvm-readobj -s -sd -sr > %t
3*9880d681SAndroid Build Coastguard Worker@ RUN: FileCheck %s < %t
4*9880d681SAndroid Build Coastguard Worker@ RUN: FileCheck --check-prefix=RELOC %s < %t
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker@ Check the compact pr0 model
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker	.syntax unified
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker	.section	.TEST1
11*9880d681SAndroid Build Coastguard Worker	.globl	func1
12*9880d681SAndroid Build Coastguard Worker	.align	2
13*9880d681SAndroid Build Coastguard Worker	.type	func1,%function
14*9880d681SAndroid Build Coastguard Workerfunc1:
15*9880d681SAndroid Build Coastguard Worker	.fnstart
16*9880d681SAndroid Build Coastguard Worker	.save	{r11, lr}
17*9880d681SAndroid Build Coastguard Worker	push	{r11, lr}
18*9880d681SAndroid Build Coastguard Worker	.setfp	r11, sp
19*9880d681SAndroid Build Coastguard Worker	mov	r11, sp
20*9880d681SAndroid Build Coastguard Worker	pop	{r11, lr}
21*9880d681SAndroid Build Coastguard Worker	mov	pc, lr
22*9880d681SAndroid Build Coastguard Worker	.fnend
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker	.section	.TEST2
25*9880d681SAndroid Build Coastguard Worker	.globl	func2
26*9880d681SAndroid Build Coastguard Worker	.align	2
27*9880d681SAndroid Build Coastguard Worker	.type	func2,%function
28*9880d681SAndroid Build Coastguard Workerfunc2:
29*9880d681SAndroid Build Coastguard Worker	.fnstart
30*9880d681SAndroid Build Coastguard Worker	.save	{r11, lr}
31*9880d681SAndroid Build Coastguard Worker	push	{r11, lr}
32*9880d681SAndroid Build Coastguard Worker	pop	{r11, pc}
33*9880d681SAndroid Build Coastguard Worker	.fnend
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
38*9880d681SAndroid Build Coastguard Worker@ Check .TEST1 section
39*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
40*9880d681SAndroid Build Coastguard Worker@ CHECK: Sections [
41*9880d681SAndroid Build Coastguard Worker@ CHECK:   Section {
42*9880d681SAndroid Build Coastguard Worker@ CHECK:     Name: .TEST1
43*9880d681SAndroid Build Coastguard Worker@ CHECK:     SectionData (
44*9880d681SAndroid Build Coastguard Worker@ CHECK:       0000: 00482DE9 0DB0A0E1 0048BDE8 0EF0A0E1  |.H-......H......|
45*9880d681SAndroid Build Coastguard Worker@ CHECK:     )
46*9880d681SAndroid Build Coastguard Worker@ CHECK:   }
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
50*9880d681SAndroid Build Coastguard Worker@ Check .ARM.exidx.TEST1 section
51*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
52*9880d681SAndroid Build Coastguard Worker@ CHECK:   Section {
53*9880d681SAndroid Build Coastguard Worker@ CHECK:     Name: .ARM.exidx.TEST1
54*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
55*9880d681SAndroid Build Coastguard Worker@ 0x80   = Compact model 0, personality routine: __aeabi_unwind_cpp_pr0
56*9880d681SAndroid Build Coastguard Worker@ 0x9B   = $sp can be found in $r11
57*9880d681SAndroid Build Coastguard Worker@ 0x8480 = pop {r11, r14}
58*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
59*9880d681SAndroid Build Coastguard Worker@ CHECK:     SectionData (
60*9880d681SAndroid Build Coastguard Worker@ CHECK:       0000: 00000000 80849B80                    |........|
61*9880d681SAndroid Build Coastguard Worker@ CHECK:     )
62*9880d681SAndroid Build Coastguard Worker@ CHECK:   }
63*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
64*9880d681SAndroid Build Coastguard Worker@ The first word should be relocated to .TEST1 section.  Besides, there is
65*9880d681SAndroid Build Coastguard Worker@ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker
66*9880d681SAndroid Build Coastguard Worker@ will keep __aeabi_unwind_cpp_pr0.
67*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
68*9880d681SAndroid Build Coastguard Worker@ RELOC:   Section {
69*9880d681SAndroid Build Coastguard Worker@ RELOC:     Name: .rel.ARM.exidx.TEST1
70*9880d681SAndroid Build Coastguard Worker@ RELOC:     Relocations [
71*9880d681SAndroid Build Coastguard Worker@ RELOC:       0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0
72*9880d681SAndroid Build Coastguard Worker@ RELOC:       0x0 R_ARM_PREL31 .TEST1 0x0
73*9880d681SAndroid Build Coastguard Worker@ RELOC:     ]
74*9880d681SAndroid Build Coastguard Worker@ RELOC:   }
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
78*9880d681SAndroid Build Coastguard Worker@ Check .TEST2 section
79*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
80*9880d681SAndroid Build Coastguard Worker@ CHECK:   Section {
81*9880d681SAndroid Build Coastguard Worker@ CHECK:     Name: .TEST2
82*9880d681SAndroid Build Coastguard Worker@ CHECK:     SectionData (
83*9880d681SAndroid Build Coastguard Worker@ CHECK:       0000: 00482DE9 0088BDE8                    |.H-.....|
84*9880d681SAndroid Build Coastguard Worker@ CHECK:     )
85*9880d681SAndroid Build Coastguard Worker@ CHECK:   }
86*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
87*9880d681SAndroid Build Coastguard Worker@ Check .ARM.exidx.TEST1 section
88*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
89*9880d681SAndroid Build Coastguard Worker@ CHECK:   Section {
90*9880d681SAndroid Build Coastguard Worker@ CHECK:     Name: .ARM.exidx.TEST2
91*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
92*9880d681SAndroid Build Coastguard Worker@ 0x80   = Compact model 0, personality routine: __aeabi_unwind_cpp_pr0
93*9880d681SAndroid Build Coastguard Worker@ 0x8480 = pop {r11, r14}
94*9880d681SAndroid Build Coastguard Worker@ 0xB0   = finish
95*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
96*9880d681SAndroid Build Coastguard Worker@ CHECK:     SectionData (
97*9880d681SAndroid Build Coastguard Worker@ CHECK:       0000: 00000000 B0808480                    |........|
98*9880d681SAndroid Build Coastguard Worker@ CHECK:     )
99*9880d681SAndroid Build Coastguard Worker@ CHECK:   }
100*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
101*9880d681SAndroid Build Coastguard Worker@ The first word should be relocated to .TEST2 section.  Besides, there is
102*9880d681SAndroid Build Coastguard Worker@ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker
103*9880d681SAndroid Build Coastguard Worker@ will keep __aeabi_unwind_cpp_pr0.
104*9880d681SAndroid Build Coastguard Worker@-------------------------------------------------------------------------------
105*9880d681SAndroid Build Coastguard Worker@ RELOC:   Section {
106*9880d681SAndroid Build Coastguard Worker@ RELOC:     Name: .rel.ARM.exidx.TEST2
107*9880d681SAndroid Build Coastguard Worker@ RELOC:     Relocations [
108*9880d681SAndroid Build Coastguard Worker@ RELOC:       0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0
109*9880d681SAndroid Build Coastguard Worker@ RELOC:       0x0 R_ARM_PREL31 .TEST2 0x0
110*9880d681SAndroid Build Coastguard Worker@ RELOC:     ]
111*9880d681SAndroid Build Coastguard Worker@ RELOC:   }
112