llvm.org GIT mirror llvm / bb34ce8
Test case micromips-load-effective-address.s renamed to micromips-load-effective-address.ll and moved to test/CodeGen/Mips. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199221 91177308-0d34-0410-b5e6-96231b3b80d8 Zoran Jovanovic 6 years ago
2 changed file(s) with 29 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc %s -march=mipsel -mattr=micromips -filetype=asm \
1 ; RUN: -relocation-model=pic -O3 -o - | FileCheck %s
2
3 define i32 @sum(i32* %x, i32* %y) nounwind uwtable {
4 entry:
5 %x.addr = alloca i32*, align 8
6 %y.addr = alloca i32*, align 8
7 store i32* %x, i32** %x.addr, align 8
8 store i32* %y, i32** %y.addr, align 8
9 %0 = load i32** %x.addr, align 8
10 %1 = load i32* %0, align 4
11 %2 = load i32** %y.addr, align 8
12 %3 = load i32* %2, align 4
13 %add = add nsw i32 %1, %3
14 ret i32 %add
15 }
16
17 define i32 @main() nounwind uwtable {
18 entry:
19 %retval = alloca i32, align 4
20 %x = alloca i32, align 4
21 %y = alloca i32, align 4
22 store i32 0, i32* %retval
23 %call = call i32 @sum(i32* %x, i32* %y)
24 ret i32 %call
25 }
26
27 ; CHECK: addiu ${{[0-9]+}}, $sp, {{[0-9]+}}
28 ; CHECK: addiu ${{[0-9]+}}, $sp, {{[0-9]+}}
+0
-29
test/MC/Mips/micromips-load-effective-address.s less more
None ; RUN: llc %s -march=mipsel -mattr=micromips -filetype=asm \
1 ; RUN: -relocation-model=pic -O3 -o - | FileCheck %s
2
3 define i32 @sum(i32* %x, i32* %y) nounwind uwtable {
4 entry:
5 %x.addr = alloca i32*, align 8
6 %y.addr = alloca i32*, align 8
7 store i32* %x, i32** %x.addr, align 8
8 store i32* %y, i32** %y.addr, align 8
9 %0 = load i32** %x.addr, align 8
10 %1 = load i32* %0, align 4
11 %2 = load i32** %y.addr, align 8
12 %3 = load i32* %2, align 4
13 %add = add nsw i32 %1, %3
14 ret i32 %add
15 }
16
17 define i32 @main() nounwind uwtable {
18 entry:
19 %retval = alloca i32, align 4
20 %x = alloca i32, align 4
21 %y = alloca i32, align 4
22 store i32 0, i32* %retval
23 %call = call i32 @sum(i32* %x, i32* %y)
24 ret i32 %call
25 }
26
27 ; CHECK: addiu ${{[0-9]+}}, $sp, {{[0-9]+}}
28 ; CHECK: addiu ${{[0-9]+}}, $sp, {{[0-9]+}}