1 ; RUN: llc -march=mips -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
2 ; RUN: llc -march=mipsel -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
4 ; RUN-TODO: llc -march=mips64 -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
5 ; RUN-TODO: llc -march=mips64el -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=O32 %s
7 ; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
8 ; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
10 ; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
11 ; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=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 @byte = global i8 zeroinitializer
17 @word = global i32 zeroinitializer
18 @dword = global i64 zeroinitializer
19 @float = global float zeroinitializer
20 @double = global double zeroinitializer
22 define i8 @reti8() nounwind {
24 %0 = load volatile i8* @byte
29 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(byte)
30 ; O32-DAG: lbu $2, %lo(byte)([[R1]])
31 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(byte)
32 ; N32-DAG: lbu $2, %lo(byte)([[R1]])
33 ; N64-DAG: ld [[R1:\$[0-9]+]], %got_disp(byte)($1)
34 ; N64-DAG: lbu $2, 0([[R1]])
36 define i32 @reti32() nounwind {
38 %0 = load volatile i32* @word
43 ; O32-DAG: lui [[R1:\$[0-9]+]], %hi(word)
44 ; O32-DAG: lw $2, %lo(word)([[R1]])
45 ; N32-DAG: lui [[R1:\$[0-9]+]], %hi(word)
46 ; N32-DAG: lw $2, %lo(word)([[R1]])
47 ; N64-DAG: ld [[R1:\$[0-9]+]], %got_disp(word)($1)
48 ; N64-DAG: lw $2, 0([[R1]])
50 define i64 @reti64() nounwind {
52 %0 = load volatile i64* @dword
57 ; On O32, we must use v0 and v1 for the return value
58 ; O32-DAG: lw $2, %lo(dword)([[R1:\$[0-9]+]])
59 ; O32-DAG: addiu [[R2:\$[0-9]+]], [[R1]], %lo(dword)
60 ; O32-DAG: lw $3, 4([[R2]])
61 ; N32-DAG: ld $2, %lo(dword)([[R1:\$[0-9]+]])
62 ; N64-DAG: ld [[R1:\$[0-9]+]], %got_disp(dword)([[R1:\$[0-9]+]])
63 ; N64-DAG: ld $2, 0([[R1]])