1 ; RUN: llc -mtriple arm64e-apple-darwin -o - %s \
2 ; RUN: | FileCheck %s --check-prefixes=CHECK,DARWIN,DARWIN-SDAG
4 ; RUN: llc -mtriple aarch64 -mattr=+pauth -o - %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,ELF,ELF-SDAG
7 ; RUN: llc -mtriple arm64e-apple-darwin -o - %s \
8 ; RUN: -global-isel -global-isel-abort=1 -verify-machineinstrs \
9 ; RUN: | FileCheck %s --check-prefixes=CHECK,DARWIN,DARWIN-GISEL
11 ; RUN: llc -mtriple aarch64 -mattr=+pauth -o - %s \
12 ; RUN: -global-isel -global-isel-abort=1 -verify-machineinstrs \
13 ; RUN: | FileCheck %s --check-prefixes=CHECK,ELF,ELF-GISEL
15 ; DARWIN-LABEL: _test_invoke_ia_0:
16 ; DARWIN-NEXT: [[FNBEGIN:L.*]]:
17 ; DARWIN-NEXT: .cfi_startproc
18 ; DARWIN-NEXT: .cfi_personality 155, ___gxx_personality_v0
19 ; DARWIN-NEXT: .cfi_lsda 16, [[EXCEPT:Lexception[0-9]+]]
20 ; DARWIN-NEXT: ; %bb.0:
21 ; DARWIN-NEXT: stp x20, x19, [sp, #-32]!
22 ; DARWIN-NEXT: stp x29, x30, [sp, #16]
23 ; DARWIN-NEXT: .cfi_def_cfa_offset 32
24 ; DARWIN-NEXT: .cfi_offset w30, -8
25 ; DARWIN-NEXT: .cfi_offset w29, -16
26 ; DARWIN-NEXT: .cfi_offset w19, -24
27 ; DARWIN-NEXT: .cfi_offset w20, -32
28 ; DARWIN-NEXT: [[PRECALL:L.*]]:
29 ; DARWIN-NEXT: blraaz x0
31 ; DARWIN-SDAG-NEXT: [[POSTCALL:L.*]]:
32 ; DARWIN-SDAG-NEXT: ; %bb.1:
33 ; DARWIN-SDAG-NEXT: mov x19, x0
35 ; DARWIN-GISEL-NEXT: mov x19, x0
36 ; DARWIN-GISEL-NEXT: [[POSTCALL:L.*]]:
38 ; DARWIN-NEXT: [[CALLBB:L.*]]:
39 ; DARWIN-NEXT: bl _foo
40 ; DARWIN-NEXT: mov x0, x19
41 ; DARWIN-NEXT: ldp x29, x30, [sp, #16]
42 ; DARWIN-NEXT: ldp x20, x19, [sp], #32
44 ; DARWIN-NEXT: [[LPADBB:LBB[0-9_]+]]:
45 ; DARWIN-NEXT: [[LPAD:L.*]]:
46 ; DARWIN-NEXT: mov w19, #-1
47 ; DARWIN-NEXT: b [[CALLBB]]
49 ; ELF-LABEL: test_invoke_ia_0:
50 ; ELF-NEXT: [[FNBEGIN:.L.*]]:
51 ; ELF-NEXT: .cfi_startproc
52 ; ELF-NEXT: .cfi_personality 156, DW.ref.__gxx_personality_v0
53 ; ELF-NEXT: .cfi_lsda 28, [[EXCEPT:.Lexception[0-9]+]]
55 ; ELF-NEXT: stp x30, x19, [sp, #-16]!
56 ; ELF-NEXT: .cfi_def_cfa_offset 16
57 ; ELF-NEXT: .cfi_offset w19, -8
58 ; ELF-NEXT: .cfi_offset w30, -16
59 ; ELF-NEXT: [[PRECALL:.L.*]]:
62 ; ELF-SDAG-NEXT: [[POSTCALL:.L.*]]:
63 ; ELF-SDAG-NEXT: // %bb.1:
64 ; ELF-SDAG-NEXT: mov w19, w0
66 ; ELF-GISEL-NEXT: mov w19, w0
67 ; ELF-GISEL-NEXT: [[POSTCALL:.L.*]]:
69 ; ELF-NEXT: [[CALLBB:.L.*]]:
71 ; ELF-NEXT: mov w0, w19
72 ; ELF-NEXT: ldp x30, x19, [sp], #16
74 ; ELF-NEXT: [[LPADBB:.LBB[0-9_]+]]:
75 ; ELF-NEXT: [[LPAD:.L.*]]:
76 ; ELF-NEXT: mov w19, #-1
77 ; ELF-NEXT: b [[CALLBB]]
79 ; CHECK-LABEL: GCC_except_table{{.*}}:
80 ; CHECK-NEXT: [[EXCEPT]]:
81 ; CHECK: .uleb128 [[POSTCALL]]-[[PRECALL]] {{.*}} Call between [[PRECALL]] and [[POSTCALL]]
82 ; CHECK-NEXT: .uleb128 [[LPAD]]-[[FNBEGIN]] {{.*}} jumps to [[LPAD]]
83 ; CHECK-NEXT: .byte 0 {{.*}} On action: cleanup
85 define i32 @test_invoke_ia_0(ptr %arg0) #0 personality ptr @__gxx_personality_v0 {
86 %tmp0 = invoke i32 %arg0() [ "ptrauth"(i32 0, i64 0) ] to label %continuebb
87 unwind label %unwindbb
90 %tmp1 = landingpad { ptr, i32 } cleanup
99 @_ZTIPKc = external constant ptr
100 @hello_str = private unnamed_addr constant [6 x i8] c"hello\00", align 1
102 ; DARWIN-LABEL: _test_invoke_ib_42_catch:
103 ; DARWIN-NEXT: [[FNBEGIN:L.*]]:
104 ; DARWIN-NEXT: .cfi_startproc
105 ; DARWIN-NEXT: .cfi_personality 155, ___gxx_personality_v0
106 ; DARWIN-NEXT: .cfi_lsda 16, [[EXCEPT:Lexception[0-9]+]]
107 ; DARWIN-NEXT: ; %bb.0:
108 ; DARWIN-NEXT: stp x20, x19, [sp, #-32]!
109 ; DARWIN-NEXT: stp x29, x30, [sp, #16]
110 ; DARWIN-NEXT: .cfi_def_cfa_offset 32
111 ; DARWIN-NEXT: .cfi_offset w30, -8
112 ; DARWIN-NEXT: .cfi_offset w29, -16
113 ; DARWIN-NEXT: .cfi_offset w19, -24
114 ; DARWIN-NEXT: .cfi_offset w20, -32
115 ; DARWIN-NEXT: mov x19, x0
116 ; DARWIN-NEXT: mov w0, #8
117 ; DARWIN-NEXT: bl ___cxa_allocate_exception
118 ; DARWIN-NEXT: Lloh{{.*}}:
119 ; DARWIN-NEXT: adrp x8, l_hello_str@PAGE
120 ; DARWIN-NEXT: Lloh{{.*}}:
121 ; DARWIN-NEXT: add x8, x8, l_hello_str@PAGEOFF
122 ; DARWIN-NEXT: str x8, [x0]
123 ; DARWIN-NEXT: [[PRECALL:L.*]]:
124 ; DARWIN-NEXT: Lloh{{.*}}:
125 ; DARWIN-NEXT: adrp x1, __ZTIPKc@GOTPAGE
126 ; DARWIN-NEXT: Lloh{{.*}}:
127 ; DARWIN-NEXT: ldr x1, [x1, __ZTIPKc@GOTPAGEOFF]
128 ; DARWIN-NEXT: mov x2, #0
129 ; DARWIN-NEXT: mov x17, #42
130 ; DARWIN-NEXT: blrab x19, x17
131 ; DARWIN-NEXT: [[POSTCALL:L.*]]:
132 ; DARWIN-NEXT: ; %bb.1:
133 ; DARWIN-NEXT: brk #0x1
134 ; DARWIN-NEXT: [[LPADBB:LBB[0-9_]+]]:
135 ; DARWIN-NEXT: [[LPAD:L.*]]:
136 ; DARWIN-NEXT: mov x19, x1
137 ; DARWIN-NEXT: bl ___cxa_begin_catch
138 ; DARWIN-NEXT: cmp w19, #2
139 ; DARWIN-NEXT: b.ne [[EXITBB:LBB[0-9_]+]]
140 ; DARWIN-NEXT: ; %bb.3:
141 ; DARWIN-NEXT: bl _bar
142 ; DARWIN-NEXT: [[EXITBB]]:
143 ; DARWIN-NEXT: bl _foo
144 ; DARWIN-NEXT: bl ___cxa_end_catch
145 ; DARWIN-NEXT: ldp x29, x30, [sp, #16]
146 ; DARWIN-NEXT: ldp x20, x19, [sp], #32
148 ; DARWIN-NEXT: .loh {{.*}}
149 ; DARWIN-NEXT: .loh {{.*}}
150 ; DARWIN-NEXT: [[FNEND:L.*]]:
152 ; ELF-LABEL: test_invoke_ib_42_catch:
153 ; ELF-NEXT: [[FNBEGIN:.L.*]]:
154 ; ELF-NEXT: .cfi_startproc
155 ; ELF-NEXT: .cfi_personality 156, DW.ref.__gxx_personality_v0
156 ; ELF-NEXT: .cfi_lsda 28, [[EXCEPT:.Lexception[0-9]+]]
157 ; ELF-NEXT: // %bb.0:
158 ; ELF-NEXT: stp x30, x19, [sp, #-16]!
159 ; ELF-NEXT: .cfi_def_cfa_offset 16
160 ; ELF-NEXT: .cfi_offset w19, -8
161 ; ELF-NEXT: .cfi_offset w30, -16
162 ; ELF-NEXT: mov x19, x0
163 ; ELF-NEXT: mov w0, #8
164 ; ELF-NEXT: bl __cxa_allocate_exception
165 ; ELF-NEXT: adrp x8, .Lhello_str
166 ; ELF-NEXT: add x8, x8, :lo12:.Lhello_str
167 ; ELF-NEXT: str x8, [x0]
168 ; ELF-NEXT: [[PRECALL:.L.*]]:
169 ; ELF-NEXT: adrp x1, :got:_ZTIPKc
170 ; ELF-NEXT: mov x2, xzr
171 ; ELF-NEXT: ldr x1, [x1, :got_lo12:_ZTIPKc]
172 ; ELF-NEXT: mov x17, #42
173 ; ELF-NEXT: blrab x19, x17
174 ; ELF-NEXT: [[POSTCALL:.L.*]]:
175 ; ELF-NEXT: // %bb.1:
176 ; ELF-NEXT: [[LPADBB:.LBB[0-9_]+]]:
177 ; ELF-NEXT: [[LPAD:.L.*]]:
178 ; ELF-NEXT: mov x19, x1
179 ; ELF-NEXT: bl __cxa_begin_catch
180 ; ELF-NEXT: cmp w19, #2
181 ; ELF-NEXT: b.ne [[EXITBB:.LBB[0-9_]+]]
182 ; ELF-NEXT: // %bb.3:
184 ; ELF-NEXT: [[EXITBB]]:
186 ; ELF-NEXT: bl __cxa_end_catch
187 ; ELF-NEXT: ldp x30, x19, [sp], #16
189 ; ELF-NEXT: [[FNEND:.L.*]]:
191 ; CHECK-LABEL: GCC_except_table{{.*}}:
192 ; CHECK-NEXT: [[EXCEPT]]:
193 ; CHECK-NEXT: .byte 255 {{.*}} @LPStart Encoding = omit
194 ; DARWIN-NEXT: .byte 155 {{.*}} @TType Encoding = indirect pcrel sdata4
195 ; ELF-NEXT: .byte 156 {{.*}} @TType Encoding = indirect pcrel sdata8
196 ; CHECK-NEXT: .uleb128 [[TT:.?L.*]]-[[TTREF:.?L.*]]
197 ; CHECK-NEXT: [[TTREF]]:
198 ; CHECK-NEXT: .byte 1 {{.*}} Call site Encoding = uleb128
199 ; CHECK-NEXT: .uleb128 [[CSEND:.?L.*]]-[[CSBEGIN:.?L.*]]
200 ; CHECK-NEXT: [[CSBEGIN]]:
201 ; CHECK-NEXT: .uleb128 [[FNBEGIN]]-[[FNBEGIN]] {{.*}} >> Call Site 1 <<
202 ; CHECK-NEXT: .uleb128 [[PRECALL]]-[[FNBEGIN]] {{.*}} Call between [[FNBEGIN]] and [[PRECALL]]
203 ; CHECK-NEXT: .byte 0 {{.*}} has no landing pad
204 ; CHECK-NEXT: .byte 0 {{.*}} On action: cleanup
205 ; CHECK-NEXT: .uleb128 [[PRECALL]]-[[FNBEGIN]] {{.*}} >> Call Site 2 <<
206 ; CHECK-NEXT: .uleb128 [[POSTCALL]]-[[PRECALL]] {{.*}} Call between [[PRECALL]] and [[POSTCALL]]
207 ; CHECK-NEXT: .uleb128 [[LPAD]]-[[FNBEGIN]] {{.*}} jumps to [[LPAD]]
208 ; CHECK-NEXT: .byte 3 {{.*}} On action: 2
209 ; CHECK-NEXT: .uleb128 [[POSTCALL]]-[[FNBEGIN]] {{.*}} >> Call Site 3 <<
210 ; CHECK-NEXT: .uleb128 [[FNEND]]-[[POSTCALL]] {{.*}} Call between [[POSTCALL]] and [[FNEND]]
211 ; CHECK-NEXT: .byte 0 {{.*}} has no landing pad
212 ; CHECK-NEXT: .byte 0 {{.*}} On action: cleanup
213 ; CHECK-NEXT: [[CSEND]]:
215 ; CHECK-NEXT: .byte 1 {{.*}} >> Action Record 1 <<
216 ; CHECK-NEXT: {{.*}} Catch TypeInfo 1
217 ; CHECK-NEXT: .byte 0 {{.*}} No further actions
218 ; CHECK-NEXT: .byte 2 {{.*}} >> Action Record 2 <<
219 ; CHECK-NEXT: {{.*}} Catch TypeInfo 2
220 ; CHECK-NEXT: .byte 125 {{.*}} Continue to action 1
221 ; CHECK-NEXT: .p2align 2
222 ; CHECK-NEXT: {{.*}} >> Catch TypeInfos <<
224 ; DARWIN-NEXT: [[TI:L.*]]: {{.*}} TypeInfo 2
225 ; DARWIN-NEXT: .long __ZTIPKc@GOT-[[TI]]
226 ; DARWIN-NEXT: .long 0 {{.*}} TypeInfo 1
227 ; ELF-NEXT: [[TI:.?L.*]]: {{.*}} TypeInfo 2
228 ; ELF-NEXT: .xword .L_ZTIPKc.DW.stub-[[TI]]
229 ; ELF-NEXT: .xword 0 {{.*}} TypeInfo 1
231 ; CHECK-NEXT: [[TT]]:
233 define void @test_invoke_ib_42_catch(ptr %fptr) #0 personality ptr @__gxx_personality_v0 {
234 %tmp0 = call ptr @__cxa_allocate_exception(i64 8)
235 store ptr getelementptr inbounds ([6 x i8], ptr @hello_str, i64 0, i64 0), ptr %tmp0, align 8
236 invoke void %fptr(ptr %tmp0, ptr @_ZTIPKc, ptr null) [ "ptrauth"(i32 1, i64 42) ]
237 to label %continuebb unwind label %catchbb
240 %tmp2 = landingpad { ptr, i32 }
243 %tmp3 = extractvalue { ptr, i32 } %tmp2, 0
244 %tmp4 = extractvalue { ptr, i32 } %tmp2, 1
245 %tmp5 = call i32 @llvm.eh.typeid.for(ptr @_ZTIPKc)
246 %tmp6 = icmp eq i32 %tmp4, %tmp5
247 %tmp7 = call ptr @__cxa_begin_catch(ptr %tmp3)
248 br i1 %tmp6, label %PKc_catchbb, label %any_catchbb
251 call void @bar(ptr %tmp7)
252 br label %any_catchbb
256 call void @__cxa_end_catch()
263 ; DARWIN-LABEL: _test_invoke_ia_0_direct:
264 ; DARWIN-NEXT: [[FNBEGIN:L.*]]:
265 ; DARWIN-NEXT: .cfi_startproc
266 ; DARWIN-NEXT: .cfi_personality 155, ___gxx_personality_v0
267 ; DARWIN-NEXT: .cfi_lsda 16, [[EXCEPT:Lexception[0-9]+]]
268 ; DARWIN-NEXT: ; %bb.0:
269 ; DARWIN-NEXT: stp x20, x19, [sp, #-32]!
270 ; DARWIN-NEXT: stp x29, x30, [sp, #16]
271 ; DARWIN-NEXT: .cfi_def_cfa_offset 32
272 ; DARWIN-NEXT: .cfi_offset w30, -8
273 ; DARWIN-NEXT: .cfi_offset w29, -16
274 ; DARWIN-NEXT: .cfi_offset w19, -24
275 ; DARWIN-NEXT: .cfi_offset w20, -32
276 ; DARWIN-NEXT: [[PRECALL:L.*]]:
277 ; DARWIN-NEXT: bl _baz
279 ; DARWIN-SDAG-NEXT: [[POSTCALL:L.*]]:
280 ; DARWIN-SDAG-NEXT: ; %bb.1:
281 ; DARWIN-SDAG-NEXT: mov x19, x0
283 ; DARWIN-GISEL-NEXT: mov x19, x0
284 ; DARWIN-GISEL-NEXT: [[POSTCALL:L.*]]:
286 ; DARWIN-NEXT: [[CALLBB:L.*]]:
287 ; DARWIN-NEXT: bl _foo
288 ; DARWIN-NEXT: mov x0, x19
289 ; DARWIN-NEXT: ldp x29, x30, [sp, #16]
290 ; DARWIN-NEXT: ldp x20, x19, [sp], #32
292 ; DARWIN-NEXT: [[LPADBB:LBB[0-9_]+]]:
293 ; DARWIN-NEXT: [[LPAD:L.*]]:
294 ; DARWIN-NEXT: mov w19, #-1
295 ; DARWIN-NEXT: b [[CALLBB]]
297 ; ELF-LABEL: test_invoke_ia_0_direct:
298 ; ELF-NEXT: [[FNBEGIN:.L.*]]:
299 ; ELF-NEXT: .cfi_startproc
300 ; ELF-NEXT: .cfi_personality 156, DW.ref.__gxx_personality_v0
301 ; ELF-NEXT: .cfi_lsda 28, [[EXCEPT:.Lexception[0-9]+]]
302 ; ELF-NEXT: // %bb.0:
303 ; ELF-NEXT: stp x30, x19, [sp, #-16]!
304 ; ELF-NEXT: .cfi_def_cfa_offset 16
305 ; ELF-NEXT: .cfi_offset w19, -8
306 ; ELF-NEXT: .cfi_offset w30, -16
307 ; ELF-NEXT: [[PRECALL:.L.*]]:
310 ; ELF-SDAG-NEXT: [[POSTCALL:.L.*]]:
311 ; ELF-SDAG-NEXT: // %bb.1:
312 ; ELF-SDAG-NEXT: mov w19, w0
314 ; ELF-GISEL-NEXT: mov w19, w0
315 ; ELF-GISEL-NEXT: [[POSTCALL:.L.*]]:
317 ; ELF-NEXT: [[CALLBB:.L.*]]:
319 ; ELF-NEXT: mov w0, w19
320 ; ELF-NEXT: ldp x30, x19, [sp], #16
322 ; ELF-NEXT: [[LPADBB:.LBB[0-9_]+]]:
323 ; ELF-NEXT: [[LPAD:.L.*]]:
324 ; ELF-NEXT: mov w19, #-1
325 ; ELF-NEXT: b [[CALLBB]]
327 ; CHECK-LABEL: GCC_except_table{{.*}}:
328 ; CHECK-NEXT: [[EXCEPT]]:
329 ; CHECK: .uleb128 [[POSTCALL]]-[[PRECALL]] {{.*}} Call between [[PRECALL]] and [[POSTCALL]]
330 ; CHECK-NEXT: .uleb128 [[LPAD]]-[[FNBEGIN]] {{.*}} jumps to [[LPAD]]
331 ; CHECK-NEXT: .byte 0 {{.*}} On action: cleanup
333 define i32 @test_invoke_ia_0_direct() #0 personality ptr @__gxx_personality_v0 {
334 %tmp0 = invoke i32 ptrauth (ptr @baz, i32 0)() [ "ptrauth"(i32 0, i64 0) ] to label %continuebb
335 unwind label %unwindbb
338 %tmp1 = landingpad { ptr, i32 } cleanup
347 ; DARWIN-LABEL: _test_invoke_ib_2_direct_mismatch:
348 ; DARWIN-NEXT: [[FNBEGIN:L.*]]:
349 ; DARWIN-NEXT: .cfi_startproc
350 ; DARWIN-NEXT: .cfi_personality 155, ___gxx_personality_v0
351 ; DARWIN-NEXT: .cfi_lsda 16, [[EXCEPT:Lexception[0-9]+]]
352 ; DARWIN-NEXT: ; %bb.0:
353 ; DARWIN-NEXT: stp x20, x19, [sp, #-32]!
354 ; DARWIN-NEXT: stp x29, x30, [sp, #16]
355 ; DARWIN-NEXT: .cfi_def_cfa_offset 32
356 ; DARWIN-NEXT: .cfi_offset w30, -8
357 ; DARWIN-NEXT: .cfi_offset w29, -16
358 ; DARWIN-NEXT: .cfi_offset w19, -24
359 ; DARWIN-NEXT: .cfi_offset w20, -32
361 ; DARWIN-SDAG-NEXT: [[PRECALL:L.*]]:
362 ; DARWIN-SDAG-NEXT: adrp x16, _baz@GOTPAGE
363 ; DARWIN-SDAG-NEXT: ldr x16, [x16, _baz@GOTPAGEOFF]
364 ; DARWIN-SDAG-NEXT: mov x17, #1234
365 ; DARWIN-SDAG-NEXT: pacia x16, x17
366 ; DARWIN-SDAG-NEXT: mov x8, x16
367 ; DARWIN-SDAG-NEXT: mov x17, #2
368 ; DARWIN-SDAG-NEXT: blrab x8, x17
369 ; DARWIN-SDAG-NEXT: [[POSTCALL:L.*]]:
370 ; DARWIN-SDAG-NEXT: ; %bb.1:
371 ; DARWIN-SDAG-NEXT: mov x19, x0
373 ; DARWIN-GISEL-NEXT: adrp x16, _baz@GOTPAGE
374 ; DARWIN-GISEL-NEXT: ldr x16, [x16, _baz@GOTPAGEOFF]
375 ; DARWIN-GISEL-NEXT: mov x17, #1234
376 ; DARWIN-GISEL-NEXT: pacia x16, x17
377 ; DARWIN-GISEL-NEXT: mov x8, x16
378 ; DARWIN-GISEL-NEXT: [[PRECALL:L.*]]:
379 ; DARWIN-GISEL-NEXT: mov x17, #2
380 ; DARWIN-GISEL-NEXT: blrab x8, x17
381 ; DARWIN-GISEL-NEXT: mov x19, x0
382 ; DARWIN-GISEL-NEXT: [[POSTCALL:L.*]]:
384 ; DARWIN-NEXT: [[CALLBB:L.*]]:
385 ; DARWIN-NEXT: bl _foo
386 ; DARWIN-NEXT: mov x0, x19
387 ; DARWIN-NEXT: ldp x29, x30, [sp, #16]
388 ; DARWIN-NEXT: ldp x20, x19, [sp], #32
390 ; DARWIN-NEXT: [[LPADBB:LBB[0-9_]+]]:
391 ; DARWIN-NEXT: [[LPAD:L.*]]:
392 ; DARWIN-NEXT: mov w19, #-1
393 ; DARWIN-NEXT: b [[CALLBB]]
395 ; ELF-LABEL: test_invoke_ib_2_direct_mismatch:
396 ; ELF-NEXT: [[FNBEGIN:.L.*]]:
397 ; ELF-NEXT: .cfi_startproc
398 ; ELF-NEXT: .cfi_personality 156, DW.ref.__gxx_personality_v0
399 ; ELF-NEXT: .cfi_lsda 28, [[EXCEPT:.Lexception[0-9]+]]
400 ; ELF-NEXT: // %bb.0:
401 ; ELF-NEXT: stp x30, x19, [sp, #-16]!
402 ; ELF-NEXT: .cfi_def_cfa_offset 16
403 ; ELF-NEXT: .cfi_offset w19, -8
404 ; ELF-NEXT: .cfi_offset w30, -16
406 ; ELF-SDAG-NEXT: [[PRECALL:.L.*]]:
407 ; ELF-SDAG-NEXT: adrp x16, :got:baz
408 ; ELF-SDAG-NEXT: ldr x16, [x16, :got_lo12:baz]
409 ; ELF-SDAG-NEXT: mov x17, #1234
410 ; ELF-SDAG-NEXT: pacia x16, x17
411 ; ELF-SDAG-NEXT: mov x8, x16
412 ; ELF-SDAG-NEXT: mov x17, #2
413 ; ELF-SDAG-NEXT: blrab x8, x17
414 ; ELF-SDAG-NEXT: [[POSTCALL:.L.*]]:
415 ; ELF-SDAG-NEXT: // %bb.1:
416 ; ELF-SDAG-NEXT: mov w19, w0
418 ; ELF-GISEL-NEXT: adrp x16, :got:baz
419 ; ELF-GISEL-NEXT: ldr x16, [x16, :got_lo12:baz]
420 ; ELF-GISEL-NEXT: mov x17, #1234
421 ; ELF-GISEL-NEXT: pacia x16, x17
422 ; ELF-GISEL-NEXT: mov x8, x16
423 ; ELF-GISEL-NEXT: [[PRECALL:.L.*]]:
424 ; ELF-GISEL-NEXT: mov x17, #2
425 ; ELF-GISEL-NEXT: blrab x8, x17
426 ; ELF-GISEL-NEXT: mov w19, w0
427 ; ELF-GISEL-NEXT: [[POSTCALL:.L.*]]:
429 ; ELF-NEXT: [[CALLBB:.L.*]]:
431 ; ELF-NEXT: mov w0, w19
432 ; ELF-NEXT: ldp x30, x19, [sp], #16
434 ; ELF-NEXT: [[LPADBB:.LBB[0-9_]+]]:
435 ; ELF-NEXT: [[LPAD:.L.*]]:
436 ; ELF-NEXT: mov w19, #-1
437 ; ELF-NEXT: b [[CALLBB]]
439 ; CHECK-LABEL: GCC_except_table{{.*}}:
440 ; CHECK-NEXT: [[EXCEPT]]:
441 ; CHECK: .uleb128 [[POSTCALL]]-[[PRECALL]] {{.*}} Call between [[PRECALL]] and [[POSTCALL]]
442 ; CHECK-NEXT: .uleb128 [[LPAD]]-[[FNBEGIN]] {{.*}} jumps to [[LPAD]]
443 ; CHECK-NEXT: .byte 0 {{.*}} On action: cleanup
445 define i32 @test_invoke_ib_2_direct_mismatch() #0 personality ptr @__gxx_personality_v0 {
446 %tmp0 = invoke i32 ptrauth (ptr @baz, i32 0, i64 1234)() [ "ptrauth"(i32 1, i64 2) ] to label %continuebb
447 unwind label %unwindbb
450 %tmp1 = landingpad { ptr, i32 } cleanup
459 ; ELF-LABEL: .L_ZTIPKc.DW.stub:
460 ; ELF-NEXT: .xword _ZTIPKc
463 declare void @bar(ptr)
466 declare i32 @__gxx_personality_v0(...)
467 declare ptr @__cxa_allocate_exception(i64)
468 declare void @__cxa_throw(ptr, ptr, ptr)
469 declare i32 @llvm.eh.typeid.for(ptr)
470 declare ptr @__cxa_begin_catch(ptr)
471 declare void @__cxa_end_catch()
473 attributes #0 = { nounwind }