llvm.org GIT mirror llvm / 8838410
Rewrite X86 codegen regression test with FileCheck git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180776 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Liao 6 years ago
16 changed file(s) with 75 addition(s) and 34 deletion(s). Raw diff Collapse all Expand all
0 ; PR850
1 ; RUN: llc < %s -march=x86 -x86-asm-syntax=att > %t
2 ; RUN: grep "movl 4(%eax),%ebp" %t
3 ; RUN: grep "movl 0(%eax), %ebx" %t
1 ; RUN: llc < %s -march=x86 -x86-asm-syntax=att | FileCheck %s
2
3 ; CHECK: {{movl 4[(]%eax[)],%ebp}}
4 ; CHECK: {{movl 0[(]%eax[)], %ebx}}
45
56 define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
67 %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 ) ; [#uses=1]
None ; RUN: llc < %s -mcpu=yonah -march=x86 | \
1 ; RUN: grep "cmpltsd %xmm0, %xmm0"
0 ; RUN: llc < %s -mcpu=yonah -march=x86 | FileCheck %s
1
22 target datalayout = "e-p:32:32"
33 target triple = "i686-apple-darwin9"
44
5 ; CHECK: {{cmpltsd %xmm0, %xmm0}}
56
67 define void @acoshf() {
78 %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]
None ; RUN: llc < %s -march=x86 -mattr=+sse2
1 ; RUN: llc < %s -march=x86 -mattr=+sse2 | not grep punpckhwd
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
1
2 ; CHECK-NOT: punpckhwd
23
34 declare <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>)
45
None ; RUN: llc < %s -relocation-model=static | grep "foo str$"
0 ; RUN: llc < %s -relocation-model=static | FileCheck %s
11 ; PR1761
22 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"
33 target triple = "x86_64-pc-linux"
44 @str = internal constant [12 x i8] c"init/main.c\00" ; <[12 x i8]*> [#uses=1]
5
6 ; CHECK: {{foo str$}}
57
68 define i32 @unknown_bootoption() {
79 entry:
None ; RUN: llc < %s -march=x86 -o %t
1 ; RUN: not grep and %t
2 ; RUN: not grep shr %t
0 ; RUN: llc < %s -march=x86 | FileCheck %s
31 ; rdar://6661955
2
3 ; CHECK-NOT: and
4 ; CHECK-NOT: shr
45
56 @hello = internal constant [7 x i8] c"hello\0A\00"
67 @world = internal constant [7 x i8] c"world\0A\00"
None ; RUN: llc < %s -relocation-model=pic | grep atoi | grep PLT
0 ; RUN: llc < %s -relocation-model=pic | FileCheck %s
11 ; PR4253
22 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"
33 target triple = "x86_64-unknown-linux-gnu"
88 ret i32 %call
99 }
1010
11 ; CHECK: foo
12 ; CHECK: {{atoi.+PLT}}
13
1114 define available_externally fastcc i32 @atoi(i8* %__nptr) nounwind readonly {
1215 entry:
1316 %call = tail call i64 @strtol(i8* nocapture %__nptr, i8** null, i32 10) nounwind readonly ; [#uses=1]
None ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mattr=+mmx,+sse2 | not grep movl
0 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mattr=+mmx,+sse2 | FileCheck %s
1
2 ; CHECK-NOT: movl
13
24 define <8 x i8> @a(i8 zeroext %x) nounwind {
35 %r = insertelement <8 x i8> undef, i8 %x, i32 0
None ; RUN: llc < %s -mtriple=x86_64-pc-mingw64 | grep movabsq
0 ; RUN: llc < %s -mtriple=x86_64-pc-mingw64 | FileCheck %s
1
2 ; CHECK: movabsq
13
24 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"
35
None ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep "call.*12345678"
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep "call.*12345678"
2 ; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep "call.*12345678"
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | FileCheck -check-prefix X86STA %s
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | FileCheck -check-prefix X86PIC %s
2 ; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | FileCheck -check-prefix X86DYN %s
33
44 ; Call to immediate is not safe on x86-64 unless we *know* that the
55 ; call will be within 32-bits pcrel from the dest immediate.
66
7 ; RUN: llc < %s -march=x86-64 | grep "call.*\*%rax"
7 ; RUN: llc < %s -march=x86-64 | FileCheck -check-prefix X64 %s
88
99 ; PR3666
1010 ; PR3773
1515 %0 = call i32 inttoptr (i32 12345678 to i32 (i32)*)(i32 0) nounwind ; [#uses=1]
1616 ret i32 %0
1717 }
18
19 ; X86STA: {{call.*12345678}}
20 ; X86PIC-NOT: {{call.*12345678}}
21 ; X86DYN: {{call.*12345678}}
22 ; X64: {{call.*[*]%rax}}
None ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -relocation-model=static | not grep movaps
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -relocation-model=static | FileCheck %s
1
2 ; CHECK-NOT: movaps
13
24 @a = external global <2 x i64> ; <<2 x i64>*> [#uses=1]
35
None ; RUN: llc < %s -march=x86 | grep inc
1 ; RUN: llc < %s -march=x86 | grep add | grep 4
0 ; RUN: llc < %s -march=x86 | FileCheck %s
21
32 define i32 @test(i32 %X) nounwind {
43 entry:
65 ret i32 %0
76 }
87
8 ; CHECK: test
9 ; CHECK: inc
10 ; CHECK: ret
11
912 define i32 @test2(i32 %X) nounwind {
1013 entry:
1114 %0 = add i32 %X, 4
1215 ret i32 %0
1316 }
17
18 ; CHECK: test2
19 ; CHECK: {{add.*4.*$}}
20 ; CHECK: ret
0 ;; Test that this FP immediate is stored in the constant pool as a float.
11
2 ; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | \
3 ; RUN: grep ".long.1123418112"
2 ; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | FileCheck %s
3
4 ; CHECK: {{.long.1123418112}}
45
56 define double @D() {
67 ret double 1.230000e+02
None ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep "xorps.*sp" | count 1
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
11 ; PR2656
2
3 ; CHECK: {{xorps.*sp}}
4 ; CHECK-NOT: {{xorps.*sp}}
25
36 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"
47 target triple = "i686-apple-darwin9.4.0"
None ; RUN: llc < %s -march=x86-64 | grep movd | count 1
1 ; RUN: llc < %s -march=x86-64 | grep "movlhps.*%xmm0, %xmm0"
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
1
2 ; CHECK: test3
3 ; CHECK: movd
4 ; CHECK-NOT: movd
5 ; CHECK: {{movlhps.*%xmm0, %xmm0}}
6 ; CHECK-NEXT: ret
27
38 define <2 x i64> @test3(i64 %A) nounwind {
49 entry:
None ; RUN: llc < %s -march=x86 -mcpu=core2 -o %t
1 ; RUN: grep pshufb %t | count 1
0 ; RUN: llc < %s -march=x86 -mcpu=core2 | FileCheck %s
1
2 ; CHECK: pshufb
3 ; CHECK-NOT: pshufb
24
35 ; FIXME: this test has a superfluous punpcklqdq pre-pshufb currently.
46 ; Don't XFAIL it because it's still better than the previous code.
None ; RUN: llc < %s -march=x86 | not grep and
1 ; RUN: llc < %s -march=x86-64 > %t
2 ; RUN: not grep and %t
3 ; RUN: not grep movzbq %t
4 ; RUN: not grep movzwq %t
5 ; RUN: not grep movzlq %t
0 ; RUN: llc < %s -march=x86 | FileCheck -check-prefix=X86 %s
1 ; RUN: llc < %s -march=x86-64 | FileCheck -check-prefix=X64 %s
2
3 ; X86-NOT: and
4
5 ; X64-NOT: and
6 ; X64-NOT: movzbq
7 ; X64-NOT: movzwq
8 ; X64-NOT: movzlq
69
710 ; These should use movzbl instead of 'and 255'.
811 ; This related to not having a ZERO_EXTEND_REG opcode.