1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3--- |
4
5  declare void @f_i32(i32)
6  define void @g_i32() {entry: ret void}
7
8  declare void @f_i64(i64)
9  define void @g_i64() {entry: ret void}
10
11  declare void @f_float(float)
12  define void @g_float() {entry: ret void}
13
14  declare void @f_double(double)
15  define void @g_double() {entry: ret void}
16
17...
18---
19name:            g_i32
20alignment:       2
21tracksRegLiveness: true
22body:             |
23  bb.1.entry:
24    ; MIPS32-LABEL: name: g_i32
25    ; MIPS32: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
26    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
27    ; MIPS32: $a0 = COPY [[DEF]](s32)
28    ; MIPS32: JAL @f_i32, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0
29    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
30    ; MIPS32: RetRA
31    %0:_(s32) = G_IMPLICIT_DEF
32    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
33    $a0 = COPY %0(s32)
34    JAL @f_i32, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0
35    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
36    RetRA
37
38...
39---
40name:            g_i64
41alignment:       2
42tracksRegLiveness: true
43body:             |
44  bb.1.entry:
45    ; MIPS32-LABEL: name: g_i64
46    ; MIPS32: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
47    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
48    ; MIPS32: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](s64)
49    ; MIPS32: $a0 = COPY [[UV]](s32)
50    ; MIPS32: $a1 = COPY [[UV1]](s32)
51    ; MIPS32: JAL @f_i64, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1
52    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
53    ; MIPS32: RetRA
54    %0:_(s64) = G_IMPLICIT_DEF
55    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
56    %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0(s64)
57    $a0 = COPY %1(s32)
58    $a1 = COPY %2(s32)
59    JAL @f_i64, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1
60    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
61    RetRA
62
63...
64---
65name:            g_float
66alignment:       2
67tracksRegLiveness: true
68body:             |
69  bb.1.entry:
70    ; MIPS32-LABEL: name: g_float
71    ; MIPS32: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
72    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
73    ; MIPS32: $f12 = COPY [[DEF]](s32)
74    ; MIPS32: JAL @f_float, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12
75    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
76    ; MIPS32: RetRA
77    %0:_(s32) = G_IMPLICIT_DEF
78    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
79    $f12 = COPY %0(s32)
80    JAL @f_float, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12
81    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
82    RetRA
83
84...
85---
86name:            g_double
87alignment:       2
88tracksRegLiveness: true
89body:             |
90  bb.1.entry:
91    ; MIPS32-LABEL: name: g_double
92    ; MIPS32: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
93    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
94    ; MIPS32: $d6 = COPY [[DEF]](s64)
95    ; MIPS32: JAL @f_double, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6
96    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
97    ; MIPS32: RetRA
98    %0:_(s64) = G_IMPLICIT_DEF
99    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
100    $d6 = COPY %0(s64)
101    JAL @f_double, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6
102    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
103    RetRA
104
105...
106