Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mips -target-abi o32 --mattr=+long-calls,+noabicalls < %s \
      2 ; RUN:   | FileCheck -check-prefix=O32 %s
      3 ; RUN: llc -march=mips -target-abi o32 --mattr=-long-calls,+noabicalls < %s \
      4 ; RUN:   | FileCheck -check-prefix=O32 %s
      5 ; RUN: llc -march=mips64 -target-abi n64 --mattr=+long-calls,+noabicalls < %s \
      6 ; RUN:   | FileCheck -check-prefix=N64 %s
      7 ; RUN: llc -march=mips64 -target-abi n64 --mattr=-long-calls,+noabicalls < %s \
      8 ; RUN:   | FileCheck -check-prefix=N64 %s
      9 
     10 declare void @far() #0
     11 
     12 define void @near() #1 {
     13   ret void
     14 }
     15 
     16 define void @foo() {
     17   call void @far()
     18 
     19 ; O32-LABEL: foo:
     20 ; O32:         lui     $1, %hi(far)
     21 ; O32-NEXT:    addiu   $25, $1, %lo(far)
     22 ; O32-NEXT:    jalr    $25
     23 
     24 ; N64-LABEL: foo:
     25 ; N64:         lui     $1, %highest(far)
     26 ; N64-NEXT:    daddiu  $1, $1, %higher(far)
     27 ; N64-NEXT:    dsll    $1, $1, 16
     28 ; N64-NEXT:    daddiu  $1, $1, %hi(far)
     29 ; N64-NEXT:    dsll    $1, $1, 16
     30 ; N64-NEXT:    daddiu  $25, $1, %lo(far)
     31 ; N64-NEXT:    jalr    $25
     32 
     33   call void @near()
     34 
     35 ; O32:         jal near
     36 ; N64:         jal near
     37 
     38   ret void
     39 }
     40 
     41 attributes #0 = { "long-call" }
     42 attributes #1 = { "short-call" }
     43