From c3d5c1cb338f3929f868f6130a2d036ff22e9e1c Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Mon, 8 Apr 2013 18:33:51 +0000 Subject: [PATCH] Rewrite test/Verifier tests to use FileCheck instead of grep git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179036 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Verifier/2002-04-13-RetTypes.ll | 5 +++-- test/Verifier/2002-11-05-GetelementptrPointers.ll | 3 ++- test/Verifier/2006-07-11-StoreStruct.ll | 4 +++- test/Verifier/2006-10-15-AddrLabel.ll | 3 ++- test/Verifier/2006-12-12-IntrinsicDefine.ll | 3 ++- test/Verifier/2008-03-01-AllocaSized.ll | 3 ++- test/Verifier/2008-08-22-MemCpyAlignment.ll | 3 ++- test/Verifier/2008-11-15-RetVoid.ll | 3 ++- test/Verifier/2010-08-07-PointerIntrinsic.ll | 3 ++- test/Verifier/AmbiguousPhi.ll | 5 ++--- test/Verifier/PhiGrouping.ll | 5 ++--- test/Verifier/SelfReferential.ll | 3 ++- test/Verifier/aliasing-chain.ll | 4 ++-- 13 files changed, 28 insertions(+), 19 deletions(-) diff --git a/test/Verifier/2002-04-13-RetTypes.ll b/test/Verifier/2002-04-13-RetTypes.ll index af468395be3..9385ebe5ff1 100644 --- a/test/Verifier/2002-04-13-RetTypes.ll +++ b/test/Verifier/2002-04-13-RetTypes.ll @@ -1,7 +1,8 @@ -; RUN: not llvm-as < %s 2>&1 | grep "value doesn't match function result type 'i32'" +; RUN: not llvm-as < %s 2>&1 | FileCheck %s ; Verify the operand type of the ret instructions in a function match the -; delcared return type of the function they live in. +; declared return type of the function they live in. +; CHECK: value doesn't match function result type 'i32' ; define i32 @testfunc() { diff --git a/test/Verifier/2002-11-05-GetelementptrPointers.ll b/test/Verifier/2002-11-05-GetelementptrPointers.ll index 108ae5f7657..66b233ec63a 100644 --- a/test/Verifier/2002-11-05-GetelementptrPointers.ll +++ b/test/Verifier/2002-11-05-GetelementptrPointers.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as < %s 2>&1 | grep "invalid getelementptr indices" +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: invalid getelementptr indices ; This testcase is invalid because we are indexing into a pointer that is ; contained WITHIN a structure. diff --git a/test/Verifier/2006-07-11-StoreStruct.ll b/test/Verifier/2006-07-11-StoreStruct.ll index 65b229d1ca9..70aea8779bf 100644 --- a/test/Verifier/2006-07-11-StoreStruct.ll +++ b/test/Verifier/2006-07-11-StoreStruct.ll @@ -1,4 +1,6 @@ -; RUN: llvm-as < %s 2>&1 | not grep "Instruction operands must be first-class" +; RUN: llvm-as < %s 2>&1 | FileCheck %s + +; CHECK-NOT: Instruction operands must be first-class ; This previously was for PR826, but structs are now first-class so ; the following is now valid. diff --git a/test/Verifier/2006-10-15-AddrLabel.ll b/test/Verifier/2006-10-15-AddrLabel.ll index c8fedb5f195..decbf5ba42b 100644 --- a/test/Verifier/2006-10-15-AddrLabel.ll +++ b/test/Verifier/2006-10-15-AddrLabel.ll @@ -1,5 +1,6 @@ ; RUN: not llvm-as < %s > /dev/null 2> %t -; RUN: grep "basic block pointers are invalid" %t +; RUN: FileCheck %s --input-file=%t +; CHECK: basic block pointers are invalid define i32 @main() { %foo = call i8* %llvm.stacksave() diff --git a/test/Verifier/2006-12-12-IntrinsicDefine.ll b/test/Verifier/2006-12-12-IntrinsicDefine.ll index 6e7468c1d9e..8cc3d24b5c8 100644 --- a/test/Verifier/2006-12-12-IntrinsicDefine.ll +++ b/test/Verifier/2006-12-12-IntrinsicDefine.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as < %s 2>&1 | grep "llvm intrinsics cannot be defined" +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: llvm intrinsics cannot be defined ; PR1047 define void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) { diff --git a/test/Verifier/2008-03-01-AllocaSized.ll b/test/Verifier/2008-03-01-AllocaSized.ll index 51258bef76e..fc12a96e4f9 100644 --- a/test/Verifier/2008-03-01-AllocaSized.ll +++ b/test/Verifier/2008-03-01-AllocaSized.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Cannot allocate unsized type" +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: Cannot allocate unsized type ; PR2113 define void @test() { diff --git a/test/Verifier/2008-08-22-MemCpyAlignment.ll b/test/Verifier/2008-08-22-MemCpyAlignment.ll index c6d5afd51c9..3f7cb523430 100644 --- a/test/Verifier/2008-08-22-MemCpyAlignment.ll +++ b/test/Verifier/2008-08-22-MemCpyAlignment.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "alignment argument of memory intrinsics must be a constant int" +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: alignment argument of memory intrinsics must be a constant int ; PR2318 define void @x(i8* %a, i8* %src, i64 %len, i32 %align) nounwind { diff --git a/test/Verifier/2008-11-15-RetVoid.ll b/test/Verifier/2008-11-15-RetVoid.ll index 42503fabbec..62f6da11313 100644 --- a/test/Verifier/2008-11-15-RetVoid.ll +++ b/test/Verifier/2008-11-15-RetVoid.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as < %s 2>&1 | grep "value doesn't match function result type 'void'" +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: value doesn't match function result type 'void' define void @foo() { ret i32 0 diff --git a/test/Verifier/2010-08-07-PointerIntrinsic.ll b/test/Verifier/2010-08-07-PointerIntrinsic.ll index 3136c61514b..a668d04213f 100644 --- a/test/Verifier/2010-08-07-PointerIntrinsic.ll +++ b/test/Verifier/2010-08-07-PointerIntrinsic.ll @@ -1,5 +1,6 @@ ; RUN: not llvm-as < %s 2> %t -; RUN: grep "Broken module" %t +; RUN: FileCheck %s --input-file=%t +; CHECK: Broken module ; PR7316 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32" diff --git a/test/Verifier/AmbiguousPhi.ll b/test/Verifier/AmbiguousPhi.ll index f31bc107acc..cb05a728262 100644 --- a/test/Verifier/AmbiguousPhi.ll +++ b/test/Verifier/AmbiguousPhi.ll @@ -1,6 +1,5 @@ -; RUN: not llvm-as < %s 2>&1 | grep "multiple entries for the same basic block" - - +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: multiple entries for the same basic block define i32 @test(i32 %i, i32 %j, i1 %c) { br i1 %c, label %A, label %A diff --git a/test/Verifier/PhiGrouping.ll b/test/Verifier/PhiGrouping.ll index 7b42fd28e3d..291f0848cb2 100644 --- a/test/Verifier/PhiGrouping.ll +++ b/test/Verifier/PhiGrouping.ll @@ -1,6 +1,5 @@ -; RUN: not llvm-as < %s 2>&1 | grep "PHI nodes not grouped at top" - - +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: PHI nodes not grouped at top define i32 @test(i32 %i, i32 %j, i1 %c) { br i1 %c, label %A, label %B diff --git a/test/Verifier/SelfReferential.ll b/test/Verifier/SelfReferential.ll index c24c0ebba3d..7f0166a158d 100644 --- a/test/Verifier/SelfReferential.ll +++ b/test/Verifier/SelfReferential.ll @@ -1,4 +1,5 @@ -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Only PHI nodes may reference their own value" +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: Only PHI nodes may reference their own value ; Test that self referential instructions are not allowed diff --git a/test/Verifier/aliasing-chain.ll b/test/Verifier/aliasing-chain.ll index a52e796b2b8..ae0b77fdc39 100644 --- a/test/Verifier/aliasing-chain.ll +++ b/test/Verifier/aliasing-chain.ll @@ -1,5 +1,5 @@ -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Aliasing chain should end with function or global variable" - +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: Aliasing chain should end with function or global variable ; Test that alising chain does not create a cycle @b1 = alias i32* @c1 -- 2.34.1