llvm.org GIT mirror llvm / b935031
Fix the rest of the ARM failures by converting them to FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85208 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 10 years ago
7 changed file(s) with 74 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=arm | \
1 ; RUN: grep {mov r0, #0} | count 1
2 ; RUN: llc < %s -march=arm -mattr=+vfp2 | \
3 ; RUN: grep {flds.*\\\[} | count 1
4 ; RUN: llc < %s -march=arm -mattr=+vfp2 | \
5 ; RUN: grep {fsts.*\\\[} | count 1
0 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s
61
72 define float @f1(float %a) {
3 ; CHECK: f1:
4 ; CHECK: mov r0, #0
85 ret float 0.000000e+00
96 }
107
118 define float @f2(float* %v, float %u) {
9 ; CHECK: f2:
10 ; CHECK: flds{{.*}}[
1211 %tmp = load float* %v ; [#uses=1]
1312 %tmp1 = fadd float %tmp, %u ; [#uses=1]
1413 ret float %tmp1
1514 }
1615
1716 define void @f3(float %a, float %b, float* %v) {
17 ; CHECK: f3:
18 ; CHECK: fsts{{.*}}[
1819 %tmp = fadd float %a, %b ; [#uses=1]
1920 store float %tmp, float* %v
2021 ret void
None ; RUN: llc < %s -march=arm | grep {mov r0, r0, lsr #31}
0 ; RUN: llc < %s -march=arm | FileCheck %s
11
22 define i32 @test1(i32 %X) {
3 ; CHECK: mov r0, r0, lsr #31
34 entry:
45 icmp slt i32 %X, 0 ; :0 [#uses=1]
56 zext i1 %0 to i32 ; :1 [#uses=1]
None ; RUN: llc < %s -march=arm | \
1 ; RUN: grep ldmia | count 2
2 ; RUN: llc < %s -march=arm | \
3 ; RUN: grep ldmib | count 1
4 ; RUN: llc < %s -mtriple=arm-apple-darwin | \
5 ; RUN: grep {ldmfd sp\!} | count 3
0 ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
61
72 @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
83
94 define i32 @t1() {
5 ; CHECK: t1:
6 ; CHECK: ldmia
107 %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; [#uses=1]
118 %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1]
129 %tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; [#uses=1]
1411 }
1512
1613 define i32 @t2() {
14 ; CHECK: t2:
15 ; CHECK: ldmia
1716 %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1]
1817 %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1]
1918 %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; [#uses=1]
2221 }
2322
2423 define i32 @t3() {
24 ; CHECK: t3:
25 ; CHECK: ldmib
26 ; CHECK: ldmfd sp!
2527 %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1]
2628 %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1]
2729 %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1]
None ; RUN: llc < %s -march=arm | grep {ldr r0} | count 7
1 ; RUN: llc < %s -march=arm | grep mov | grep 1
2 ; RUN: llc < %s -march=arm | not grep mvn
3 ; RUN: llc < %s -march=arm | grep ldr | grep lsl
4 ; RUN: llc < %s -march=arm | grep ldr | grep lsr
0 ; RUN: llc < %s -march=arm | FileCheck %s
51
62 define i32 @f1(i32* %v) {
3 ; CHECK: f1:
4 ; CHECK: ldr r0
75 entry:
86 %tmp = load i32* %v
97 ret i32 %tmp
108 }
119
1210 define i32 @f2(i32* %v) {
11 ; CHECK: f2:
12 ; CHECK: ldr r0
1313 entry:
1414 %tmp2 = getelementptr i32* %v, i32 1023
1515 %tmp = load i32* %tmp2
1717 }
1818
1919 define i32 @f3(i32* %v) {
20 ; CHECK: f3:
21 ; CHECK: mov
22 ; CHECK: ldr r0
2023 entry:
2124 %tmp2 = getelementptr i32* %v, i32 1024
2225 %tmp = load i32* %tmp2
2427 }
2528
2629 define i32 @f4(i32 %base) {
30 ; CHECK: f4:
31 ; CHECK-NOT: mvn
32 ; CHECK: ldr r0
2733 entry:
2834 %tmp1 = sub i32 %base, 128
2935 %tmp2 = inttoptr i32 %tmp1 to i32*
3238 }
3339
3440 define i32 @f5(i32 %base, i32 %offset) {
41 ; CHECK: f5:
42 ; CHECK: ldr r0
3543 entry:
3644 %tmp1 = add i32 %base, %offset
3745 %tmp2 = inttoptr i32 %tmp1 to i32*
4048 }
4149
4250 define i32 @f6(i32 %base, i32 %offset) {
51 ; CHECK: f6:
52 ; CHECK: ldr r0{{.*}}lsl{{.*}}
4353 entry:
4454 %tmp1 = shl i32 %offset, 2
4555 %tmp2 = add i32 %base, %tmp1
4959 }
5060
5161 define i32 @f7(i32 %base, i32 %offset) {
62 ; CHECK: f7:
63 ; CHECK: ldr r0{{.*}}lsr{{.*}}
5264 entry:
5365 %tmp1 = lshr i32 %offset, 2
5466 %tmp2 = add i32 %base, %tmp1
None ; RUN: llc < %s -march=arm -asm-verbose | \
1 ; RUN: grep -- {-2147483648} | count 3
2 ; RUN: llc < %s -march=arm | grep mvn | count 3
3 ; RUN: llc < %s -march=arm | grep adds | count 1
4 ; RUN: llc < %s -march=arm | grep adc | count 1
5 ; RUN: llc < %s -march=arm | grep {subs } | count 1
6 ; RUN: llc < %s -march=arm | grep sbc | count 1
7 ; RUN: llc < %s -march=arm | \
8 ; RUN: grep smull | count 1
9 ; RUN: llc < %s -march=arm | \
10 ; RUN: grep umull | count 1
0 ; RUN: llc < %s -march=arm | FileCheck %s
111
122 define i64 @f1() {
3 ; CHECK: f1:
134 entry:
145 ret i64 0
156 }
167
178 define i64 @f2() {
9 ; CHECK: f2:
1810 entry:
1911 ret i64 1
2012 }
2113
2214 define i64 @f3() {
15 ; CHECK: f3:
16 ; CHECK: mvn{{.*}}-2147483648
2317 entry:
2418 ret i64 2147483647
2519 }
2620
2721 define i64 @f4() {
22 ; CHECK: f4:
23 ; CHECK: -2147483648
2824 entry:
2925 ret i64 2147483648
3026 }
3127
3228 define i64 @f5() {
29 ; CHECK: f5:
30 ; CHECK: mvn
31 ; CHECK: mvn{{.*}}-2147483648
3332 entry:
3433 ret i64 9223372036854775807
3534 }
3635
3736 define i64 @f6(i64 %x, i64 %y) {
37 ; CHECK: f6:
38 ; CHECK: adds
39 ; CHECK: adc
3840 entry:
3941 %tmp1 = add i64 %y, 1 ; [#uses=1]
4042 ret i64 %tmp1
4143 }
4244
4345 define void @f7() {
46 ; CHECK: f7:
4447 entry:
4548 %tmp = call i64 @f8( ) ; [#uses=0]
4649 ret void
4952 declare i64 @f8()
5053
5154 define i64 @f9(i64 %a, i64 %b) {
55 ; CHECK: f9:
56 ; CHECK: subs r
57 ; CHECK: sbc
5258 entry:
5359 %tmp = sub i64 %a, %b ; [#uses=1]
5460 ret i64 %tmp
5561 }
5662
5763 define i64 @f(i32 %a, i32 %b) {
64 ; CHECK: f:
65 ; CHECK: smull
5866 entry:
5967 %tmp = sext i32 %a to i64 ; [#uses=1]
6068 %tmp1 = sext i32 %b to i64 ; [#uses=1]
6371 }
6472
6573 define i64 @g(i32 %a, i32 %b) {
74 ; CHECK: g:
75 ; CHECK: umull
6676 entry:
6777 %tmp = zext i32 %a to i64 ; [#uses=1]
6878 %tmp1 = zext i32 %b to i64 ; [#uses=1]
7181 }
7282
7383 define i64 @f10() {
84 ; CHECK: f10:
7485 entry:
7586 %a = alloca i64, align 8 ; [#uses=1]
7687 %retval = load i64* %a ; [#uses=1]
7788 ret i64 %retval
7889 }
79
None ; RUN: llc < %s -march=arm | \
1 ; RUN: grep {strh .*\\\[.*\], #-4} | count 1
2 ; RUN: llc < %s -march=arm | \
3 ; RUN: grep {str .*\\\[.*\],} | count 1
0 ; RUN: llc < %s -march=arm | FileCheck %s
41
52 define i16 @test1(i32* %X, i16* %A) {
3 ; CHECK: test1:
4 ; CHECK: strh {{.*}}[{{.*}}], #-4
65 %Y = load i32* %X ; [#uses=1]
76 %tmp1 = trunc i32 %Y to i16 ; [#uses=1]
87 store i16 %tmp1, i16* %A
1211 }
1312
1413 define i32 @test2(i32* %X, i32* %A) {
14 ; CHECK: test2:
15 ; CHECK: str {{.*}}[{{.*}}],
1516 %Y = load i32* %X ; [#uses=1]
1617 store i32 %Y, i32* %A
1718 %tmp1 = ptrtoint i32* %A to i32 ; [#uses=1]
None ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {i(gottpoff)}
2 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
3 ; RUN: grep {ldr r., \[pc, r.\]}
4 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
5 ; RUN: -relocation-model=pic | grep {__tls_get_addr}
1 ; RUN: | FileCheck %s -check-prefix=CHECK-NONPIC
2 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
3 ; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECK-PIC
64
75 @i = external thread_local global i32 ; [#uses=2]
86
97 define i32 @f() {
8 ; CHECK-NONPIC: f:
9 ; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
10 ; CHECK-NONPIC: i(gottpoff)
11 ; CHECK-PIC: f:
12 ; CHECK-PIC: __tls_get_addr
1013 entry:
1114 %tmp1 = load i32* @i ; [#uses=1]
1215 ret i32 %tmp1
1316 }
1417
1518 define i32* @g() {
19 ; CHECK-NONPIC: g:
20 ; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
21 ; CHECK-NONPIC: i(gottpoff)
22 ; CHECK-PIC: g:
23 ; CHECK-PIC: __tls_get_addr
1624 entry:
1725 ret i32* @i
1826 }