Home | History | Annotate | Download | only in indirect-jump-hazard
      1 # RUN: not llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r2 %s \
      2 # RUN:         -start-after=expand-isel-pseudos -stop-after=expand-isel-pseudos \
      3 # RUN:         -verify-machineinstrs -mattr=+use-indirect-jump-hazard -o - 2>&1 \
      4 # RUN:   | FileCheck %s
      5 
      6 # That that tail calls are checked when using indirect jump guards (hazard variant).
      7 
      8 # CHECK: Bad machine code: invalid instruction when using jump guards!
      9 --- |
     10   define i32 @fooTail(i32 (i32)* nocapture %f1) {
     11   entry:
     12     %0 = tail call i32 %f1(i32 14)
     13     ret i32 %0
     14   }
     15 
     16 ...
     17 ---
     18 name:            fooTail
     19 alignment:       2
     20 exposesReturnsTwice: false
     21 legalized:       false
     22 regBankSelected: false
     23 selected:        false
     24 tracksRegLiveness: true
     25 registers:
     26   - { id: 0, class: gpr32, preferred-register: '' }
     27   - { id: 1, class: gpr32, preferred-register: '' }
     28 liveins:
     29   - { reg: '$a0', virtual-reg: '%0' }
     30 frameInfo:
     31   isFrameAddressTaken: false
     32   isReturnAddressTaken: false
     33   hasStackMap:     false
     34   hasPatchPoint:   false
     35   stackSize:       0
     36   offsetAdjustment: 0
     37   maxAlignment:    1
     38   adjustsStack:    false
     39   hasCalls:        false
     40   stackProtector:  ''
     41   maxCallFrameSize: 4294967295
     42   hasOpaqueSPAdjustment: false
     43   hasVAStart:      false
     44   hasMustTailInVarArgFunc: false
     45   savePoint:       ''
     46   restorePoint:    ''
     47 fixedStack:
     48 stack:
     49 constants:
     50 body:             |
     51   bb.0.entry:
     52     liveins: $a0
     53 
     54     %0:gpr32 = COPY $a0
     55     %1:gpr32 = ADDiu $zero, 14
     56     $a0 = COPY %1
     57     TAILCALLREG %0, csr_o32, implicit-def dead $at, implicit $a0
     58 
     59 ...
     60