Make tests which first provide a negative assertion via 'not', then
authorChandler Carruth <chandlerc@gmail.com>
Mon, 2 Jul 2012 12:23:19 +0000 (12:23 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 2 Jul 2012 12:23:19 +0000 (12:23 +0000)
a pipeline, and then a positive assertion via grep, use two RUN lines
instead.

Supporting these complex ideas of 'success' and 'failure' across
multiple stages of a pipeline is brittle in the shell world, and would
block switching to ShTest format; it only worked due to contrivances
introduced by the TclTest format.

Writing this as two separate RUN lines seems clearer in any event.

This is another step toward completely removing TclTests from lit.

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

test/Assembler/2003-04-15-ConstantInitAssertion.ll
test/Assembler/2003-05-21-MalformedShiftCrash.ll
test/Assembler/2003-05-21-MalformedStructCrash.ll
test/Assembler/2006-09-28-CrashOnInvalid.ll
test/Assembler/2007-03-18-InvalidNumberedVar.ll
test/Assembler/2007-08-06-AliasInvalid.ll
test/Assembler/getelementptr_struct.ll
test/Bitcode/null-type.ll
test/Verifier/2006-10-15-AddrLabel.ll

index fa6b807709e12142bb7a942bf4c697f04ac7f212..dddbdb1c4709d4182f022a049c4c4ce0a3422e1c 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: not llvm-as < %s >/dev/null |& grep {struct initializer doesn't match struct element type}
+; RUN: not llvm-as < %s >/dev/null 2> %t
+; RUN: grep "struct initializer doesn't match struct element type" %t
 ; Test the case of a misformed constant initializer
 ; This should cause an assembler error, not an assertion failure!
 constant { i32 } { float 1.0 }
index a845d89bb6c92b9862debe1b9643c37fb650f3b1..1d4ac401d6d0676ddb71b493ac1ccdec0c0b9ee3 100644 (file)
@@ -1,4 +1,5 @@
 ; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {constexpr requires integer operands}
+; RUN: not llvm-as < %s > /dev/null 2> %t
+; RUN: grep "constexpr requires integer operands" %t
 
 global i32 ashr (float 1.0, float 2.0)
index 8d20e0703a44adcc677d99386356b5f7a3953c3c..44d3e234d731d42fd34280673628fcee17b6d2b0 100644 (file)
@@ -1,4 +1,5 @@
 ; Found by inspection of the code
-; RUN: not llvm-as < %s  > /dev/null |& grep {initializer with struct type has wrong # elements}
+; RUN: not llvm-as < %s  > /dev/null 2> %t
+; RUN: grep "initializer with struct type has wrong # elements" %t
 
 global {} { i32 7, float 1.0, i32 7, i32 8 }
index a203c6ad034d920b9230141f1ae552b9d92ac4c8..6041bdf4797b9e20ce871ee39a757d5f62293ae1 100644 (file)
@@ -1,6 +1,7 @@
 ; Test for PR902.  This program is erroneous, but should not crash llvm-as.
 ; This tests that a simple error is caught and processed correctly.
-; RUN: not llvm-as < %s >/dev/null |& grep {floating point constant invalid for type}
+; RUN: not llvm-as < %s >/dev/null 2> %t
+; RUN: grep "floating point constant invalid for type" %t
 
 define void @test() {
   add i32 1, 2.0
index b2193b17013049be6658dcfdb023a5e021620b85..0f6b24d5d9f9c830acfb9e456c3b0215a70c3810 100644 (file)
@@ -1,5 +1,6 @@
 ; PR 1258
-; RUN: not llvm-as < %s >/dev/null |& grep {'%0' defined with type 'i1'}
+; RUN: not llvm-as < %s >/dev/null 2> %t
+; RUN: grep "'%0' defined with type 'i1'" %t
 
 define i32 @test1(i32 %a, i32 %b) {
 entry:
index 94095982468c86783b920452a9a3f5d7901f3487..3abdc41cd38377288a022c04d99fb071ea469727 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: not llvm-as < %s > /dev/null |& grep {expected top-level entity}
+; RUN: not llvm-as < %s > /dev/null 2> %t
+; RUN: grep "expected top-level entity" %t
 ; PR1577
 
 @anInt = global i32 1 
index bfebf29bd5eac25dc70c1af5534b37f9da594f99..0293672233953b76432863300a057a0e82f04450 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: not llvm-as < %s >/dev/null |& FileCheck %s
+; RUN: not llvm-as < %s >/dev/null 2> %t
+; RUN: FileCheck %s < %t
 ; Test the case of a incorrect indices type into struct
 
 ; CHECK: invalid getelementptr indices
index b972753da1dd4780df3cabd2f20f601b77ef614d..8502b0d55a338574b9642695b0a0bf198b41317d 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: not llvm-dis < %s.bc > /dev/null |& FileCheck %s
+; RUN: not llvm-dis < %s.bc > /dev/null 2> %t
+; RUN: FileCheck %s < %t
 ; PR8494
 
 ; CHECK: Invalid MODULE_CODE_FUNCTION record
index 0b73b47893c5845ef5022585ba542973fd4a8e6d..c8fedb5f195db871a1df442b3acb45273b75c173 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: not llvm-as < %s > /dev/null |& grep {basic block pointers are invalid}
+; RUN: not llvm-as < %s > /dev/null 2> %t
+; RUN: grep "basic block pointers are invalid" %t
 
 define i32 @main() {
          %foo  = call i8* %llvm.stacksave()