1cee313d2SEric Christopher; RUN: opt -S  -partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s  | FileCheck %s
2cee313d2SEric Christopher; RUN: opt -S -passes=partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s  | FileCheck %s
3cee313d2SEric Christopherdefine i32 @test(i32 %arg) local_unnamed_addr #0 {
4cee313d2SEric Christopherbb:
5cee313d2SEric Christopher  %tmp = tail call i32 (...) @bar() #1
6cee313d2SEric Christopher  %tmp1 = icmp slt i32 %arg, 0
7cee313d2SEric Christopher  br i1 %tmp1, label %bb6, label %bb2
8cee313d2SEric Christopher
9cee313d2SEric Christopherbb2:                                              ; preds = %bb
10cee313d2SEric Christopher  tail call void (...) @foo() #1
11cee313d2SEric Christopher  tail call void (...) @foo() #1
12cee313d2SEric Christopher  tail call void (...) @foo() #1
13cee313d2SEric Christopher  tail call void (...) @foo() #1
14cee313d2SEric Christopher  tail call void (...) @foo() #1
15cee313d2SEric Christopher  %tmp3 = tail call i32 (...) @bar() #1
16cee313d2SEric Christopher  %tmp4 = icmp eq i32 %tmp3, 10
17cee313d2SEric Christopher  br i1 %tmp4, label %bb6, label %bb5
18cee313d2SEric Christopher
19cee313d2SEric Christopherbb5:                                              ; preds = %bb2
20cee313d2SEric Christopher  tail call void (...) @foo() #1
21cee313d2SEric Christopher  tail call void (...) @foo() #1
22cee313d2SEric Christopher  tail call void (...) @foo() #1
23cee313d2SEric Christopher  tail call void (...) @foo() #1
24cee313d2SEric Christopher  br label %bb6
25cee313d2SEric Christopher
26cee313d2SEric Christopherbb6:                                              ; preds = %bb5, %bb2, %bb
27cee313d2SEric Christopher  %tmp7 = phi i32 [ %tmp, %bb5 ], [ 0, %bb ], [ %tmp, %bb2 ]
28cee313d2SEric Christopher  ret i32 %tmp7
29cee313d2SEric Christopher}
30cee313d2SEric Christopher
31cee313d2SEric Christopherdeclare i32 @bar(...) local_unnamed_addr #1
32cee313d2SEric Christopher
33cee313d2SEric Christopherdeclare void @foo(...) local_unnamed_addr #1
34cee313d2SEric Christopher
35cee313d2SEric Christopher; Function Attrs: nounwind uwtable
36cee313d2SEric Christopherdefine i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
37cee313d2SEric Christopher; CHECK-LABEL: @dummy_caller
38cee313d2SEric Christopher; CHECK: codeRepl.i:
39cee313d2SEric Christopher; CHECK:  call void @test.1.bb2()
40cee313d2SEric Christopher; CHECK-NOT: load
41*7c5d2becSJonathan Roelofs; CHECK:  br
42cee313d2SEric Christopher
43cee313d2SEric Christopherbb:
44cee313d2SEric Christopher  %tmp = tail call i32 @test(i32 %arg)
45cee313d2SEric Christopher  ret i32 %tmp
46cee313d2SEric Christopher}
47cee313d2SEric Christopher
48cee313d2SEric Christopher; CHECK-LABEL: define internal void @test.1.bb2()
49cee313d2SEric Christopher; CHECK: .exitStub:
50cee313d2SEric Christopher; CHECK-NOT:  store i32 %tmp7, i32* %tmp7.out
51cee313d2SEric Christopher; CHECK: ret
52cee313d2SEric Christopher
53cee313d2SEric Christopher
54cee313d2SEric Christopherattributes #0 = { nounwind uwtable }
55cee313d2SEric Christopherattributes #1 = { nounwind uwtable }
56cee313d2SEric Christopher
57cee313d2SEric Christopher!llvm.module.flags = !{!0}
58cee313d2SEric Christopher!llvm.ident = !{!1}
59cee313d2SEric Christopher
60cee313d2SEric Christopher!0 = !{i32 1, !"wchar_size", i32 4}
61cee313d2SEric Christopher!1 = !{!"clang version 5.0.0 (trunk 303574)"}
62