56 lines · plain
1; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s2 3 4; Function Attrs: nounwind5declare void @foo(...) local_unnamed_addr #06 7; Function Attrs: noinline8define i32 @caller(ptr nocapture %arg, ptr nocapture %arg1, i32 %arg2) local_unnamed_addr #1 {9bb:10 %tmp = tail call i32 %arg(i32 %arg2) #011 %tmp3 = tail call i32 %arg1(i32 %arg2) #012 %tmp4 = add nsw i32 %tmp3, %tmp13 ret i32 %tmp414}15 16; Function Attrs: nounwind17define i32 @bar(i32 %arg) #0 {18bb:19 %tmp = icmp slt i32 %arg, 020 br i1 %tmp, label %bb1, label %bb221 22bb1: ; preds = %bb23 tail call void (...) @foo() #024 tail call void (...) @foo() #025 tail call void (...) @foo() #026 tail call void (...) @foo() #027 tail call void (...) @foo() #028 tail call void (...) @foo() #029 tail call void (...) @foo() #030 tail call void (...) @foo() #031 tail call void (...) @foo() #032 br label %bb233 34bb2: ; preds = %bb1, %bb35 %tmp3 = phi i32 [ 0, %bb1 ], [ 1, %bb ]36 ret i32 %tmp337}38 39; Function Attrs: nounwind40define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {41bb:42; CHECK-LABEL: @dummy_caller43; check that caller is not wrongly inlined by partial inliner44; CHECK: call i32 @caller45; CHECK-NOT: call .* @bar46 %tmp = tail call i32 @caller(ptr nonnull @bar, ptr nonnull @bar, i32 %arg)47 ret i32 %tmp48}49 50attributes #0 = { nounwind }51attributes #1 = { noinline }52 53!llvm.ident = !{!0}54 55!0 = !{!"clang version 5.0.0 (trunk 300897) (llvm/trunk 300947)"}56