1*cee313d2SEric Christopher; RUN: opt < %s -skip-partial-inlining-cost-analysis -partial-inliner -S  | FileCheck %s
2*cee313d2SEric Christopher; RUN: opt < %s -skip-partial-inlining-cost-analysis -passes=partial-inliner -S  | FileCheck %s
3*cee313d2SEric Christopher
4*cee313d2SEric Christopherdeclare void @bar()
5*cee313d2SEric Christopherdeclare i32 @__gxx_personality_v0(...)
6*cee313d2SEric Christopherdeclare i8* @__cxa_begin_catch(i8*)
7*cee313d2SEric Christopherdeclare void @__cxa_end_catch()
8*cee313d2SEric Christopher
9*cee313d2SEric Christopherdefine internal void @callee(i1 %cond) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
10*cee313d2SEric Christopherentry:
11*cee313d2SEric Christopher  br i1 %cond, label %if.then, label %if.end
12*cee313d2SEric Christopher
13*cee313d2SEric Christopherif.then:
14*cee313d2SEric Christopher  invoke void @bar()
15*cee313d2SEric Christopher          to label %invoke.cont unwind label %lpad
16*cee313d2SEric Christopher
17*cee313d2SEric Christopherinvoke.cont:
18*cee313d2SEric Christopher  br label %try.cont
19*cee313d2SEric Christopher
20*cee313d2SEric Christopherlpad:
21*cee313d2SEric Christopher  %0 = landingpad { i8*, i32 }
22*cee313d2SEric Christopher          catch i8* null
23*cee313d2SEric Christopher  %1 = extractvalue { i8*, i32 } %0, 0
24*cee313d2SEric Christopher  %2 = extractvalue { i8*, i32 } %0, 1
25*cee313d2SEric Christopher  br label %catch
26*cee313d2SEric Christopher
27*cee313d2SEric Christophercatch:
28*cee313d2SEric Christopher  %3 = call i8* @__cxa_begin_catch(i8* %1)
29*cee313d2SEric Christopher  call void @__cxa_end_catch()
30*cee313d2SEric Christopher  br label %try.cont
31*cee313d2SEric Christopher
32*cee313d2SEric Christophertry.cont:
33*cee313d2SEric Christopher  br label %if.end
34*cee313d2SEric Christopher
35*cee313d2SEric Christopherif.end:
36*cee313d2SEric Christopher  ret void
37*cee313d2SEric Christopher}
38*cee313d2SEric Christopher
39*cee313d2SEric Christopherdefine internal void @caller(i1 %cond) {
40*cee313d2SEric Christopher; CHECK-LABEL: define {{.*}} @caller
41*cee313d2SEric Christopherentry:
42*cee313d2SEric Christopher; CHECK: entry:
43*cee313d2SEric Christopher; CHECK-NEXT: br i1
44*cee313d2SEric Christopher; CHECK: codeRepl.i:
45*cee313d2SEric Christopher; CHECK-NEXT: call void @callee.1.{{.*}}()
46*cee313d2SEric Christopher  call void @callee(i1 %cond)
47*cee313d2SEric Christopher  ret void
48*cee313d2SEric Christopher}
49*cee313d2SEric Christopher
50*cee313d2SEric Christopher; CHECK-LABEL: define {{.*}} @callee.1.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
51*cee313d2SEric Christopher; CHECK: invoke void @bar()
52*cee313d2SEric Christopher; CHECK: landingpad
53