1*cee313d2SEric Christopher; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck  %s
2*cee313d2SEric Christopher; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck   %s
3*cee313d2SEric Christopher
4*cee313d2SEric Christopher%"class.base" = type { %"struct.base"* }
5*cee313d2SEric Christopher%"struct.base" = type opaque
6*cee313d2SEric Christopher
7*cee313d2SEric Christopher@g = external local_unnamed_addr global i32, align 4
8*cee313d2SEric Christopher
9*cee313d2SEric Christopher; CHECK-LABEL: define{{.*}}@caller(
10*cee313d2SEric Christopher; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %tmp.i)
11*cee313d2SEric Christopher; CHECK-NEXT: call void @callee_unknown_use1.{{.*}}(i8* %tmp.i
12*cee313d2SEric Christopher
13*cee313d2SEric Christopherdefine i32 @callee_unknown_use1(i32 %arg) local_unnamed_addr #0 {
14*cee313d2SEric Christopher; CHECK-LABEL:define{{.*}}@callee_unknown_use1.{{[0-9]}}
15*cee313d2SEric Christopher; CHECK-NOT: alloca
16*cee313d2SEric Christopherbb:
17*cee313d2SEric Christopher  %tmp = alloca  i8, align 4
18*cee313d2SEric Christopher  %tmp2 = load i32, i32* @g, align 4, !tbaa !2
19*cee313d2SEric Christopher  %tmp3 = add nsw i32 %tmp2, 1
20*cee313d2SEric Christopher  %tmp4 = icmp slt i32 %arg, 0
21*cee313d2SEric Christopher  br i1 %tmp4, label %bb6, label %bb5
22*cee313d2SEric Christopher
23*cee313d2SEric Christopherbb5:                                              ; preds = %bb
24*cee313d2SEric Christopher  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp) #2
25*cee313d2SEric Christopher  store i32 %tmp3, i32* @g, align 4, !tbaa !2
26*cee313d2SEric Christopher  %tmp11 = bitcast i8* %tmp to i32*
27*cee313d2SEric Christopher  call void @bar(i32* nonnull %tmp11) #2
28*cee313d2SEric Christopher  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp) #2
29*cee313d2SEric Christopher  br label %bb6
30*cee313d2SEric Christopher
31*cee313d2SEric Christopherbb6:                                              ; preds = %bb5, %bb
32*cee313d2SEric Christopher  %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
33*cee313d2SEric Christopher  %tmp1 = bitcast i8* %tmp to i32*
34*cee313d2SEric Christopher  ret i32 %tmp7
35*cee313d2SEric Christopher}
36*cee313d2SEric Christopher
37*cee313d2SEric Christopher
38*cee313d2SEric Christopher; Function Attrs: argmemonly nounwind
39*cee313d2SEric Christopherdeclare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
40*cee313d2SEric Christopher
41*cee313d2SEric Christopherdeclare void @bar(i32*) local_unnamed_addr #2
42*cee313d2SEric Christopherdeclare void @bar2(i32*, i32*) local_unnamed_addr #1
43*cee313d2SEric Christopher
44*cee313d2SEric Christopher
45*cee313d2SEric Christopher; Function Attrs: argmemonly nounwind
46*cee313d2SEric Christopherdeclare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
47*cee313d2SEric Christopher
48*cee313d2SEric Christopher; Function Attrs: nounwind uwtable
49*cee313d2SEric Christopherdefine i32 @caller(i32 %arg) local_unnamed_addr #0 {
50*cee313d2SEric Christopherbb:
51*cee313d2SEric Christopher  %tmp = tail call i32 @callee_unknown_use1(i32 %arg)
52*cee313d2SEric Christopher  ret i32 %tmp
53*cee313d2SEric Christopher}
54*cee313d2SEric Christopher
55*cee313d2SEric Christopherattributes #0 = { nounwind uwtable}
56*cee313d2SEric Christopherattributes #1 = { argmemonly nounwind }
57*cee313d2SEric Christopherattributes #2 = { nounwind }
58*cee313d2SEric Christopher
59*cee313d2SEric Christopher!llvm.module.flags = !{!0}
60*cee313d2SEric Christopher!llvm.ident = !{!1}
61*cee313d2SEric Christopher
62*cee313d2SEric Christopher!0 = !{i32 1, !"wchar_size", i32 4}
63*cee313d2SEric Christopher!1 = !{!"clang version 5.0.0 (trunk 303574)"}
64*cee313d2SEric Christopher!2 = !{!3, !3, i64 0}
65*cee313d2SEric Christopher!3 = !{!"int", !4, i64 0}
66*cee313d2SEric Christopher!4 = !{!"omnipotent char", !5, i64 0}
67*cee313d2SEric Christopher!5 = !{!"Simple C/C++ TBAA"}
68*cee313d2SEric Christopher
69*cee313d2SEric Christopher
70*cee313d2SEric Christopher
71