1 ; RUN: llc -march=mips -mattr=-long-calls %s -o - \
2 ; RUN: | FileCheck -check-prefix=OFF %s
3 ; RUN: llc -march=mips -mattr=+long-calls,+noabicalls %s -o - \
4 ; RUN: | FileCheck -check-prefix=ON32 %s
6 ; RUN: llc -march=mips -mattr=+long-calls,-noabicalls %s -o - \
7 ; RUN: | FileCheck -check-prefix=OFF %s
9 ; RUN: llc -march=mips64 -target-abi n32 -mattr=-long-calls %s -o - \
10 ; RUN: | FileCheck -check-prefix=OFF %s
11 ; RUN: llc -march=mips64 -target-abi n32 -mattr=+long-calls,+noabicalls %s -o - \
12 ; RUN: | FileCheck -check-prefix=ON32 %s
14 ; RUN: llc -march=mips64 -target-abi n64 -mattr=-long-calls %s -o - \
15 ; RUN: | FileCheck -check-prefix=OFF %s
16 ; RUN: llc -march=mips64 -target-abi n64 -mattr=+long-calls,+noabicalls %s -o - \
17 ; RUN: | FileCheck -check-prefix=ON64 %s
19 declare void @callee()
20 declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1)
22 @val = internal unnamed_addr global [20 x i32] zeroinitializer, align 4
24 define void @caller() {
26 ; Use `jal` instruction with R_MIPS_26 relocation.
30 ; Save the `callee` and `memset` addresses in $25 register
31 ; and use `jalr` for the jumps.
32 ; ON32: lui $1, %hi(callee)
33 ; ON32: addiu $25, $1, %lo(callee)
36 ; ON32: lui $1, %hi(memset)
37 ; ON32: addiu $25, $1, %lo(memset)
40 ; ON64: lui $1, %highest(callee)
41 ; ON64: daddiu $1, $1, %higher(callee)
42 ; ON64: daddiu $1, $1, %hi(callee)
43 ; ON64: daddiu $25, $1, %lo(callee)
46 ; ON64: lui $2, %highest(memset)
47 ; ON64: daddiu $1, $2, %higher(memset)
48 ; ON64: dsll $1, $1, 16
49 ; ON64: daddiu $1, $1, %hi(memset)
50 ; ON64: dsll $1, $1, 16
51 ; ON64: daddiu $25, $1, %lo(memset)
55 call void @llvm.memset.p0.i32(ptr align 4 @val, i8 0, i32 80, i1 false)