reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py

; RUN: llc -march=mips -verify-machineinstrs \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS32
; RUN: llc -march=mips -verify-machineinstrs -relocation-model=pic \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS32-PIC
; RUN: llc -march=mips64 -verify-machineinstrs \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS64
; RUN: llc -march=mips64 -verify-machineinstrs -relocation-model=pic \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS64-PIC
; RUN: llc -march=mips -verify-machineinstrs -mattr=+micromips \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS32-MM
; RUN: llc -march=mips -verify-machineinstrs -relocation-model=pic -mattr=+micromips \
; RUN:   < %s | FileCheck %s -check-prefix=MIPS32-MM-PIC

; Test that checks ABI for _mcount calls.

; Function Attrs: noinline nounwind optnone
define void @foo() #0 {
; MIPS32-LABEL: foo:
; MIPS32:       # %bb.0: # %entry
; MIPS32-NEXT:    addiu $sp, $sp, -24
; MIPS32-NEXT:    .cfi_def_cfa_offset 24
; MIPS32-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
; MIPS32-NEXT:    .cfi_offset 31, -4
; MIPS32-NEXT:    move $1, $ra
; MIPS32-NEXT:    jal _mcount
; MIPS32-NEXT:    addiu $sp, $sp, -8
; MIPS32-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
; MIPS32-NEXT:    jr $ra
; MIPS32-NEXT:    addiu $sp, $sp, 24
;
; MIPS32-PIC-LABEL: foo:
; MIPS32-PIC:       # %bb.0: # %entry
; MIPS32-PIC-NEXT:    lui $2, %hi(_gp_disp)
; MIPS32-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
; MIPS32-PIC-NEXT:    addiu $sp, $sp, -24
; MIPS32-PIC-NEXT:    .cfi_def_cfa_offset 24
; MIPS32-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
; MIPS32-PIC-NEXT:    .cfi_offset 31, -4
; MIPS32-PIC-NEXT:    addu $gp, $2, $25
; MIPS32-PIC-NEXT:    lw $25, %call16(_mcount)($gp)
; MIPS32-PIC-NEXT:    move $1, $ra
; MIPS32-PIC-NEXT:    .reloc ($tmp0), R_MIPS_JALR, _mcount
; MIPS32-PIC-NEXT:  $tmp0:
; MIPS32-PIC-NEXT:    jalr $25
; MIPS32-PIC-NEXT:    addiu $sp, $sp, -8
; MIPS32-PIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
; MIPS32-PIC-NEXT:    jr $ra
; MIPS32-PIC-NEXT:    addiu $sp, $sp, 24
;
; MIPS64-LABEL: foo:
; MIPS64:       # %bb.0: # %entry
; MIPS64-NEXT:    daddiu $sp, $sp, -16
; MIPS64-NEXT:    .cfi_def_cfa_offset 16
; MIPS64-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
; MIPS64-NEXT:    .cfi_offset 31, -8
; MIPS64-NEXT:    move $1, $ra
; MIPS64-NEXT:    jal _mcount
; MIPS64-NEXT:    nop
; MIPS64-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
; MIPS64-NEXT:    jr $ra
; MIPS64-NEXT:    daddiu $sp, $sp, 16
;
; MIPS64-PIC-LABEL: foo:
; MIPS64-PIC:       # %bb.0: # %entry
; MIPS64-PIC-NEXT:    daddiu $sp, $sp, -16
; MIPS64-PIC-NEXT:    .cfi_def_cfa_offset 16
; MIPS64-PIC-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
; MIPS64-PIC-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
; MIPS64-PIC-NEXT:    .cfi_offset 31, -8
; MIPS64-PIC-NEXT:    .cfi_offset 28, -16
; MIPS64-PIC-NEXT:    lui $1, %hi(%neg(%gp_rel(foo)))
; MIPS64-PIC-NEXT:    daddu $1, $1, $25
; MIPS64-PIC-NEXT:    daddiu $gp, $1, %lo(%neg(%gp_rel(foo)))
; MIPS64-PIC-NEXT:    ld $25, %call16(_mcount)($gp)
; MIPS64-PIC-NEXT:    move $1, $ra
; MIPS64-PIC-NEXT:    .reloc .Ltmp0, R_MIPS_JALR, _mcount
; MIPS64-PIC-NEXT:  .Ltmp0:
; MIPS64-PIC-NEXT:    jalr $25
; MIPS64-PIC-NEXT:    nop
; MIPS64-PIC-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
; MIPS64-PIC-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
; MIPS64-PIC-NEXT:    jr $ra
; MIPS64-PIC-NEXT:    daddiu $sp, $sp, 16
;
; MIPS32-MM-LABEL: foo:
; MIPS32-MM:       # %bb.0: # %entry
; MIPS32-MM-NEXT:    addiu $sp, $sp, -24
; MIPS32-MM-NEXT:    .cfi_def_cfa_offset 24
; MIPS32-MM-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
; MIPS32-MM-NEXT:    .cfi_offset 31, -4
; MIPS32-MM-NEXT:    move $1, $ra
; MIPS32-MM-NEXT:    jal _mcount
; MIPS32-MM-NEXT:    addiu $sp, $sp, -8
; MIPS32-MM-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
; MIPS32-MM-NEXT:    jr $ra
; MIPS32-MM-NEXT:    addiu $sp, $sp, 24
;
; MIPS32-MM-PIC-LABEL: foo:
; MIPS32-MM-PIC:       # %bb.0: # %entry
; MIPS32-MM-PIC-NEXT:    lui $2, %hi(_gp_disp)
; MIPS32-MM-PIC-NEXT:    addiu $2, $2, %lo(_gp_disp)
; MIPS32-MM-PIC-NEXT:    addiu $sp, $sp, -24
; MIPS32-MM-PIC-NEXT:    .cfi_def_cfa_offset 24
; MIPS32-MM-PIC-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
; MIPS32-MM-PIC-NEXT:    .cfi_offset 31, -4
; MIPS32-MM-PIC-NEXT:    addu $2, $2, $25
; MIPS32-MM-PIC-NEXT:    lw $25, %call16(_mcount)($2)
; MIPS32-MM-PIC-NEXT:    move $gp, $2
; MIPS32-MM-PIC-NEXT:    move $1, $ra
; MIPS32-MM-PIC-NEXT:    .reloc ($tmp0), R_MICROMIPS_JALR, _mcount
; MIPS32-MM-PIC-NEXT:  $tmp0:
; MIPS32-MM-PIC-NEXT:    jalr $25
; MIPS32-MM-PIC-NEXT:    addiu $sp, $sp, -8
; MIPS32-MM-PIC-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
; MIPS32-MM-PIC-NEXT:    jr $ra
; MIPS32-MM-PIC-NEXT:    addiu $sp, $sp, 24
entry:
  ret void
}

attributes #0 = { "instrument-function-entry-inlined"="_mcount" }