llvm.org GIT mirror llvm / 563add9
Make tests which first provide a negative assertion via 'not', then 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 Chandler Carruth 8 years ago
9 changed file(s) with 18 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
None ; RUN: not llvm-as < %s >/dev/null |& grep {struct initializer doesn't match struct element type}
0 ; RUN: not llvm-as < %s >/dev/null 2> %t
1 ; RUN: grep "struct initializer doesn't match struct element type" %t
12 ; Test the case of a misformed constant initializer
23 ; This should cause an assembler error, not an assertion failure!
34 constant { i32 } { float 1.0 }
0 ; Found by inspection of the code
1 ; RUN: not llvm-as < %s > /dev/null |& grep {constexpr requires integer operands}
1 ; RUN: not llvm-as < %s > /dev/null 2> %t
2 ; RUN: grep "constexpr requires integer operands" %t
23
34 global i32 ashr (float 1.0, float 2.0)
0 ; Found by inspection of the code
1 ; RUN: not llvm-as < %s > /dev/null |& grep {initializer with struct type has wrong # elements}
1 ; RUN: not llvm-as < %s > /dev/null 2> %t
2 ; RUN: grep "initializer with struct type has wrong # elements" %t
23
34 global {} { i32 7, float 1.0, i32 7, i32 8 }
0 ; Test for PR902. This program is erroneous, but should not crash llvm-as.
11 ; This tests that a simple error is caught and processed correctly.
2 ; RUN: not llvm-as < %s >/dev/null |& grep {floating point constant invalid for type}
2 ; RUN: not llvm-as < %s >/dev/null 2> %t
3 ; RUN: grep "floating point constant invalid for type" %t
34
45 define void @test() {
56 add i32 1, 2.0
0 ; PR 1258
1 ; RUN: not llvm-as < %s >/dev/null |& grep {'%0' defined with type 'i1'}
1 ; RUN: not llvm-as < %s >/dev/null 2> %t
2 ; RUN: grep "'%0' defined with type 'i1'" %t
23
34 define i32 @test1(i32 %a, i32 %b) {
45 entry:
None ; RUN: not llvm-as < %s > /dev/null |& grep {expected top-level entity}
0 ; RUN: not llvm-as < %s > /dev/null 2> %t
1 ; RUN: grep "expected top-level entity" %t
12 ; PR1577
23
34 @anInt = global i32 1
None ; RUN: not llvm-as < %s >/dev/null |& FileCheck %s
0 ; RUN: not llvm-as < %s >/dev/null 2> %t
1 ; RUN: FileCheck %s < %t
12 ; Test the case of a incorrect indices type into struct
23
34 ; CHECK: invalid getelementptr indices
None ; RUN: not llvm-dis < %s.bc > /dev/null |& FileCheck %s
0 ; RUN: not llvm-dis < %s.bc > /dev/null 2> %t
1 ; RUN: FileCheck %s < %t
12 ; PR8494
23
34 ; CHECK: Invalid MODULE_CODE_FUNCTION record
None ; RUN: not llvm-as < %s > /dev/null |& grep {basic block pointers are invalid}
0 ; RUN: not llvm-as < %s > /dev/null 2> %t
1 ; RUN: grep "basic block pointers are invalid" %t
12
23 define i32 @main() {
34 %foo = call i8* %llvm.stacksave()