1# RUN: not --crash llc -mtriple=mips-mti-linux-gnu -mcpu=mips32r2 %s \
2# RUN:         -start-after=finalize-isel -stop-after=finalize-isel \
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---
18name:            fooTail
19alignment:       4
20exposesReturnsTwice: false
21legalized:       false
22regBankSelected: false
23selected:        false
24tracksRegLiveness: true
25registers:
26  - { id: 0, class: gpr32, preferred-register: '' }
27  - { id: 1, class: gpr32, preferred-register: '' }
28liveins:
29  - { reg: '$a0', virtual-reg: '%0' }
30frameInfo:
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:    ''
47fixedStack:
48stack:
49constants:
50body:             |
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