1 ; RUN: llc -mtriple=mips-linux-gnu -mattr=+soft-float -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32 %s
2 ; RUN: llc -mtriple=mipsel-linux-gnu -mattr=+soft-float -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32 %s
4 ; RUN-TODO: llc -mtriple=mips64-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
5 ; RUN-TODO: llc -mtriple=mips64el-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
7 ; RUN: llc -mtriple=mips64-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
8 ; RUN: llc -mtriple=mips64el-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
10 ; RUN: llc -mtriple=mips64-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
11 ; RUN: llc -mtriple=mips64el-linux-gnu -mattr=+soft-float -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,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, ptr @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: lw $2, %lo(float)([[R1:\$[0-9+]]])
35 define double @retdouble() nounwind {
37 %0 = load volatile double, ptr @double
41 ; ALL-LABEL: retdouble:
42 ; O32-DAG: lw $2, %lo(double)([[R1:\$[0-9]+]])
43 ; O32-DAG: addiu [[R2:\$[0-9]+]], [[R1]], %lo(double)
44 ; O32-DAG: lw $3, 4([[R2]])
45 ; N32-DAG: ld $2, %lo(double)([[R1:\$[0-9]+]])
46 ; N64-DAG: ld $2, %lo(double)([[R1:\$[0-9]+]])