From 0120b678a07a296e6217bf6de992a23c9616e1b1 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 10 Apr 2013 23:30:20 +0000 Subject: [PATCH] Rewrite some of the test/CodeGen/X86 tests to use FileCheck instead of grep git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179241 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll | 3 ++- test/CodeGen/X86/fast-cc-merge-stack-adj.ll | 4 ++-- test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll | 3 ++- test/CodeGen/X86/fast-isel-constpool.ll | 4 +++- test/CodeGen/X86/fast-isel-fneg.ll | 5 ++++- test/CodeGen/X86/fast-isel-gv.ll | 4 +++- test/CodeGen/X86/fast-isel-tailcall.ll | 3 ++- test/CodeGen/X86/fastcc-2.ll | 5 +++-- test/CodeGen/X86/fastcc-byval.ll | 5 ++++- test/CodeGen/X86/fastcc-sret.ll | 3 ++- test/CodeGen/X86/fastcc3struct.ll | 7 ++++--- 11 files changed, 31 insertions(+), 15 deletions(-) diff --git a/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll b/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll index b22a391ef35..b5679e66569 100644 --- a/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll +++ b/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll @@ -1,4 +1,5 @@ -; RUN: llc -fast-isel -march=x86 < %s | grep %fs: +; RUN: llc -fast-isel -march=x86 < %s | FileCheck %s +; CHECK: %fs: define i32 @test1(i32 addrspace(257)* %arg) nounwind { %tmp = load i32 addrspace(257)* %arg diff --git a/test/CodeGen/X86/fast-cc-merge-stack-adj.ll b/test/CodeGen/X86/fast-cc-merge-stack-adj.ll index d591f9408b1..5121ed13228 100644 --- a/test/CodeGen/X86/fast-cc-merge-stack-adj.ll +++ b/test/CodeGen/X86/fast-cc-merge-stack-adj.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mcpu=generic -march=x86 -x86-asm-syntax=intel | \ -; RUN: grep "add ESP, 8" +; RUN: llc < %s -mcpu=generic -march=x86 -x86-asm-syntax=intel | FileCheck %s +; CHECK: add ESP, 8 target triple = "i686-pc-linux-gnu" diff --git a/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll b/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll index 9233d3f7c1a..21fae4a8205 100644 --- a/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll +++ b/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll @@ -1,4 +1,5 @@ -; RUN: llc -O0 -relocation-model=pic < %s | not grep call +; RUN: llc -O0 -relocation-model=pic < %s | FileCheck %s +; CHECK-NOT: call ; rdar://8396318 ; Don't emit a PIC base register if no addresses are needed. diff --git a/test/CodeGen/X86/fast-isel-constpool.ll b/test/CodeGen/X86/fast-isel-constpool.ll index b3adb802a8c..bbbaeb23391 100644 --- a/test/CodeGen/X86/fast-isel-constpool.ll +++ b/test/CodeGen/X86/fast-isel-constpool.ll @@ -1,4 +1,6 @@ -; RUN: llc < %s -fast-isel | grep "LCPI0_0(%rip)" +; RUN: llc < %s -fast-isel | FileCheck %s +; CHECK: LCPI0_0(%rip) + ; Make sure fast isel uses rip-relative addressing when required. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-apple-darwin9.0" diff --git a/test/CodeGen/X86/fast-isel-fneg.ll b/test/CodeGen/X86/fast-isel-fneg.ll index f42a4a245bc..bd96ab95efe 100644 --- a/test/CodeGen/X86/fast-isel-fneg.ll +++ b/test/CodeGen/X86/fast-isel-fneg.ll @@ -1,5 +1,8 @@ ; RUN: llc < %s -fast-isel -fast-isel-abort -mtriple=x86_64-apple-darwin10 | FileCheck %s -; RUN: llc < %s -fast-isel -march=x86 -mattr=+sse2 | grep xor | count 2 +; RUN: llc < %s -fast-isel -march=x86 -mattr=+sse2 | FileCheck --check-prefix=SSE2 %s + +; SSE2: xor +; SSE2: xor ; CHECK: doo: ; CHECK: xor diff --git a/test/CodeGen/X86/fast-isel-gv.ll b/test/CodeGen/X86/fast-isel-gv.ll index cb2464e746b..de750956890 100644 --- a/test/CodeGen/X86/fast-isel-gv.ll +++ b/test/CodeGen/X86/fast-isel-gv.ll @@ -1,4 +1,6 @@ -; RUN: llc < %s -fast-isel | grep "_kill@GOTPCREL(%rip)" +; RUN: llc < %s -fast-isel | FileCheck %s +; CHECK: _kill@GOTPCREL(%rip) + target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-apple-darwin10.0" @f = global i8 (...)* @kill ; [#uses=1] diff --git a/test/CodeGen/X86/fast-isel-tailcall.ll b/test/CodeGen/X86/fast-isel-tailcall.ll index c3e527c4e5b..79ff79d4bca 100644 --- a/test/CodeGen/X86/fast-isel-tailcall.ll +++ b/test/CodeGen/X86/fast-isel-tailcall.ll @@ -1,4 +1,5 @@ -; RUN: llc < %s -fast-isel -tailcallopt -march=x86 | not grep add +; RUN: llc < %s -fast-isel -tailcallopt -march=x86 | FileCheck %s +; CHECK-NOT: add ; PR4154 ; On x86, -tailcallopt changes the ABI so the caller shouldn't readjust diff --git a/test/CodeGen/X86/fastcc-2.ll b/test/CodeGen/X86/fastcc-2.ll index d044a2ad9e8..e11cdd19723 100644 --- a/test/CodeGen/X86/fastcc-2.ll +++ b/test/CodeGen/X86/fastcc-2.ll @@ -1,5 +1,6 @@ -; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | grep movsd -; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | grep mov | count 1 +; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 | FileCheck %s +; CHECK: movsd +; CHECK-NOT: mov define i32 @foo() nounwind { entry: diff --git a/test/CodeGen/X86/fastcc-byval.ll b/test/CodeGen/X86/fastcc-byval.ll index f1204d677a5..08f4564fc69 100644 --- a/test/CodeGen/X86/fastcc-byval.ll +++ b/test/CodeGen/X86/fastcc-byval.ll @@ -1,4 +1,7 @@ -; RUN: llc < %s -tailcallopt=false | grep "movl[[:space:]]*8(%esp), %eax" | count 2 +; RUN: llc < %s -tailcallopt=false | FileCheck %s +; CHECK: movl 8(%esp), %eax +; CHECK: movl 8(%esp), %eax + ; PR3122 ; rdar://6400815 diff --git a/test/CodeGen/X86/fastcc-sret.ll b/test/CodeGen/X86/fastcc-sret.ll index d45741884c7..05705b9431b 100644 --- a/test/CodeGen/X86/fastcc-sret.ll +++ b/test/CodeGen/X86/fastcc-sret.ll @@ -1,4 +1,5 @@ -; RUN: llc < %s -march=x86 -tailcallopt=false | grep ret | not grep 4 +; RUN: llc < %s -march=x86 -tailcallopt=false | FileCheck %s +; CHECK: ret{{[^4]*$}} %struct.foo = type { [4 x i32] } diff --git a/test/CodeGen/X86/fastcc3struct.ll b/test/CodeGen/X86/fastcc3struct.ll index 84f8ef6cf36..e2c54ac8a13 100644 --- a/test/CodeGen/X86/fastcc3struct.ll +++ b/test/CodeGen/X86/fastcc3struct.ll @@ -1,7 +1,8 @@ ; RUN: llc < %s -march=x86 -o %t -; RUN: grep "movl .48, %ecx" %t -; RUN: grep "movl .24, %edx" %t -; RUN: grep "movl .12, %eax" %t +; RUN: FileCheck %s -input-file %t +; CHECK: movl {{.}}12, %eax +; CHECK: movl {{.}}24, %edx +; CHECK: movl {{.}}48, %ecx %0 = type { i32, i32, i32 } -- 2.34.1