1# RUN: llc -march=mips -mcpu=mips32r2 -mattr=+micromips %s -o - \
2# RUN:     -start-after=block-placement | FileCheck %s
3
4# Test that the micromips jal instruction is correctly handled by the delay slot
5# filler by converting it to a short delay slot for the li instruction.
6
7# CHECK-LABEL: caller13
8# CHECK:      jals callee13
9# CHECK-NEXT: li16
10
11--- |
12  declare i32 @callee13(i32, i32)
13
14  define i32 @caller13() {
15  entry:
16    %call = tail call i32 (i32, i32) @callee13(i32 1, i32 2)
17    ret i32 %call
18  }
19
20...
21---
22name:            caller13
23alignment:       4
24exposesReturnsTwice: false
25legalized:       false
26regBankSelected: false
27selected:        false
28tracksRegLiveness: true
29registers:
30liveins:
31frameInfo:
32  isFrameAddressTaken: false
33  isReturnAddressTaken: false
34  hasStackMap:     false
35  hasPatchPoint:   false
36  stackSize:       24
37  offsetAdjustment: 0
38  maxAlignment:    4
39  adjustsStack:    true
40  hasCalls:        true
41  stackProtector:  ''
42  maxCallFrameSize: 16
43  hasOpaqueSPAdjustment: false
44  hasVAStart:      false
45  hasMustTailInVarArgFunc: false
46  savePoint:       ''
47  restorePoint:    ''
48fixedStack:
49stack:
50  - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
51      stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
52      debug-info-variable: '', debug-info-expression: '',
53      debug-info-location: '' }
54constants:
55body:             |
56  bb.0.entry:
57    liveins: $ra
58
59    $sp = ADDiu $sp, -24
60    CFI_INSTRUCTION def_cfa_offset 24
61    SW killed $ra, $sp, 20 :: (store (s32) into %stack.0)
62    CFI_INSTRUCTION offset $ra_64, -4
63    $a0 = LI16_MM 1
64    $a1 = LI16_MM 2
65    JAL_MM @callee13, csr_o32, implicit-def dead $ra, implicit killed $a0, implicit killed $a1, implicit-def $sp, implicit-def $v0
66    $ra = LW $sp, 20 :: (load (s32) from %stack.0)
67    $sp = ADDiu $sp, 24
68    PseudoReturn undef $ra, implicit $v0
69
70
71...
72