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 ; Test the integer 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 @byte = global i8 zeroinitializer
20 @word = global i32 zeroinitializer
21 @dword = global i64 zeroinitializer
22 @float = global float zeroinitializer
23 @double = global double zeroinitializer
25 define i8 @reti8() nounwind {
27 %0 = load volatile i8, ptr @byte
32 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(byte)
33 ; O32-DAG: lbu $2, %lo(byte)([[R1]])
34 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(byte)
35 ; N32-DAG: lbu $2, %lo(byte)([[R1]])
36 ; N64-DAG: lui [[R1:\$[0-9]+]], %highest(byte)
37 ; N64-DAG: lbu $2, %lo(byte)([[R1]])
39 define i32 @reti32() nounwind {
41 %0 = load volatile i32, ptr @word
46 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(word)
47 ; O32-DAG: lw $2, %lo(word)([[R1]])
48 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(word)
49 ; N32-DAG: lw $2, %lo(word)([[R1]])
50 ; N64-DAG: lui [[R1:\$[0-9]+]], %highest(word)
51 ; N64-DAG: lw $2, %lo(word)([[R1]])
53 define i64 @reti64() nounwind {
55 %0 = load volatile i64, ptr @dword
60 ; On O32, we must use v0 and v1 for the return value
61 ; O32-DAG: lw $2, %lo(dword)([[R1:\$[0-9]+]])
62 ; O32-DAG: addiu [[R2:\$[0-9]+]], [[R1]], %lo(dword)
63 ; O32-DAG: lw $3, 4([[R2]])
64 ; N32-DAG: ld $2, %lo(dword)([[R1:\$[0-9]+]])
65 ; N64-DAG: lui [[R1:\$[0-9]+]], %highest(dword)
66 ; N64-DAG: ld $2, %lo(dword)([[R1]])