llvm.org GIT mirror llvm / 26ebdd1
Rewrite some tests with FileCHeck in X86 codegen - Revise previous patches of the same purpose by fixing *) grep <PA> | not grep <PB> semantically is not the same as CHECK: <PA>{{^<PB>.*$}} as the former will check all occurrences of <PA> while the later only check the first match. As the result, CHECK needs putting in all place where <PA> occurs. *) grep <PA> | count <N> needs a final CHECK-NOT of the same pattern. (As 'CHECK-<N>' is proposed for discussion, converting 'grep | count <N>' where N > 1 is postponed.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180742 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Liao 6 years ago
20 changed file(s) with 85 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | grep inc | not grep PTR
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | FileCheck %s
1
2 ; CHECK: inc
3 ; CHECK-NOT: PTR
4 ; CHECK: {{$}}
15
26 define signext i16 @t(i32* %bitptr, i32* %source, i8** %byteptr, i32 %scale, i32 %round) {
37 entry:
None ; RUN: llc < %s | grep "a:" | not grep ax
1 ; RUN: llc < %s | grep "b:" | not grep ax
0 ; RUN: llc < %s | FileCheck %s
21 ; PR2078
32 ; The clobber list says that "ax" is clobbered. Make sure that eax isn't
43 ; allocated to the input/output register.
1413 ret void
1514 }
1615
16 ; CHECK: a:
17 ; CHECK-NOT: ax
18 ; CHECK: {{$}}
19
1720 define void @test2(i16* %block, i8* %pixels, i32 %line_size) nounwind {
1821 entry:
1922 %tmp1 = getelementptr i16* %block, i32 64 ; [#uses=1]
2124 ret void
2225 }
2326
27 ; CHECK: b:
28 ; CHECK-NOT: ax
29 ; CHECK: {{$}}
None ; RUN: llc < %s -mtriple=i386-apple-darwin | grep testb
0 ; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s
1
2 ; CHECK: testb
13
24 ; ModuleID = ''
35 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"
None ; RUN: llc < %s -relocation-model=static > %t
1 ; RUN: grep "1: ._pv_cpu_ops+8" %t
2 ; RUN: grep "2: ._G" %t
0 ; RUN: llc < %s -relocation-model=static | FileCheck %s
31 ; PR4152
2
3 ; CHECK: {{1: ._pv_cpu_ops[+]8}}
4 ; CHECK: {{2: ._G}}
45
56 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"
67 target triple = "i386-apple-darwin9.6"
0 ; RUN: llc < %s -tailcallopt=false | FileCheck %s
11 ; CHECK: movl 8(%esp), %eax
22 ; CHECK: movl 8(%esp), %eax
3 ; CHECK-NOT: movl 8(%esp), %eax
34
45 ; PR3122
56 ; rdar://6400815
0 ; RUN: llc < %s -march=x86 -tailcallopt=false | FileCheck %s
1 ; CHECK: ret{{[^4]*$}}
21
32 %struct.foo = type { [4 x i32] }
43
98 store i32 1, i32* %tmp3, align 8
109 ret void
1110 }
11 ; CHECK: bar
12 ; CHECK: ret{{[^4]*$}}
1213
1314 @dst = external global i32
1415
2122 store i32 %tmp6, i32* @dst
2223 ret void
2324 }
25 ; CHECK: foo
26 ; CHECK: ret{{[^4]*$}}
None ; RUN: llc < %s -march=x86 -o %t
1 ; RUN: FileCheck %s -input-file %t
0 ; RUN: llc < %s -march=x86 | FileCheck %s
1
22 ; CHECK: movl {{.}}12, %eax
33 ; CHECK: movl {{.}}24, %edx
44 ; CHECK: movl {{.}}48, %ecx
None ; RUN: llc < %s -march=x86 | grep fild | not grep ESP
0 ; RUN: llc < %s -march=x86 | FileCheck %s
11
22 define double @short(i16* %P) {
33 %V = load i16* %P ; [#uses=1]
1717 ret double %V2
1818 }
1919
20 ; CHECK: long
21 ; CHECK: fild
22 ; CHECK-NOT: ESP
23 ; CHECK-NOT: esp
24 ; CHECK: {{$}}
25 ; CHECK: ret
None ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=corei7 | grep pinsr
0 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=corei7 | FileCheck %s
11 ; PR2562
2
3 ; CHECK: pinsr
24
35 external global i16 ; :0 [#uses=1]
46 external global <4 x i16> ; <<4 x i16>*>:1 [#uses=2]
None ; RUN: llc < %s -march=x86 | grep testl
0 ; RUN: llc < %s -march=x86 | FileCheck %s
1
2 ; CHECK: testl
13
24 ; It's tempting to eliminate the testl instruction here and just use the
35 ; EFLAGS value from the incl, however it can't be known whether the add
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | grep L__ZZ20
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s
11 ; Quote should be outside of private prefix.
22 ; rdar://6855766x
3
4 ; CHECK: L__ZZ20
35
46 %struct.A = type { i32*, i32 }
57 @"_ZZ20-[Example1 whatever]E4C.91" = private constant %struct.A { i32* null, i32 1 } ; <%struct.A*> [#uses=1]
None ; RUN: llc < %s -march=x86 | not grep rodata
1 ; RUN: llc < %s -march=x86 | not grep literal
0 ; RUN: llc < %s -march=x86 | FileCheck %s
1
2 ; CHECK-NOT: rodata
3 ; CHECK-NOT: literal
4
25 ;
36 ; Check that no FP constants in this testcase ends up in the
47 ; constant pool.
None ; RUN: llc < %s -march=x86-64 | grep "leal .*), %e.*" | count 1
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
1
2 ; CHECK: {{leal .*[)], %e.*}}
3 ; CHECK-NOT: {{leal .*[)], %e.*}}
14
25 ; Don't eliminate or coalesce away the explicit zero-extension!
36 ; This is currently using an leal because of a 3-addressification detail,
None ; RUN: llc < %s -march=x86-64 | grep imull
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
1
2 ; CHECK: imull
13
24 ; Don't eliminate or coalesce away the explicit zero-extension!
35
0 ; PR925
1 ; RUN: llc < %s -march=x86 | \
2 ; RUN: grep mov.*str1 | count 1
1 ; RUN: llc < %s -march=x86 | FileCheck %s
2
3 ; CHECK: {{mov.*str1}}
4 ; CHECK-NOT: {{mov.*str1}}
35
46 target datalayout = "e-p:32:32"
57 target triple = "i686-apple-darwin8.7.2"
None ; RUN: llc < %s -march=x86 -mattr=+sse | grep movaps
0 ; RUN: llc < %s -march=x86 -mattr=+sse | FileCheck %s
1
2 ; CHECK: movaps
13
24 define <4 x float> @foo() {
35 ret <4 x float>
None ; RUN: llc < %s -march=x86 -mattr=+sse2 | not grep movaps
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
11 ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep esp | count 2
2
3 ; CHECK-NOT: movaps
24
35 ; These should both generate something like this:
46 ;_test3:
None ; RUN: llc < %s -relocation-model=static -march=x86 -mcpu=yonah | grep xorps | count 1
1 ; RUN: llc < %s -relocation-model=static -march=x86 -mcpu=yonah | grep pcmpeqd | count 1
0 ; RUN: llc < %s -relocation-model=static -march=x86 -mcpu=yonah | FileCheck %s
1 ; RUN: llc < %s -relocation-model=static -march=x86 -mcpu=yonah | FileCheck -check-prefix CHECK2 %s
22 ; 64-bit stores here do not use MMX.
3
4 ; CHECK: xorps
5 ; CHECK-NOT: xorps
6
7 ; CHECK2: pcmpeqd
8 ; CHECK2-NOT: pcmpeqd
39
410 @M1 = external global <1 x i64>
511 @M2 = external global <2 x i32>
None ; RUN: llc < %s -march=x86-64 | grep movq | grep rbp
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
1
2 ; CHECK: stack_end_address
3 ; CHECK: {{movq.+rbp.*$}}
4 ; CHECK: {{movq.+rbp.*$}}
5 ; CHECK: ret
16
27 define i64* @stack_end_address() nounwind {
38 entry:
None ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep "callq f" %t1
2 ; RUN: not grep "callq f@PLT" %t1
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic | FileCheck %s
1
2
3 ; CHECK-NOT: {{callq f@PLT}}
4 ; CHECK: {{callq f}}
5 ; CHECK-NOT: {{callq f@PLT}}
36
47 define void @g() {
58 entry: