1 ; RUN: llc -march=mipsel -mcpu=mips16 -mips16-hard-float -soft-float -relocation-model=static < %s | FileCheck %s -check-prefix=1 2 3 4 @i = common global i32 0, align 4 5 @j = common global i32 0, align 4 6 @.str = private unnamed_addr constant [8 x i8] c"%i %i \0A\00", align 1 7 8 define void @foo(i32* %p, i32 %i, i32 %j) nounwind { 9 entry: 10 %p.addr = alloca i32*, align 4 11 %i.addr = alloca i32, align 4 12 %j.addr = alloca i32, align 4 13 store i32* %p, i32** %p.addr, align 4 14 store i32 %i, i32* %i.addr, align 4 15 store i32 %j, i32* %j.addr, align 4 16 %0 = load i32* %j.addr, align 4 17 %1 = load i32** %p.addr, align 4 18 %2 = load i32* %i.addr, align 4 19 %add.ptr = getelementptr inbounds i32* %1, i32 %2 20 store i32 %0, i32* %add.ptr, align 4 21 ret void 22 } 23 24 define i32 @main() nounwind { 25 entry: 26 ; 1-LABEL: main: 27 ; 1: 1: .word -798000 28 ; 1: lw ${{[0-9]+}}, 1f 29 ; 1: b 2f 30 ; 1: .align 2 31 ; 1: .word 800020 32 33 ; 1: b 2f 34 ; 1: .align 2 35 ; 1: .word 400020 36 37 ; 1: move ${{[0-9]+}}, $sp 38 ; 1: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}} 39 ; 1: addiu ${{[0-9]+}}, ${{[0-9]+}}, 0 40 41 42 43 ; 1: b 2f 44 ; 1: .align 2 45 ; 1: .word 400220 46 47 ; 1: move ${{[0-9]+}}, $sp 48 ; 1: addu ${{[0-9]+}}, ${{[0-9]+}}, ${{[0-9]+}} 49 ; 1: lw ${{[0-9]+}}, 0(${{[0-9]+}}) 50 51 52 53 54 %retval = alloca i32, align 4 55 %one = alloca [100000 x i32], align 4 56 %two = alloca [100000 x i32], align 4 57 store i32 0, i32* %retval 58 %arrayidx = getelementptr inbounds [100000 x i32]* %one, i32 0, i32 0 59 call void @foo(i32* %arrayidx, i32 50, i32 9999) 60 %arrayidx1 = getelementptr inbounds [100000 x i32]* %two, i32 0, i32 0 61 call void @foo(i32* %arrayidx1, i32 99999, i32 5555) 62 %arrayidx2 = getelementptr inbounds [100000 x i32]* %one, i32 0, i32 50 63 %0 = load i32* %arrayidx2, align 4 64 store i32 %0, i32* @i, align 4 65 %arrayidx3 = getelementptr inbounds [100000 x i32]* %two, i32 0, i32 99999 66 %1 = load i32* %arrayidx3, align 4 67 store i32 %1, i32* @j, align 4 68 %2 = load i32* @i, align 4 69 %3 = load i32* @j, align 4 70 %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), i32 %2, i32 %3) 71 ret i32 0 72 } 73 74 declare i32 @printf(i8*, ...) 75