1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s
5 define i1 @test_and_i1() {
6 %ret = and i1 undef, undef
10 define i8 @test_and_i8() {
11 %ret = and i8 undef, undef
15 define i16 @test_and_i16() {
16 %ret = and i16 undef, undef
20 define i32 @test_and_i32() {
21 %ret = and i32 undef, undef
25 define i64 @test_and_i64() {
26 %ret = and i64 undef, undef
35 regBankSelected: false
37 - { id: 0, class: _, preferred-register: '' }
38 - { id: 1, class: _, preferred-register: '' }
39 - { id: 2, class: _, preferred-register: '' }
43 ; CHECK-LABEL: name: test_and_i1
44 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edx
45 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
46 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
47 ; CHECK: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[TRUNC1]]
48 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[AND]](s8)
49 ; CHECK: $eax = COPY [[ANYEXT]](s32)
52 %1(s1) = G_TRUNC %0(s32)
54 %3:_(s32) = G_ANYEXT %2
62 regBankSelected: false
64 - { id: 0, class: _, preferred-register: '' }
65 - { id: 1, class: _, preferred-register: '' }
72 ; CHECK-LABEL: name: test_and_i8
73 ; CHECK: [[DEF:%[0-9]+]]:_(s8) = IMPLICIT_DEF
74 ; CHECK: [[AND:%[0-9]+]]:_(s8) = G_AND [[DEF]], [[DEF]]
75 ; CHECK: $al = COPY [[AND]](s8)
76 ; CHECK: RET 0, implicit $al
87 regBankSelected: false
89 - { id: 0, class: _, preferred-register: '' }
90 - { id: 1, class: _, preferred-register: '' }
97 ; CHECK-LABEL: name: test_and_i16
98 ; CHECK: [[DEF:%[0-9]+]]:_(s16) = IMPLICIT_DEF
99 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[DEF]], [[DEF]]
100 ; CHECK: $ax = COPY [[AND]](s16)
101 ; CHECK: RET 0, implicit $ax
102 %0(s16) = IMPLICIT_DEF
103 %1(s16) = G_AND %0, %0
112 regBankSelected: false
114 - { id: 0, class: _, preferred-register: '' }
115 - { id: 1, class: _, preferred-register: '' }
122 ; CHECK-LABEL: name: test_and_i32
123 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
124 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[DEF]], [[DEF]]
125 ; CHECK: $eax = COPY [[AND]](s32)
126 ; CHECK: RET 0, implicit $eax
127 %0(s32) = IMPLICIT_DEF
128 %1(s32) = G_AND %0, %0
137 regBankSelected: false
139 - { id: 0, class: _, preferred-register: '' }
140 - { id: 1, class: _, preferred-register: '' }
147 ; CHECK-LABEL: name: test_and_i64
148 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = IMPLICIT_DEF
149 ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[DEF]]
150 ; CHECK: $rax = COPY [[AND]](s64)
151 ; CHECK: RET 0, implicit $rax
152 %0(s64) = IMPLICIT_DEF
153 %1(s64) = G_AND %0, %0