Replace four tiny tests with various uses of grep and not with a single
authorChandler Carruth <chandlerc@gmail.com>
Sun, 1 Apr 2012 10:11:17 +0000 (10:11 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 1 Apr 2012 10:11:17 +0000 (10:11 +0000)
test and FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153831 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/Inline/2008-09-02-AlwaysInline.ll [deleted file]
test/Transforms/Inline/2008-10-30-AlwaysInline.ll [deleted file]
test/Transforms/Inline/2008-11-04-AlwaysInline.ll [deleted file]
test/Transforms/Inline/always-inline.ll [new file with mode: 0644]
test/Transforms/Inline/always_inline_dyn_alloca.ll [deleted file]

diff --git a/test/Transforms/Inline/2008-09-02-AlwaysInline.ll b/test/Transforms/Inline/2008-09-02-AlwaysInline.ll
deleted file mode 100644 (file)
index 39095c4..0000000
+++ /dev/null
@@ -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
-}
diff --git a/test/Transforms/Inline/2008-10-30-AlwaysInline.ll b/test/Transforms/Inline/2008-10-30-AlwaysInline.ll
deleted file mode 100644 (file)
index 11e5012..0000000
+++ /dev/null
@@ -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
-}
diff --git a/test/Transforms/Inline/2008-11-04-AlwaysInline.ll b/test/Transforms/Inline/2008-11-04-AlwaysInline.ll
deleted file mode 100644 (file)
index bc9787b..0000000
+++ /dev/null
@@ -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
-}
diff --git a/test/Transforms/Inline/always-inline.ll b/test/Transforms/Inline/always-inline.ll
new file mode 100644 (file)
index 0000000..40091d7
--- /dev/null
@@ -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
+}
diff --git a/test/Transforms/Inline/always_inline_dyn_alloca.ll b/test/Transforms/Inline/always_inline_dyn_alloca.ll
deleted file mode 100644 (file)
index 25cfc49..0000000
+++ /dev/null
@@ -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
-}