Replace four tiny tests with various uses of grep and not with a single
[oota-llvm.git] / test / Transforms / Inline / always-inline.ll
1 ; RUN: opt < %s -inline-threshold=0 -always-inline -S | FileCheck %s
2 ;
3 ; Ensure the threshold has no impact on these decisions.
4 ; RUN: opt < %s -inline-threshold=20000000 -always-inline -S | FileCheck %s
5 ; RUN: opt < %s -inline-threshold=-20000000 -always-inline -S | FileCheck %s
6
7 define i32 @inner1() alwaysinline {
8   ret i32 1
9 }
10 define i32 @outer1() {
11 ; CHECK: @outer1
12 ; CHECK-NOT: call
13 ; CHECK: ret
14
15    %r = call i32 @inner1()
16    ret i32 %r
17 }
18
19 ; The always inliner can't DCE internal functions. PR2945
20 ; CHECK: @pr2945
21 define internal i32 @pr2945() nounwind {
22   ret i32 0
23 }
24
25 define internal void @inner2(i32 %N) alwaysinline {
26   %P = alloca i32, i32 %N
27   ret void
28 }
29 define void @outer2(i32 %N) {
30 ; The always inliner (unlike the normal one) should be willing to inline
31 ; a function with a dynamic alloca into one without a dynamic alloca.
32 ; rdar://6655932
33 ;
34 ; CHECK: @outer2
35 ; CHECK-NOT: call void @inner2
36 ; CHECK alloca i32, i32 %N
37 ; CHECK-NOT: call void @inner2
38 ; CHECK: ret void
39
40   call void @inner2( i32 %N )
41   ret void
42 }