1 ; RUN: llc -mtriple=mips-linux-gnu -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32 %s
2 ; RUN: llc -mtriple=mipsel-linux-gnu -relocation-model=static < %s | FileCheck --check-prefixes=ALL,O32 %s
4 ; RUN-TODO: llc -mtriple=mips64-linux-gnu -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
5 ; RUN-TODO: llc -mtriple=mips64el-linux-gnu -relocation-model=static -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
7 ; RUN: llc -mtriple=mips64-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
8 ; RUN: llc -mtriple=mips64el-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
10 ; RUN: llc -mtriple=mips64-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
11 ; RUN: llc -mtriple=mips64el-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
13 ; RUN: llc -mtriple=mips-linux-gnu -relocation-model=static -mattr=+o32,+fp64 < %s | FileCheck --check-prefixes=ALL,032FP64 %s
14 ; RUN: llc -mtriple=mipsel-linux-gnu -relocation-model=static -mattr=+o32,+fp64 < %s | FileCheck --check-prefixes=ALL,032FP64 %s
16 ; Test the float returns for all ABI's and byte orders as specified by
17 ; section 5 of MD00305 (MIPS ABIs Described).
19 ; We only test Linux because other OS's use different relocations and I don't
20 ; know if this is correct.
22 @float = global float zeroinitializer
23 @double = global double zeroinitializer
25 define float @retfloat() nounwind {
27 %0 = load volatile float, float* @float
31 ; ALL-LABEL: retfloat:
32 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(float)
33 ; O32-DAG: lwc1 $f0, %lo(float)([[R1]])
34 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(float)
35 ; N32-DAG: lwc1 $f0, %lo(float)([[R1]])
36 ; N64-DAG: lwc1 $f0, %lo(float)([[R1:\$[0-9+]]])
38 define double @retdouble() nounwind {
40 %0 = load volatile double, double* @double
44 ; ALL-LABEL: retdouble:
45 ; O32-DAG: ldc1 $f0, %lo(double)([[R1:\$[0-9]+]])
46 ; N32-DAG: ldc1 $f0, %lo(double)([[R1:\$[0-9]+]])
47 ; N64-DAG: ldc1 $f0, %lo(double)([[R1:\$[0-9]+]])
49 define { double, double } @retComplexDouble() #0 {
50 %retval = alloca { double, double }, align 8
51 %1 = load { double, double }, { double, double }* %retval
52 ret { double, double } %1
55 ; ALL-LABEL: retComplexDouble:
56 ; 032FP64-DAG: ldc1 $f0, 0($sp)
57 ; 032FP64-DAG: ldc1 $f2, 8($sp)