1 ; RUN: opt < %s -passes=partial-inliner -S -stats -pass-remarks=partial-inlining 2>&1 | FileCheck %s
3 @stat = external global i32, align 4
5 define i32 @inline_fail(i32 %count, ...) {
7 %vargs = alloca ptr, align 8
8 call void @llvm.va_start(ptr %vargs)
9 %stat1 = load i32, ptr @stat, align 4
10 %cmp = icmp slt i32 %stat1, 0
11 br i1 %cmp, label %bb2, label %bb1
14 %vg1 = add nsw i32 %stat1, 1
15 store i32 %vg1, ptr @stat, align 4
16 %va1 = va_arg ptr %vargs, i32
17 call void @foo(i32 %count, i32 %va1) #2
20 bb2: ; preds = %bb1, %entry
21 %res = phi i32 [ 1, %bb1 ], [ 0, %entry ]
22 call void @llvm.va_end(ptr %vargs)
26 define i32 @caller(i32 %arg) {
28 %res = tail call i32 (i32, ...) @inline_fail(i32 %arg, i32 %arg)
32 declare void @foo(i32, i32)
33 declare void @llvm.va_start(ptr)
34 declare void @llvm.va_end(ptr)
36 ; Check that no remarks have been emitted, inline_fail has not been partial
37 ; inlined, no code has been extracted and the partial-inlining counter
38 ; has not been incremented.
41 ; CHECK: tail call i32 (i32, ...) @inline_fail(i32 %arg, i32 %arg)
42 ; CHECK-NOT: inline_fail.1_bb1
43 ; CHECK-NOT: partial-inlining