1 ; RUN: llc -O0 -mtriple=aarch64-apple-ios -verify-machineinstrs -global-isel -stop-after=legalizer %s -o - | FileCheck %s
3 @_ZTIi = external global i8*
6 declare i32 @__gxx_personality_v0(...)
7 declare i32 @llvm.eh.typeid.for(i8*)
8 declare void @_Unwind_Resume(i8*)
12 ; CHECK-NEXT: bb.1 (%ir-block.0):
13 ; CHECK: successors: %{{bb.[0-9]+.*}}%[[LP:bb.[0-9]+]]
15 ; CHECK: [[LP]].{{[a-z]+}} (landing-pad):
18 ; CHECK: [[PTR:%[0-9]+]]:_(p0) = COPY $x0
19 ; CHECK: [[SEL_PTR:%[0-9]+]]:_(p0) = COPY $x1
20 ; CHECK: [[SEL_PTR_INT:%[0-9]+]]:_(s32) = G_PTRTOINT [[SEL_PTR]](p0)
21 ; CHECK: G_STORE [[PTR]](p0), %0(p0) :: (store 8 into %ir.exn.slot)
22 ; CHECK: G_STORE [[SEL_PTR_INT]](s32), %1(p0) :: (store 4 into %ir.ehselector.slot)
24 define void @bar() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
25 %exn.slot = alloca i8*
26 %ehselector.slot = alloca i32
27 %1 = invoke i32 @foo(i32 42) to label %continue unwind label %cleanup
30 %2 = landingpad { i8*, i32 } cleanup
31 %3 = extractvalue { i8*, i32 } %2, 0
32 store i8* %3, i8** %exn.slot, align 8
33 %4 = extractvalue { i8*, i32 } %2, 1
34 store i32 %4, i32* %ehselector.slot, align 4
41 %exn = load i8*, i8** %exn.slot, align 8
42 call void @_Unwind_Resume(i8* %exn)