1 ; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck %s
2 ; RUN: llc -mtriple=mipsel-none-nacl-gnu -mcpu=mips32r2 < %s \
3 ; RUN: | FileCheck %s -check-prefix=CHECK-NACL
5 %struct.S = type <{ [4 x float] }>
6 %struct.S2 = type <{ [4 x double] }>
7 %struct.S3 = type <{ i8, float }>
9 @s = external global [4 x %struct.S]
10 @gf = external global float
11 @gd = external global double
12 @s2 = external global [4 x %struct.S2]
13 @s3 = external global %struct.S3
15 define float @foo0(float* nocapture %b, i32 %o) nounwind readonly {
18 ; CHECK-NACL-NOT: lwxc1
19 %arrayidx = getelementptr inbounds float* %b, i32 %o
20 %0 = load float* %arrayidx, align 4
24 define double @foo1(double* nocapture %b, i32 %o) nounwind readonly {
27 ; CHECK-NACL-NOT: ldxc1
28 %arrayidx = getelementptr inbounds double* %b, i32 %o
29 %0 = load double* %arrayidx, align 8
33 define float @foo2(i32 %b, i32 %c) nounwind readonly {
36 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
37 %0 = load float* %arrayidx1, align 1
41 define void @foo3(float* nocapture %b, i32 %o) nounwind {
44 ; CHECK-NACL-NOT: swxc1
45 %0 = load float* @gf, align 4
46 %arrayidx = getelementptr inbounds float* %b, i32 %o
47 store float %0, float* %arrayidx, align 4
51 define void @foo4(double* nocapture %b, i32 %o) nounwind {
54 ; CHECK-NACL-NOT: sdxc1
55 %0 = load double* @gd, align 8
56 %arrayidx = getelementptr inbounds double* %b, i32 %o
57 store double %0, double* %arrayidx, align 8
61 define void @foo5(i32 %b, i32 %c) nounwind {
64 %0 = load float* @gf, align 4
65 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
66 store float %0, float* %arrayidx1, align 1
70 define double @foo6(i32 %b, i32 %c) nounwind readonly {
74 %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
75 %0 = load double* %arrayidx1, align 1
79 define void @foo7(i32 %b, i32 %c) nounwind {
83 %0 = load double* @gd, align 8
84 %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
85 store double %0, double* %arrayidx1, align 1
89 define float @foo8() nounwind readonly {
93 %0 = load float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1
97 define void @foo9(float %f) nounwind {
101 store float %f, float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1