1 ; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck %s
3 %struct.S = type <{ [4 x float] }>
4 %struct.S2 = type <{ [4 x double] }>
5 %struct.S3 = type <{ i8, float }>
7 @s = external global [4 x %struct.S]
8 @gf = external global float
9 @gd = external global double
10 @s2 = external global [4 x %struct.S2]
11 @s3 = external global %struct.S3
13 define float @foo0(float* nocapture %b, i32 %o) nounwind readonly {
16 %arrayidx = getelementptr inbounds float* %b, i32 %o
17 %0 = load float* %arrayidx, align 4
21 define double @foo1(double* nocapture %b, i32 %o) nounwind readonly {
24 %arrayidx = getelementptr inbounds double* %b, i32 %o
25 %0 = load double* %arrayidx, align 8
29 define float @foo2(i32 %b, i32 %c) nounwind readonly {
32 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
33 %0 = load float* %arrayidx1, align 1
37 define void @foo3(float* nocapture %b, i32 %o) nounwind {
40 %0 = load float* @gf, align 4
41 %arrayidx = getelementptr inbounds float* %b, i32 %o
42 store float %0, float* %arrayidx, align 4
46 define void @foo4(double* nocapture %b, i32 %o) nounwind {
49 %0 = load double* @gd, align 8
50 %arrayidx = getelementptr inbounds double* %b, i32 %o
51 store double %0, double* %arrayidx, align 8
55 define void @foo5(i32 %b, i32 %c) nounwind {
58 %0 = load float* @gf, align 4
59 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
60 store float %0, float* %arrayidx1, align 1
64 define double @foo6(i32 %b, i32 %c) nounwind readonly {
68 %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
69 %0 = load double* %arrayidx1, align 1
73 define void @foo7(i32 %b, i32 %c) nounwind {
77 %0 = load double* @gd, align 8
78 %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
79 store double %0, double* %arrayidx1, align 1
83 define float @foo8() nounwind readonly {
87 %0 = load float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1
91 define void @foo9(float %f) nounwind {
95 store float %f, float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1