[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / split-all-lptrampoline.s
blob4629a2cf9b957f17a553082c688e807078ed39c2
1 # This test checks that trampolines are inserted in split fragments if
2 # necessary. There are 4 LSDA ranges with a landing pad to three landing pads.
3 # After splitting all blocks, there have to be 4 trampolines in the output.
5 # RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
6 # RUN: %clangxx %cxxflags %t.o -o %t.exe -Wl,-q -pie
7 # RUN: llvm-bolt %t.exe --split-functions --split-strategy=all --split-eh \
8 # RUN: -o %t.bolt --print-split --print-only=main 2>&1 | FileCheck %s
10 # CHECK: ------- HOT-COLD SPLIT POINT -------
11 # CHECK: .LFT0
12 # CHECK: Landing Pads: .LBB0
13 # CHECK: .LBB0
14 # CHECK-NEXT: Landing Pad
15 # CHECK: ------- HOT-COLD SPLIT POINT -------
16 # CHECK: .Ltmp0
17 # CHECK: Landing Pads: .LBB1, .LBB2
18 # CHECK: .LBB1
19 # CHECK-NEXT: Landing Pad
20 # CHECK: .LBB2
21 # CHECK-NEXT: Landing Pad
22 # CHECK: ------- HOT-COLD SPLIT POINT -------
23 # CHECK: ------- HOT-COLD SPLIT POINT -------
24 # CHECK: ------- HOT-COLD SPLIT POINT -------
25 # CHECK: ------- HOT-COLD SPLIT POINT -------
26 # CHECK: ------- HOT-COLD SPLIT POINT -------
27 # CHECK: .Ltmp3
28 # CHECK: Landing Pads: .LBB3
29 # CHECK: .LBB3
30 # CHECK-NEXT: Landing Pad
31 # CHECK: ------- HOT-COLD SPLIT POINT -------
32 # CHECK: ------- HOT-COLD SPLIT POINT -------
34 .text
35 .section .rodata.str1.1,"aMS",@progbits,1
36 .LC0:
37 .string "E"
38 .LC1:
39 .string "C"
40 .text
41 .globl main
42 .type main, @function
43 main:
44 .LFB1265:
45 .cfi_startproc
46 .cfi_personality 0x9b,DW.ref.__gxx_personality_v0
47 .cfi_lsda 0x1b,.LLSDA1265
48 pushq %r12
49 .cfi_def_cfa_offset 16
50 .cfi_offset 12, -16
51 pushq %rbp
52 .cfi_def_cfa_offset 24
53 .cfi_offset 6, -24
54 pushq %rbx
55 .cfi_def_cfa_offset 32
56 .cfi_offset 3, -32
57 testb $3, %dil
58 jne .L13
59 leaq .LC1(%rip), %rdi
60 .LEHB0:
61 call puts@PLT
62 # Trampoline to .L9
63 .LEHE0:
64 jmp .L11
65 .L13:
66 movl $16, %edi
67 call __cxa_allocate_exception@PLT
68 movq %rax, %rbx
69 leaq .LC0(%rip), %rsi
70 movq %rax, %rdi
71 .LEHB1:
72 call _ZNSt13runtime_errorC1EPKc@PLT
73 # Trampoline to .L8
74 .LEHE1:
75 movq _ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
76 movq _ZTISt13runtime_error@GOTPCREL(%rip), %rsi
77 movq %rbx, %rdi
78 .LEHB2:
79 call __cxa_throw@PLT
80 # Trampoline to .L9
81 .LEHE2:
82 .L9:
83 movq %rax, %rdi
84 movq %rdx, %rax
85 jmp .L4
86 .L8:
87 movq %rax, %r12
88 movq %rdx, %rbp
89 movq %rbx, %rdi
90 call __cxa_free_exception@PLT
91 movq %r12, %rdi
92 movq %rbp, %rax
93 .L4:
94 cmpq $1, %rax
95 je .L5
96 .LEHB3:
97 call _Unwind_Resume@PLT
98 .LEHE3:
99 .L5:
100 call __cxa_begin_catch@PLT
101 movq %rax, %rdi
102 movq (%rax), %rax
103 call *16(%rax)
104 movq %rax, %rdi
105 .LEHB4:
106 call puts@PLT
107 # Trampoline to .L10
108 .LEHE4:
109 call __cxa_end_catch@PLT
110 .L11:
111 movl $0, %eax
112 popq %rbx
113 .cfi_remember_state
114 .cfi_def_cfa_offset 24
115 popq %rbp
116 .cfi_def_cfa_offset 16
117 popq %r12
118 .cfi_def_cfa_offset 8
120 .L10:
121 .cfi_restore_state
122 movq %rax, %rbx
123 call __cxa_end_catch@PLT
124 movq %rbx, %rdi
125 .LEHB5:
126 call _Unwind_Resume@PLT
127 .LEHE5:
128 .cfi_endproc
129 .globl __gxx_personality_v0
130 .section .gcc_except_table,"a",@progbits
131 .align 4
132 .LLSDA1265:
133 .byte 0xff
134 .byte 0x9b
135 .uleb128 .LLSDATT1265-.LLSDATTD1265
136 .LLSDATTD1265:
137 .byte 0x1
138 .uleb128 .LLSDACSE1265-.LLSDACSB1265
139 .LLSDACSB1265:
140 .uleb128 .LEHB0-.LFB1265
141 .uleb128 .LEHE0-.LEHB0
142 .uleb128 .L9-.LFB1265
143 .uleb128 0x1
144 .uleb128 .LEHB1-.LFB1265
145 .uleb128 .LEHE1-.LEHB1
146 .uleb128 .L8-.LFB1265
147 .uleb128 0x3
148 .uleb128 .LEHB2-.LFB1265
149 .uleb128 .LEHE2-.LEHB2
150 .uleb128 .L9-.LFB1265
151 .uleb128 0x1
152 .uleb128 .LEHB3-.LFB1265
153 .uleb128 .LEHE3-.LEHB3
154 .uleb128 0
155 .uleb128 0
156 .uleb128 .LEHB4-.LFB1265
157 .uleb128 .LEHE4-.LEHB4
158 .uleb128 .L10-.LFB1265
159 .uleb128 0
160 .uleb128 .LEHB5-.LFB1265
161 .uleb128 .LEHE5-.LEHB5
162 .uleb128 0
163 .uleb128 0
164 .LLSDACSE1265:
165 .byte 0x1
166 .byte 0
167 .byte 0
168 .byte 0x7d
169 .align 4
170 .long DW.ref._ZTISt13runtime_error-.
171 .LLSDATT1265:
172 .text
173 .size main, .-main
174 .hidden DW.ref._ZTISt13runtime_error
175 .weak DW.ref._ZTISt13runtime_error
176 .section .data.rel.local.DW.ref._ZTISt13runtime_error,"awG",@progbits,DW.ref._ZTISt13runtime_error,comdat
177 .align 8
178 .type DW.ref._ZTISt13runtime_error, @object
179 .size DW.ref._ZTISt13runtime_error, 8
180 DW.ref._ZTISt13runtime_error:
181 .quad _ZTISt13runtime_error
182 .hidden DW.ref.__gxx_personality_v0
183 .weak DW.ref.__gxx_personality_v0
184 .section .data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
185 .align 8
186 .type DW.ref.__gxx_personality_v0, @object
187 .size DW.ref.__gxx_personality_v0, 8
188 DW.ref.__gxx_personality_v0:
189 .quad __gxx_personality_v0
190 .ident "GCC: (Compiler-Explorer-Build-gcc--binutils-2.38) 12.1.0"
191 .section .note.GNU-stack,"",@progbits