1 ; RUN: llc -mtriple=mips-linux-gnu -soft-float -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
2 ; RUN: llc -mtriple=mipsel-linux-gnu -soft-float -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
4 ; RUN-TODO: llc -mtriple=mips64-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
5 ; RUN-TODO: llc -mtriple=mips64el-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
7 ; RUN: llc -mtriple=mips64-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
8 ; RUN: llc -mtriple=mips64el-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
10 ; RUN: llc -mtriple=mips64-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
11 ; RUN: llc -mtriple=mips64el-linux-gnu -soft-float -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
13 ; Test the float returns for all ABI's and byte orders as specified by
14 ; section 5 of MD00305 (MIPS ABIs Described).
16 ; We only test Linux because other OS's use different relocations and I don't
17 ; know if this is correct.
19 @float = global float zeroinitializer
20 @double = global double zeroinitializer
22 define float @retfloat() nounwind {
24 %0 = load volatile float* @float
28 ; ALL-LABEL: retfloat:
29 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(float)
30 ; O32-DAG: lw $2, %lo(float)([[R1]])
31 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(float)
32 ; N32-DAG: lw $2, %lo(float)([[R1]])
33 ; N64-DAG: ld [[R1:\$[0-9]+]], %got_disp(float)($1)
34 ; N64-DAG: lw $2, 0([[R1]])
36 define double @retdouble() nounwind {
38 %0 = load volatile double* @double
42 ; ALL-LABEL: retdouble:
43 ; O32-DAG: lw $2, %lo(double)([[R1:\$[0-9]+]])
44 ; O32-DAG: addiu [[R2:\$[0-9]+]], [[R1]], %lo(double)
45 ; O32-DAG: lw $3, 4([[R2]])
46 ; N32-DAG: ld $2, %lo(double)([[R1:\$[0-9]+]])
47 ; N64-DAG: ld [[R1:\$[0-9]+]], %got_disp(double)($1)
48 ; N64-DAG: ld $2, 0([[R1]])