FileCheck-ize this test. Note the FIXME I've introduced here: we've
authorChandler Carruth <chandlerc@gmail.com>
Sat, 24 Mar 2012 21:24:19 +0000 (21:24 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 24 Mar 2012 21:24:19 +0000 (21:24 +0000)
regressed seriously here, we are no longer removing allocas during
inline cleanup. This appears to be because of lifetime markers "using"
them. =/ I'll look into this shortly.

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

test/Transforms/Inline/inline_cleanup.ll

index 4c6472194210227252976c363a18d76e88af53e8..b744ae1ef396cd7dc7f8a8c3e996cd8713ae18cc 100644 (file)
@@ -1,10 +1,8 @@
 ; Test that the inliner doesn't leave around dead allocas, and that it folds
 ; uncond branches away after it is done specializing.
 
-; RUN: opt < %s -inline -S | \
-; RUN:    not grep {alloca.*uses=0}
-; RUN: opt < %s -inline -S | \
-; RUN:    not grep {br label}
+; RUN: opt < %s -inline -S | FileCheck %s
+
 @A = weak global i32 0         ; <i32*> [#uses=1]
 @B = weak global i32 0         ; <i32*> [#uses=1]
 @C = weak global i32 0         ; <i32*> [#uses=1]
@@ -54,6 +52,18 @@ UnifiedReturnBlock:          ; preds = %cond_next13
 declare void @ext(i32*)
 
 define void @test() {
+; CHECK: @test
+; CHECK-NOT: ret
+;
+; FIXME: This should be a CHECK-NOT, but currently we have a bug that causes us
+; to not nuke unused allocas.
+; CHECK: alloca
+; CHECK-NOT: ret
+;
+; No branches should survive the inliner's cleanup.
+; CHECK-NOT: br
+; CHECK: ret void
+
 entry:
        tail call fastcc void @foo( i32 1 )
        tail call fastcc void @foo( i32 2 )