llvm.org GIT mirror llvm / 39ac325
FileCheckize these tests. Add an extra test to ldr_post with an immediate increment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154859 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 7 years ago
2 changed file(s) with 23 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=arm | \
1 ; RUN: grep {ldr.*\\\[.*\],} | count 1
0 ; RUN: llc < %s -march=arm | FileCheck %s
21
3 define i32 @test(i32 %a, i32 %b, i32 %c) {
2 ; CHECK: test1:
3 ; CHECK: ldr {{.*, \[.*]}}, -r2
4 ; CHECK-NOT: ldr
5 define i32 @test1(i32 %a, i32 %b, i32 %c) {
46 %tmp1 = mul i32 %a, %b ; [#uses=2]
57 %tmp2 = inttoptr i32 %tmp1 to i32* ; [#uses=1]
68 %tmp3 = load i32* %tmp2 ; [#uses=1]
911 ret i32 %tmp5
1012 }
1113
14 ; CHECK: test2:
15 ; CHECK: ldr {{.*, \[.*\]}}, #-16
16 ; CHECK-NOT: ldr
17 define i32 @test2(i32 %a, i32 %b) {
18 %tmp1 = mul i32 %a, %b ; [#uses=2]
19 %tmp2 = inttoptr i32 %tmp1 to i32* ; [#uses=1]
20 %tmp3 = load i32* %tmp2 ; [#uses=1]
21 %tmp4 = sub i32 %tmp1, 16 ; [#uses=1]
22 %tmp5 = mul i32 %tmp4, %tmp3 ; [#uses=1]
23 ret i32 %tmp5
24 }
None ; RUN: llc < %s -march=arm | \
1 ; RUN: grep {ldr.*\\!} | count 2
0 ; RUN: llc < %s -march=arm | FileCheck %s
21
2 ; CHECK: test1:
3 ; CHECK: ldr {{.*!}}
4 ; CHECK-NOT: ldr
35 define i32* @test1(i32* %X, i32* %dest) {
46 %Y = getelementptr i32* %X, i32 4 ; [#uses=2]
57 %A = load i32* %Y ; [#uses=1]
79 ret i32* %Y
810 }
911
12 ; CHECK: test2:
13 ; CHECK: ldr {{.*!}}
14 ; CHECK-NOT: ldr
1015 define i32 @test2(i32 %a, i32 %b, i32 %c) {
1116 %tmp1 = sub i32 %a, %b ; [#uses=2]
1217 %tmp2 = inttoptr i32 %tmp1 to i32* ; [#uses=1]
1520 %tmp5 = add i32 %tmp4, %tmp3 ; [#uses=1]
1621 ret i32 %tmp5
1722 }
18