1; RUN: opt -S -globaldce -sjljehprepare < %s | FileCheck %s
2target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
3target triple = "thumbv7--ios5.0.0"
4
5define void @g() personality i32 (...)* @__gxx_personality_sj0 {
6entry:
7  %exn.slot = alloca i8*
8  %ehselector.slot = alloca i32
9  invoke void @f()
10          to label %try.cont unwind label %lpad
11
12lpad:                                             ; preds = %entry
13  %0 = landingpad { i8*, i32 }
14          cleanup
15  br label %try.cont
16
17try.cont:                                         ; preds = %catch, %invoke.cont
18  ret void
19}
20
21declare void @f()
22
23declare i32 @__gxx_personality_sj0(...)
24
25; CHECK-LABEL: define void @g(
26; CHECK: call void @llvm.eh.sjlj.callsite(
27; CHECK: call void @_Unwind_SjLj_Register(
28; CHECK: invoke void @f(
29; CHECK: landingpad
30; CHECK-NEXT: cleanup
31; CHECK: call void @_Unwind_SjLj_Unregister(
32