1 ; RUN: llc -O0 -mtriple=aarch64-apple-ios -global-isel -stop-after=irtranslator %s -o - | FileCheck %s
3 @_ZTIi = external global i8*
6 declare i32 @__gxx_personality_v0(...)
7 declare i32 @llvm.eh.typeid.for(i8*)
11 ; CHECK-NEXT: bb.1 (%ir-block.0):
12 ; CHECK: successors: %[[GOOD:bb.[0-9]+.continue]]{{.*}}%[[BAD:bb.[0-9]+.broken]]
15 ; CHECK: BL @foo, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %w0, implicit-def %w0
16 ; CHECK: {{%[0-9]+}}(s32) = COPY %w0
19 ; CHECK: [[BAD]] (landing-pad):
21 ; CHECK: [[PTR:%[0-9]+]](p0) = COPY %x0
22 ; CHECK: [[SEL:%[0-9]+]](p0) = COPY %x1
23 ; CHECK: [[PTR_SEL:%[0-9]+]](s128) = G_SEQUENCE [[PTR]](p0), 0, [[SEL]](p0), 64
24 ; CHECK: [[PTR_RET:%[0-9]+]](s64), [[SEL_RET:%[0-9]+]](s32) = G_EXTRACT [[PTR_SEL]](s128), 0, 64
25 ; CHECK: %x0 = COPY [[PTR_RET]]
26 ; CHECK: %w1 = COPY [[SEL_RET]]
29 ; CHECK: [[SEL:%[0-9]+]](s32) = G_CONSTANT i32 1
30 ; CHECK: {{%[0-9]+}}(s128) = G_INSERT {{%[0-9]+}}(s128), [[SEL]](s32), 64
32 define { i8*, i32 } @bar() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
33 %res32 = invoke i32 @foo(i32 42) to label %continue unwind label %broken
37 %ptr.sel = landingpad { i8*, i32 } catch i8* bitcast(i8** @_ZTIi to i8*)
38 ret { i8*, i32 } %ptr.sel
41 %sel.int = tail call i32 @llvm.eh.typeid.for(i8* bitcast(i8** @_ZTIi to i8*))
42 %res.good = insertvalue { i8*, i32 } undef, i32 %sel.int, 1
43 ret { i8*, i32 } %res.good