Skip to content

Commit 79b841d

Browse files
authored
Assembler: Replace some usage of grep in tests with FileCheck (#138114)
1 parent 9494464 commit 79b841d

21 files changed

+65
-35
lines changed

llvm/test/Assembler/2002-04-07-InfConstant.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
; The output formater prints out 1.0e100 as Inf!
1+
; The output formatter prints out 1.0e100 as Inf!
22
;
3-
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000
3+
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
44
; RUN: verify-uselistorder %s
55

6+
; CHECK: fmul float 0x7FF0000000000000, 1.000000e+01
67
define float @test() {
78
%tmp = fmul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
89
ret float %tmp

llvm/test/Assembler/2002-04-29-NameBinding.ll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
;
44
; Check by running globaldce, which will remove the constant if there are
55
; no references to it!
6-
;
7-
; RUN: opt < %s -passes=globaldce -S | \
8-
; RUN: not grep constant
6+
;
7+
; RUN: opt < %s -passes=globaldce -S | FileCheck %s
98
;
109
; RUN: verify-uselistorder %s
1110

12-
@v1 = internal constant i32 5
11+
; CHECK-NOT: constant
12+
; CHECK-NOT: @v1
13+
14+
@v1 = internal constant i32 5
1315

1416
define i32 @createtask() {
15-
%v1 = alloca i32 ;; Alloca should have one use!
17+
%v1 = alloca i32 ;; Alloca should have one use!
1618
%reg112 = load i32, ptr %v1 ;; This load should not use the global!
1719
ret i32 %reg112
1820
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
; RUN: not llvm-as < %s >/dev/null 2> %t
2-
; RUN: grep "struct initializer doesn't match struct element type" %t
1+
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
2+
33
; Test the case of a misformed constant initializer
44
; This should cause an assembler error, not an assertion failure!
5+
6+
; CHECK: struct initializer doesn't match struct element type
57
@0 = constant { i32 } { float 1.0 }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep -- -2147483648
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: i32 -2147483648
45
define i32 @foo() {
56
ret i32 -2147483648
67
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; Found by inspection of the code
2-
; RUN: not llvm-as < %s > /dev/null 2> %t
3-
; RUN: grep "initializer with struct type has wrong # elements" %t
2+
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
3+
4+
; CHECK: initializer with struct type has wrong # elements
45

56
@0 = global {} { i32 7, float 1.0, i32 7, i32 8 }

llvm/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
; RUN: opt < %s -passes=instcombine,simplifycfg -S | not grep br
1+
; RUN: opt < %s -passes=instcombine,simplifycfg -S | FileCheck %s
22
; RUN: verify-uselistorder %s
33

44
@.str_1 = internal constant [6 x i8] c"_Bool\00" ; <ptr> [#uses=2]
55

6+
; Make sure there is no branch
7+
; CHECK: define i32 @test(
8+
; CHECK-NEXT: endif.7:
9+
; CHECK-NEXT: ret i32 0
10+
; CHECK-NEXT: }
611
define i32 @test() {
712
%tmp.54 = load i8, ptr getelementptr ([6 x i8], ptr @.str_1, i64 0, i64 1) ; <i8> [#uses=1]
813
%tmp.55 = icmp ne i8 %tmp.54, 66 ; <i1> [#uses=1]

llvm/test/Assembler/2003-11-24-SymbolTableCrash.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
; RUN: not llvm-as < %s 2>&1 | grep "multiple definition"
1+
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
22

3+
; CHECK: error: multiple definition of local value named 'tmp.1'
34
define void @test() {
45
%tmp.1 = add i32 0, 1
56
br label %return
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep 9223372036854775808
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: i64 -9223372036854775808
45
@0 = global i64 -9223372036854775808
56

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
; RUN: not llvm-as %s 2>&1 | grep "found end of file when expecting more instructions"
1+
; RUN: not llvm-as %s 2>&1 | FileCheck %s
2+
3+
; CHECK: found end of file when expecting more instructions
24

35
define void @foo() {

llvm/test/Assembler/2006-09-28-CrashOnInvalid.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
; Test for PR902. This program is erroneous, but should not crash llvm-as.
22
; This tests that a simple error is caught and processed correctly.
3-
; RUN: not llvm-as < %s >/dev/null 2> %t
4-
; RUN: grep "floating point constant invalid for type" %t
3+
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
4+
5+
; CHECK: floating point constant invalid for type
56

67
define void @test() {
78
add i32 1, 2.0

llvm/test/Assembler/2006-12-09-Cast-To-Bool.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep bitcast
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: bitcast
45
define i1 @main(i32 %X) {
56
%res = bitcast i1 true to i1
67
ret i1 %res

llvm/test/Assembler/2007-01-16-CrashOnBadCast.ll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
; PR1117
2-
; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "invalid cast opcode for cast from"
2+
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
3+
4+
; CHECK: error: invalid cast opcode for cast from 'i64' to 'ptr'
35

46
define ptr @nada(i64 %X) {
57
%result = trunc i64 %X to ptr
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; PR1117
2-
; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "invalid cast opcode for cast from"
2+
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
33

4+
; CHECK: error: invalid cast opcode for cast from 'i64' to 'ptr'
45
@X = constant ptr trunc (i64 0 to ptr)

llvm/test/Assembler/2007-03-18-InvalidNumberedVar.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; PR 1258
2-
; RUN: not llvm-as < %s >/dev/null 2> %t
3-
; RUN: grep "'%0' defined with type 'i1'" %t
2+
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
43

4+
; CHECK: '%0' defined with type 'i1'
55
define i32 @test1(i32 %a, i32 %b) {
66
entry:
77
icmp eq i32 %b, %a ; <i1>:0 [#uses=1]

llvm/test/Assembler/2007-04-20-AlignedLoad.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: %tmp2 = load i32, ptr %arg, align 1024
45
define i32 @test(ptr %arg) {
56
entry:
67
%tmp2 = load i32, ptr %arg, align 1024 ; <i32> [#uses=1]

llvm/test/Assembler/2007-04-20-AlignedStore.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: align 1024
45
define void @test(ptr %arg) {
56
entry:
67
store i32 0, ptr %arg, align 1024
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
; RUN: not llvm-as < %s > /dev/null 2> %t
2-
; RUN: grep "expected top-level entity" %t
1+
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
32
; PR1577
43

5-
@anInt = global i32 1
4+
; CHECK: expected top-level entity
5+
6+
@anInt = global i32 1
67
alias i32 @anAlias
78

89
define i32 @main() {
9-
ret i32 0
10+
ret i32 0
1011
}

llvm/test/Assembler/2008-01-11-VarargAttrs.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep byval
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4-
%struct = type { }
4+
%struct = type { }
55

6+
; CHECK: declare void @foo(...)
67
declare void @foo(...)
78

9+
; CHECK: call void (...) @foo(ptr byval(%struct) null)
810
define void @bar() {
911
call void (...) @foo(ptr byval(%struct) null )
1012
ret void
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
; RUN: not llvm-as %s 2>&1 | grep "integer constant must have integer type"
1+
; RUN: not llvm-as %s 2>&1 | FileCheck %s
22
; PR2060
33

4+
; CHECK: integer constant must have integer type
5+
46
define ptr @foo() {
57
ret ptr 0
68
}

llvm/test/Assembler/2008-09-29-RetAttr.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
; Test return attributes
2-
; RUN: llvm-as < %s | llvm-dis | grep "define inreg i32"
3-
; RUN: llvm-as < %s | llvm-dis | grep "call inreg i32"
2+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
43
; RUN: verify-uselistorder %s
54

5+
; CHECK: define inreg i32 @fn1()
66
define inreg i32 @fn1() {
77
ret i32 0
88
}
99

10+
; CHECK: call inreg i32 @fn1()
1011
define void @fn2() {
1112
%t = call inreg i32 @fn1()
1213
ret void
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
; RUN: llvm-as < %s | llvm-dis | grep "quote"
1+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
22
; RUN: verify-uselistorder %s
33

4+
; CHECK: quote
45
@"a\22quote" = global i32 0

0 commit comments

Comments
 (0)