blob: ac6685dd552463010557a0a4acbf9443430b2cd4 [file] [log] [blame]
Daniel Sanders8008de52015-10-15 14:34:23 +00001; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=16
Reed Kotlerf662cff2013-02-13 20:28:27 +00002
3@i = global i32 25, align 4
4@.str = private unnamed_addr constant [5 x i8] c"%i \0A\00", align 1
5
6define void @p(i32* %i) nounwind {
7entry:
8 ret void
9}
10
11
12define void @foo() nounwind {
13entry:
14 %y = alloca [512 x i32], align 4
15 %x = alloca i32, align 8
16 %zz = alloca i32, align 4
17 %z = alloca i32, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000018 %0 = load i32, i32* @i, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000019 %arrayidx = getelementptr inbounds [512 x i32], [512 x i32]* %y, i32 0, i32 10
Reed Kotlerf662cff2013-02-13 20:28:27 +000020 store i32 %0, i32* %arrayidx, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000021 %1 = load i32, i32* @i, align 4
Reed Kotlerf662cff2013-02-13 20:28:27 +000022 store i32 %1, i32* %x, align 8
23 call void @p(i32* %x)
David Blaikie79e6c742015-02-27 19:29:02 +000024 %arrayidx1 = getelementptr inbounds [512 x i32], [512 x i32]* %y, i32 0, i32 10
Reed Kotlerf662cff2013-02-13 20:28:27 +000025 call void @p(i32* %arrayidx1)
26 ret void
27}
Reed Kotler5c29d632013-12-15 20:49:30 +000028; 16: save $ra, 2040
29; 16: addiu $sp, -40 # 16 bit inst
30; 16: addiu $sp, 40 # 16 bit inst
31; 16: restore $ra, 2040