1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
5 define i8 @const_i8() {
9 define i16 @const_i16() {
13 define i32 @const_i32() {
17 define i32 @const_i32_0() {
21 define i64 @const_i64() {
25 define i64 @const_i64_u32() {
29 define i64 @const_i64_i32() {
33 define void @main(i32** %data) {
34 store i32* null, i32** %data, align 8
45 - { id: 0, class: gpr }
48 ; CHECK-LABEL: name: const_i8
49 ; CHECK: [[MOV8ri:%[0-9]+]]:gr8 = MOV8ri 2
50 ; CHECK: $al = COPY [[MOV8ri]]
51 ; CHECK: RET 0, implicit $al
52 %0(s8) = G_CONSTANT i8 2
63 - { id: 0, class: gpr }
66 ; CHECK-LABEL: name: const_i16
67 ; CHECK: [[MOV16ri:%[0-9]+]]:gr16 = MOV16ri 3
68 ; CHECK: $ax = COPY [[MOV16ri]]
69 ; CHECK: RET 0, implicit $ax
70 %0(s16) = G_CONSTANT i16 3
81 - { id: 0, class: gpr }
84 ; CHECK-LABEL: name: const_i32
85 ; CHECK: [[MOV32ri:%[0-9]+]]:gr32 = MOV32ri 4
86 ; CHECK: $eax = COPY [[MOV32ri]]
87 ; CHECK: RET 0, implicit $eax
88 %0(s32) = G_CONSTANT i32 4
98 - { id: 0, class: gpr }
101 ; CHECK-LABEL: name: const_i32_0
102 ; CHECK: [[MOV32r0_:%[0-9]+]]:gr32 = MOV32r0 implicit-def $eflags
103 ; CHECK: $eax = COPY [[MOV32r0_]]
104 ; CHECK: RET 0, implicit $eax
105 %0(s32) = G_CONSTANT i32 0
113 regBankSelected: true
116 - { id: 0, class: gpr }
119 ; CHECK-LABEL: name: const_i64
120 ; CHECK: [[MOV64ri:%[0-9]+]]:gr64 = MOV64ri 68719476720
121 ; CHECK: $rax = COPY [[MOV64ri]]
122 ; CHECK: RET 0, implicit $rax
123 %0(s64) = G_CONSTANT i64 68719476720
132 regBankSelected: true
135 - { id: 0, class: gpr }
138 ; CHECK-LABEL: name: const_i64_u32
139 ; CHECK: [[MOV64ri32_:%[0-9]+]]:gr64 = MOV64ri32 1879048192
140 ; CHECK: $rax = COPY [[MOV64ri32_]]
141 ; CHECK: RET 0, implicit $rax
142 %0(s64) = G_CONSTANT i64 1879048192
150 regBankSelected: true
153 - { id: 0, class: gpr }
156 ; CHECK-LABEL: name: const_i64_i32
157 ; CHECK: [[MOV64ri32_:%[0-9]+]]:gr64 = MOV64ri32 -1
158 ; CHECK: $rax = COPY [[MOV64ri32_]]
159 ; CHECK: RET 0, implicit $rax
160 %0(s64) = G_CONSTANT i64 -1
169 regBankSelected: true
171 - { id: 0, class: gpr, preferred-register: '' }
172 - { id: 1, class: gpr, preferred-register: '' }
177 ; CHECK-LABEL: name: main
178 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
179 ; CHECK: [[MOV64ri32_:%[0-9]+]]:gr64 = MOV64ri32 0
180 ; CHECK: MOV64mr [[COPY]], 1, $noreg, 0, $noreg, [[MOV64ri32_]] :: (store 8 into %ir.data)
183 %1(p0) = G_CONSTANT i64 0
184 G_STORE %1(p0), %0(p0) :: (store 8 into %ir.data)