1 ; RUN: opt < %s -partial-inliner -S -stats -pass-remarks=partial-inlining 2>&1 | FileCheck %s
2 ; RUN: opt < %s -passes=partial-inliner -S -stats -pass-remarks=partial-inlining 2>&1 | FileCheck %s
4 @stat = external global i32, align 4
6 define i32 @inline_fail(i32 %count, ...) {
8 %vargs = alloca i8*, align 8
9 %vargs1 = bitcast i8** %vargs to i8*
10 call void @llvm.va_start(i8* %vargs1)
11 %stat1 = load i32, i32* @stat, align 4
12 %cmp = icmp slt i32 %stat1, 0
13 br i1 %cmp, label %bb2, label %bb1
16 %vg1 = add nsw i32 %stat1, 1
17 store i32 %vg1, i32* @stat, align 4
18 %va1 = va_arg i8** %vargs, i32
19 call void @foo(i32 %count, i32 %va1) #2
22 bb2: ; preds = %bb1, %entry
23 %res = phi i32 [ 1, %bb1 ], [ 0, %entry ]
24 call void @llvm.va_end(i8* %vargs1)
28 define i32 @caller(i32 %arg) {
30 %res = tail call i32 (i32, ...) @inline_fail(i32 %arg, i32 %arg)
34 declare void @foo(i32, i32)
35 declare void @llvm.va_start(i8*)
36 declare void @llvm.va_end(i8*)
38 ; Check that no remarks have been emitted, inline_fail has not been partial
39 ; inlined, no code has been extracted and the partial-inlining counter
40 ; has not been incremented.
43 ; CHECK: tail call i32 (i32, ...) @inline_fail(i32 %arg, i32 %arg)
44 ; CHECK-NOT: inline_fail.1_bb1
45 ; CHECK-NOT: partial-inlining