1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=mips64 -relocation-model=static < %s \
3 ; RUN: | FileCheck %s --check-prefix STATIC
4 ; RUN: llc -mtriple=mips64 -relocation-model=pic < %s \
5 ; RUN: | FileCheck %s --check-prefix PIC
7 declare dso_local void @callee() noreturn nounwind
9 define dso_local void @caller() nounwind "frame-pointer"="non-leaf" {
10 ; STATIC-LABEL: caller:
11 ; STATIC: # %bb.0: # %entry
12 ; STATIC-NEXT: daddiu $sp, $sp, -16
13 ; STATIC-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill
14 ; STATIC-NEXT: sd $fp, 0($sp) # 8-byte Folded Spill
15 ; STATIC-NEXT: move $fp, $sp
16 ; STATIC-NEXT: jal callee
20 ; PIC: # %bb.0: # %entry
21 ; PIC-NEXT: daddiu $sp, $sp, -32
22 ; PIC-NEXT: sd $ra, 24($sp) # 8-byte Folded Spill
23 ; PIC-NEXT: sd $fp, 16($sp) # 8-byte Folded Spill
24 ; PIC-NEXT: sd $gp, 8($sp) # 8-byte Folded Spill
25 ; PIC-NEXT: move $fp, $sp
26 ; PIC-NEXT: lui $1, %hi(%neg(%gp_rel(caller)))
27 ; PIC-NEXT: daddu $1, $1, $25
28 ; PIC-NEXT: daddiu $gp, $1, %lo(%neg(%gp_rel(caller)))
29 ; PIC-NEXT: ld $25, %call16(callee)($gp)
30 ; PIC-NEXT: .reloc .Ltmp0, R_MIPS_JALR, callee
35 tail call void @callee()