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 3 4--- | 5 define i8 @const_i8() { 6 ret i8 2 7 } 8 9 define i16 @const_i16() { 10 ret i16 3 11 } 12 13 define i32 @const_i32() { 14 ret i32 4 15 } 16 17 define i32 @const_i32_0() { 18 ret i32 0 19 } 20 21 define i64 @const_i64() { 22 ret i64 68719476720 23 } 24 25 define i64 @const_i64_u32() { 26 ret i64 1879048192 27 } 28 29 define i64 @const_i64_i32() { 30 ret i64 -1 31 } 32 33 define void @main(i32** %data) { 34 store i32* null, i32** %data, align 8 35 ret void 36 } 37 38... 39--- 40name: const_i8 41legalized: true 42regBankSelected: true 43selected: false 44registers: 45 - { id: 0, class: gpr } 46body: | 47 bb.1 (%ir-block.0): 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 53 $al = COPY %0(s8) 54 RET 0, implicit $al 55 56... 57--- 58name: const_i16 59legalized: true 60regBankSelected: true 61selected: false 62registers: 63 - { id: 0, class: gpr } 64body: | 65 bb.1 (%ir-block.0): 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 71 $ax = COPY %0(s16) 72 RET 0, implicit $ax 73 74... 75--- 76name: const_i32 77legalized: true 78regBankSelected: true 79selected: false 80registers: 81 - { id: 0, class: gpr } 82body: | 83 bb.1 (%ir-block.0): 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 89 $eax = COPY %0(s32) 90 RET 0, implicit $eax 91 92... 93--- 94name: const_i32_0 95legalized: true 96regBankSelected: true 97registers: 98 - { id: 0, class: gpr } 99body: | 100 bb.1 (%ir-block.0): 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 106 $eax = COPY %0(s32) 107 RET 0, implicit $eax 108 109... 110--- 111name: const_i64 112legalized: true 113regBankSelected: true 114selected: false 115registers: 116 - { id: 0, class: gpr } 117body: | 118 bb.1 (%ir-block.0): 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 124 $rax = COPY %0(s64) 125 RET 0, implicit $rax 126 127... 128--- 129name: const_i64_u32 130alignment: 4 131legalized: true 132regBankSelected: true 133selected: false 134registers: 135 - { id: 0, class: gpr } 136body: | 137 bb.1 (%ir-block.0): 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 143 $rax = COPY %0(s64) 144 RET 0, implicit $rax 145 146... 147--- 148name: const_i64_i32 149legalized: true 150regBankSelected: true 151selected: false 152registers: 153 - { id: 0, class: gpr } 154body: | 155 bb.1 (%ir-block.0): 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 161 $rax = COPY %0(s64) 162 RET 0, implicit $rax 163 164... 165--- 166name: main 167alignment: 4 168legalized: true 169regBankSelected: true 170registers: 171 - { id: 0, class: gpr, preferred-register: '' } 172 - { id: 1, class: gpr, preferred-register: '' } 173body: | 174 bb.1 (%ir-block.0): 175 liveins: $rdi 176 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) 181 ; CHECK: RET 0 182 %0(p0) = COPY $rdi 183 %1(p0) = G_CONSTANT i64 0 184 G_STORE %1(p0), %0(p0) :: (store 8 into %ir.data) 185 RET 0 186 187... 188