[llvm] r179241 - Rewrite some of the test/CodeGen/X86 tests to use FileCheck instead of grep

Reid Kleckner rnk at google.com
Wed Apr 10 16:58:59 PDT 2013


On Wed, Apr 10, 2013 at 4:30 PM, Eli Bendersky <eliben at google.com> wrote:
> Author: eliben
> Date: Wed Apr 10 18:30:20 2013
> New Revision: 179241
>
> URL: http://llvm.org/viewvc/llvm-project?rev=179241&view=rev
> Log:
> Rewrite some of the test/CodeGen/X86 tests to use FileCheck instead of grep
>
>
> Modified:
>     llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
>     llvm/trunk/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
>     llvm/trunk/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll
>     llvm/trunk/test/CodeGen/X86/fast-isel-constpool.ll
>     llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll
>     llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll
>     llvm/trunk/test/CodeGen/X86/fast-isel-tailcall.ll
>     llvm/trunk/test/CodeGen/X86/fastcc-2.ll
>     llvm/trunk/test/CodeGen/X86/fastcc-byval.ll
>     llvm/trunk/test/CodeGen/X86/fastcc-sret.ll
>     llvm/trunk/test/CodeGen/X86/fastcc3struct.ll
>
> Modified: llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll Wed Apr 10 18:30:20 2013
> @@ -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
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-cc-merge-stack-adj.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-cc-merge-stack-adj.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-cc-merge-stack-adj.ll Wed Apr 10 18:30:20 2013
> @@ -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"
>
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-isel-avoid-unnecessary-pic-base.ll Wed Apr 10 18:30:20 2013
> @@ -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.
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-isel-constpool.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-constpool.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-isel-constpool.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-isel-constpool.ll Wed Apr 10 18:30:20 2013
> @@ -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"
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll Wed Apr 10 18:30:20 2013
> @@ -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

To be perfectly pedantic, to match | count 2 you have to do a SSE2-NOT: xor

>  ; CHECK: doo:
>  ; CHECK: xor
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll Wed Apr 10 18:30:20 2013
> @@ -1,4 +1,6 @@
> -; RUN: llc < %s -fast-isel | grep "_kill at GOTPCREL(%rip)"
> +; RUN: llc < %s -fast-isel | FileCheck %s
> +; CHECK: _kill at 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            ; <i8 (...)**> [#uses=1]
>
> Modified: llvm/trunk/test/CodeGen/X86/fast-isel-tailcall.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-tailcall.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fast-isel-tailcall.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fast-isel-tailcall.ll Wed Apr 10 18:30:20 2013
> @@ -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
>
> Modified: llvm/trunk/test/CodeGen/X86/fastcc-2.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc-2.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fastcc-2.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fastcc-2.ll Wed Apr 10 18:30:20 2013
> @@ -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:
>
> Modified: llvm/trunk/test/CodeGen/X86/fastcc-byval.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc-byval.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fastcc-byval.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fastcc-byval.ll Wed Apr 10 18:30:20 2013
> @@ -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
>
>
> Modified: llvm/trunk/test/CodeGen/X86/fastcc-sret.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc-sret.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fastcc-sret.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fastcc-sret.ll Wed Apr 10 18:30:20 2013
> @@ -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] }
>
>
> Modified: llvm/trunk/test/CodeGen/X86/fastcc3struct.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastcc3struct.ll?rev=179241&r1=179240&r2=179241&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fastcc3struct.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fastcc3struct.ll Wed Apr 10 18:30:20 2013
> @@ -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 }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list