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