[llvm] r180776 - Rewrite X86 codegen regression test with FileCheck

Eric Christopher echristo at gmail.com
Tue Apr 30 04:33:06 PDT 2013


Thanks!

-eric

2013/4/30 Michael Liao <michael.liao at intel.com>:
> Author: hliao
> Date: Tue Apr 30 02:51:08 2013
> New Revision: 180776
>
> URL: http://llvm.org/viewvc/llvm-project?rev=180776&view=rev
> Log:
> Rewrite X86 codegen regression test with FileCheck
>
>
> Modified:
>     llvm/trunk/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
>     llvm/trunk/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
>     llvm/trunk/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll
>     llvm/trunk/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
>     llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll
>     llvm/trunk/test/CodeGen/X86/2009-05-23-available_externally.ll
>     llvm/trunk/test/CodeGen/X86/2009-06-05-ScalarToVectorByteMMX.ll
>     llvm/trunk/test/CodeGen/X86/2009-08-08-CastError.ll
>     llvm/trunk/test/CodeGen/X86/call-imm.ll
>     llvm/trunk/test/CodeGen/X86/commute-intrinsic.ll
>     llvm/trunk/test/CodeGen/X86/fold-imm.ll
>     llvm/trunk/test/CodeGen/X86/fp-immediate-shorten.ll
>     llvm/trunk/test/CodeGen/X86/pr2656.ll
>     llvm/trunk/test/CodeGen/X86/vec_set-9.ll
>     llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll
>     llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll
>
> Modified: llvm/trunk/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-07-31-SingleRegClass.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2006-07-31-SingleRegClass.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2006-07-31-SingleRegClass.ll Tue Apr 30 02:51:08 2013
> @@ -1,7 +1,8 @@
>  ; PR850
> -; RUN: llc < %s -march=x86 -x86-asm-syntax=att > %t
> -; RUN: grep "movl 4(%eax),%ebp" %t
> -; RUN: grep "movl 0(%eax), %ebx" %t
> +; RUN: llc < %s -march=x86 -x86-asm-syntax=att | FileCheck %s
> +
> +; CHECK: {{movl 4[(]%eax[)],%ebp}}
> +; CHECK: {{movl 0[(]%eax[)], %ebx}}
>
>  define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
>         %tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint  $$0x80\0Apop  %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i )              ; <i32> [#uses=1]
>
> Modified: llvm/trunk/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll Tue Apr 30 02:51:08 2013
> @@ -1,8 +1,9 @@
> -; RUN: llc < %s -mcpu=yonah -march=x86 | \
> -; RUN:   grep "cmpltsd %xmm0, %xmm0"
> +; RUN: llc < %s -mcpu=yonah -march=x86 | FileCheck %s
> +
>  target datalayout = "e-p:32:32"
>  target triple = "i686-apple-darwin9"
>
> +; CHECK: {{cmpltsd %xmm0, %xmm0}}
>
>  define void @acoshf() {
>         %tmp19 = tail call <2 x double> asm sideeffect "pcmpeqd $0, $0 \0A\09 cmpltsd $0, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"( <2 x double> zeroinitializer )               ; <<2 x double>> [#uses=0]
>
> Modified: llvm/trunk/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2007-05-17-ShuffleISelBug.ll Tue Apr 30 02:51:08 2013
> @@ -1,5 +1,6 @@
> -; RUN: llc < %s -march=x86 -mattr=+sse2
> -; RUN: llc < %s -march=x86 -mattr=+sse2 | not grep punpckhwd
> +; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
> +
> +; CHECK-NOT: punpckhwd
>
>  declare <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>)
>
>
> Modified: llvm/trunk/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll Tue Apr 30 02:51:08 2013
> @@ -1,9 +1,11 @@
> -; RUN: llc < %s -relocation-model=static | grep "foo str$"
> +; RUN: llc < %s -relocation-model=static | FileCheck %s
>  ; PR1761
>  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-pc-linux"
>  @str = internal constant [12 x i8] c"init/main.c\00"           ; <[12 x i8]*> [#uses=1]
>
> +; CHECK: {{foo str$}}
> +
>  define i32 @unknown_bootoption() {
>  entry:
>         tail call void asm sideeffect "foo ${0:c}\0A", "i,~{dirflag},~{fpsr},~{flags}"( i8* getelementptr ([12 x i8]* @str, i32 0, i64 0) )
>
> Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Tue Apr 30 02:51:08 2013
> @@ -1,8 +1,9 @@
> -; RUN: llc < %s -march=x86 -o %t
> -; RUN: not grep and %t
> -; RUN: not grep shr %t
> +; RUN: llc < %s -march=x86 | FileCheck %s
>  ; rdar://6661955
>
> +; CHECK-NOT: and
> +; CHECK-NOT: shr
> +
>  @hello = internal constant [7 x i8] c"hello\0A\00"
>  @world = internal constant [7 x i8] c"world\0A\00"
>
>
> Modified: llvm/trunk/test/CodeGen/X86/2009-05-23-available_externally.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-05-23-available_externally.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2009-05-23-available_externally.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2009-05-23-available_externally.ll Tue Apr 30 02:51:08 2013
> @@ -1,4 +1,4 @@
> -; RUN: llc < %s -relocation-model=pic | grep atoi | grep PLT
> +; RUN: llc < %s -relocation-model=pic | FileCheck %s
>  ; PR4253
>  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-f80:128:128"
>  target triple = "x86_64-unknown-linux-gnu"
> @@ -9,6 +9,9 @@ entry:
>         ret i32 %call
>  }
>
> +; CHECK: foo
> +; CHECK: {{atoi.+PLT}}
> +
>  define available_externally fastcc i32 @atoi(i8* %__nptr) nounwind readonly {
>  entry:
>         %call = tail call i64 @strtol(i8* nocapture %__nptr, i8** null, i32 10) nounwind readonly               ; <i64> [#uses=1]
>
> Modified: llvm/trunk/test/CodeGen/X86/2009-06-05-ScalarToVectorByteMMX.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-06-05-ScalarToVectorByteMMX.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2009-06-05-ScalarToVectorByteMMX.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2009-06-05-ScalarToVectorByteMMX.ll Tue Apr 30 02:51:08 2013
> @@ -1,4 +1,6 @@
> -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mattr=+mmx,+sse2 | not grep movl
> +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mattr=+mmx,+sse2 | FileCheck %s
> +
> +; CHECK-NOT: movl
>
>  define <8 x i8> @a(i8 zeroext %x) nounwind {
>    %r = insertelement <8 x i8> undef, i8 %x, i32 0
>
> Modified: llvm/trunk/test/CodeGen/X86/2009-08-08-CastError.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-08-08-CastError.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2009-08-08-CastError.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2009-08-08-CastError.ll Tue Apr 30 02:51:08 2013
> @@ -1,4 +1,6 @@
> -; RUN: llc < %s -mtriple=x86_64-pc-mingw64 | grep movabsq
> +; RUN: llc < %s -mtriple=x86_64-pc-mingw64 | FileCheck %s
> +
> +; CHECK: movabsq
>
>  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"
>
>
> Modified: llvm/trunk/test/CodeGen/X86/call-imm.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/call-imm.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/call-imm.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/call-imm.ll Tue Apr 30 02:51:08 2013
> @@ -1,11 +1,11 @@
> -; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep "call.*12345678"
> -; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep "call.*12345678"
> -; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep "call.*12345678"
> +; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | FileCheck -check-prefix X86STA %s
> +; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | FileCheck -check-prefix X86PIC %s
> +; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | FileCheck -check-prefix X86DYN %s
>
>  ; Call to immediate is not safe on x86-64 unless we *know* that the
>  ; call will be within 32-bits pcrel from the dest immediate.
>
> -; RUN: llc < %s -march=x86-64 | grep "call.*\*%rax"
> +; RUN: llc < %s -march=x86-64 | FileCheck -check-prefix X64 %s
>
>  ; PR3666
>  ; PR3773
> @@ -16,3 +16,8 @@ entry:
>         %0 = call i32 inttoptr (i32 12345678 to i32 (i32)*)(i32 0) nounwind             ; <i32> [#uses=1]
>         ret i32 %0
>  }
> +
> +; X86STA: {{call.*12345678}}
> +; X86PIC-NOT: {{call.*12345678}}
> +; X86DYN: {{call.*12345678}}
> +; X64: {{call.*[*]%rax}}
>
> Modified: llvm/trunk/test/CodeGen/X86/commute-intrinsic.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/commute-intrinsic.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/commute-intrinsic.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/commute-intrinsic.ll Tue Apr 30 02:51:08 2013
> @@ -1,4 +1,6 @@
> -; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -relocation-model=static | not grep movaps
> +; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -relocation-model=static | FileCheck %s
> +
> +; CHECK-NOT: movaps
>
>  @a = external global <2 x i64>         ; <<2 x i64>*> [#uses=1]
>
>
> Modified: llvm/trunk/test/CodeGen/X86/fold-imm.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fold-imm.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fold-imm.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fold-imm.ll Tue Apr 30 02:51:08 2013
> @@ -1,5 +1,4 @@
> -; RUN: llc < %s -march=x86 | grep inc
> -; RUN: llc < %s -march=x86 | grep add | grep 4
> +; RUN: llc < %s -march=x86 | FileCheck %s
>
>  define i32 @test(i32 %X) nounwind {
>  entry:
> @@ -7,8 +6,16 @@ entry:
>         ret i32 %0
>  }
>
> +; CHECK: test
> +; CHECK: inc
> +; CHECK: ret
> +
>  define i32 @test2(i32 %X) nounwind {
>  entry:
>         %0 = add i32 %X, 4
>         ret i32 %0
>  }
> +
> +; CHECK: test2
> +; CHECK: {{add.*4.*$}}
> +; CHECK: ret
>
> Modified: llvm/trunk/test/CodeGen/X86/fp-immediate-shorten.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fp-immediate-shorten.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/fp-immediate-shorten.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/fp-immediate-shorten.ll Tue Apr 30 02:51:08 2013
> @@ -1,7 +1,8 @@
>  ;; Test that this FP immediate is stored in the constant pool as a float.
>
> -; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | \
> -; RUN:   grep ".long.1123418112"
> +; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | FileCheck %s
> +
> +; CHECK: {{.long.1123418112}}
>
>  define double @D() {
>          ret double 1.230000e+02
>
> Modified: llvm/trunk/test/CodeGen/X86/pr2656.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2656.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/pr2656.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/pr2656.ll Tue Apr 30 02:51:08 2013
> @@ -1,6 +1,9 @@
> -; RUN: llc < %s -march=x86 -mattr=+sse2 | grep "xorps.*sp" | count 1
> +; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
>  ; PR2656
>
> +; CHECK:     {{xorps.*sp}}
> +; CHECK-NOT: {{xorps.*sp}}
> +
>  target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
>  target triple = "i686-apple-darwin9.4.0"
>         %struct.anon = type <{ float, float }>
>
> Modified: llvm/trunk/test/CodeGen/X86/vec_set-9.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-9.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/vec_set-9.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/vec_set-9.ll Tue Apr 30 02:51:08 2013
> @@ -1,5 +1,10 @@
> -; RUN: llc < %s -march=x86-64 | grep movd | count 1
> -; RUN: llc < %s -march=x86-64 | grep "movlhps.*%xmm0, %xmm0"
> +; RUN: llc < %s -march=x86-64 | FileCheck %s
> +
> +; CHECK: test3
> +; CHECK: movd
> +; CHECK-NOT: movd
> +; CHECK: {{movlhps.*%xmm0, %xmm0}}
> +; CHECK-NEXT: ret
>
>  define <2 x i64> @test3(i64 %A) nounwind {
>  entry:
>
> Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll Tue Apr 30 02:51:08 2013
> @@ -1,5 +1,7 @@
> -; RUN: llc < %s -march=x86 -mcpu=core2 -o %t
> -; RUN: grep pshufb %t | count 1
> +; RUN: llc < %s -march=x86 -mcpu=core2 | FileCheck %s
> +
> +; CHECK:     pshufb
> +; CHECK-NOT: pshufb
>
>  ; FIXME: this test has a superfluous punpcklqdq pre-pshufb currently.
>  ;        Don't XFAIL it because it's still better than the previous code.
>
> Modified: llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll?rev=180776&r1=180775&r2=180776&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/zext-inreg-0.ll Tue Apr 30 02:51:08 2013
> @@ -1,9 +1,12 @@
> -; RUN: llc < %s -march=x86 | not grep and
> -; RUN: llc < %s -march=x86-64 > %t
> -; RUN: not grep and %t
> -; RUN: not grep movzbq %t
> -; RUN: not grep movzwq %t
> -; RUN: not grep movzlq %t
> +; RUN: llc < %s -march=x86 | FileCheck -check-prefix=X86 %s
> +; RUN: llc < %s -march=x86-64 | FileCheck -check-prefix=X64 %s
> +
> +; X86-NOT: and
> +
> +; X64-NOT: and
> +; X64-NOT: movzbq
> +; X64-NOT: movzwq
> +; X64-NOT: movzlq
>
>  ; These should use movzbl instead of 'and 255'.
>  ; This related to not having a ZERO_EXTEND_REG opcode.
>
>
> _______________________________________________
> 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