• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -march=mips64 -relocation-model=static < %s \
3; RUN:   | FileCheck %s --check-prefix STATIC
4; RUN: llc -march=mips64 -relocation-model=pic < %s \
5; RUN:   | FileCheck %s --check-prefix PIC
6
7declare dso_local void @callee() noreturn nounwind
8
9define 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
17; STATIC-NEXT:    nop
18;
19; PIC-LABEL: caller:
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
31; PIC-NEXT:  .Ltmp0:
32; PIC-NEXT:    jalr $25
33; PIC-NEXT:    nop
34entry:
35  tail call void @callee()
36  unreachable
37}
38