Replace four tiny tests with various uses of grep and not with a single

test and FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2012-04-01 10:11:17 +00:00
parent 830da405fa
commit 0b42f9dd2f
5 changed files with 42 additions and 46 deletions

View File

@ -1,10 +0,0 @@
; RUN: opt < %s -inline-threshold=0 -inline -S | not grep call
define i32 @fn2() alwaysinline {
ret i32 1
}
define i32 @fn3() {
%r = call i32 @fn2()
ret i32 %r
}

View File

@ -1,14 +0,0 @@
; RUN: opt < %s -always-inline -S | not grep call
; Ensure that threshold doesn't disrupt always inline.
; RUN: opt < %s -inline-threshold=-2000000001 -always-inline -S | not grep call
define internal i32 @if0() alwaysinline {
ret i32 1
}
define i32 @f0() {
%r = call i32 @if0()
ret i32 %r
}

View File

@ -1,7 +0,0 @@
; RUN: opt < %s -always-inline -S | grep {@foo}
; Ensure that foo is not removed by always inliner
; PR 2945
define internal i32 @foo() nounwind {
ret i32 0
}

View File

@ -0,0 +1,42 @@
; RUN: opt < %s -inline-threshold=0 -always-inline -S | FileCheck %s
;
; Ensure the threshold has no impact on these decisions.
; RUN: opt < %s -inline-threshold=20000000 -always-inline -S | FileCheck %s
; RUN: opt < %s -inline-threshold=-20000000 -always-inline -S | FileCheck %s
define i32 @inner1() alwaysinline {
ret i32 1
}
define i32 @outer1() {
; CHECK: @outer1
; CHECK-NOT: call
; CHECK: ret
%r = call i32 @inner1()
ret i32 %r
}
; The always inliner can't DCE internal functions. PR2945
; CHECK: @pr2945
define internal i32 @pr2945() nounwind {
ret i32 0
}
define internal void @inner2(i32 %N) alwaysinline {
%P = alloca i32, i32 %N
ret void
}
define void @outer2(i32 %N) {
; The always inliner (unlike the normal one) should be willing to inline
; a function with a dynamic alloca into one without a dynamic alloca.
; rdar://6655932
;
; CHECK: @outer2
; CHECK-NOT: call void @inner2
; CHECK alloca i32, i32 %N
; CHECK-NOT: call void @inner2
; CHECK: ret void
call void @inner2( i32 %N )
ret void
}

View File

@ -1,15 +0,0 @@
; RUN: opt < %s -inline -S | not grep callee
; rdar://6655932
; If callee is marked alwaysinline, inline it! Even if callee has dynamic
; alloca and caller does not,
define internal void @callee(i32 %N) alwaysinline {
%P = alloca i32, i32 %N
ret void
}
define void @foo(i32 %N) {
call void @callee( i32 %N )
ret void
}