1 ; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s
4 ; Function Attrs: nounwind
5 declare void @foo(...) local_unnamed_addr #0
7 ; Function Attrs: noinline
8 define i32 @caller(ptr nocapture %arg, ptr nocapture %arg1, i32 %arg2) local_unnamed_addr #1 {
10 %tmp = tail call i32 %arg(i32 %arg2) #0
11 %tmp3 = tail call i32 %arg1(i32 %arg2) #0
12 %tmp4 = add nsw i32 %tmp3, %tmp
16 ; Function Attrs: nounwind
17 define i32 @bar(i32 %arg) #0 {
19 %tmp = icmp slt i32 %arg, 0
20 br i1 %tmp, label %bb1, label %bb2
23 tail call void (...) @foo() #0
24 tail call void (...) @foo() #0
25 tail call void (...) @foo() #0
26 tail call void (...) @foo() #0
27 tail call void (...) @foo() #0
28 tail call void (...) @foo() #0
29 tail call void (...) @foo() #0
30 tail call void (...) @foo() #0
31 tail call void (...) @foo() #0
34 bb2: ; preds = %bb1, %bb
35 %tmp3 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
39 ; Function Attrs: nounwind
40 define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
42 ; CHECK-LABEL: @dummy_caller
43 ; check that caller is not wrongly inlined by partial inliner
44 ; CHECK: call i32 @caller
45 ; CHECK-NOT: call .* @bar
46 %tmp = tail call i32 @caller(ptr nonnull @bar, ptr nonnull @bar, i32 %arg)
50 attributes #0 = { nounwind }
51 attributes #1 = { noinline }
55 !0 = !{!"clang version 5.0.0 (trunk 300897) (llvm/trunk 300947)"}