Skip to content

Commit b444947

Browse files
arsenmIanWood1
authored andcommitted
Assembler: Replace some usage of grep in tests with FileCheck (llvm#138114)
1 parent ecf4f95 commit b444947

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

0 commit comments

Comments
 (0)