1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s 3 4--- | 5 6 define i1 @ptrtoint_s1_p0(i64* %p) { 7 entry: 8 %0 = ptrtoint i64* %p to i1 9 ret i1 %0 10 } 11 12 define i8 @ptrtoint_s8_p0(i64* %p) { 13 entry: 14 %0 = ptrtoint i64* %p to i8 15 ret i8 %0 16 } 17 18 define i16 @ptrtoint_s16_p0(i64* %p) { 19 entry: 20 %0 = ptrtoint i64* %p to i16 21 ret i16 %0 22 } 23 24 define i32 @ptrtoint_s32_p0(i64* %p) { 25 entry: 26 %0 = ptrtoint i64* %p to i32 27 ret i32 %0 28 } 29 30 define i64 @ptrtoint_s64_p0(i64* %p) { 31 entry: 32 %0 = ptrtoint i64* %p to i64 33 ret i64 %0 34 } 35 36... 37--- 38name: ptrtoint_s1_p0 39alignment: 16 40tracksRegLiveness: true 41registers: 42 - { id: 0, class: _ } 43 - { id: 1, class: _ } 44 - { id: 2, class: _ } 45body: | 46 bb.1.entry: 47 liveins: $rdi 48 49 ; CHECK-LABEL: name: ptrtoint_s1_p0 50 ; CHECK: liveins: $rdi 51 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi 52 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s1) = G_PTRTOINT [[COPY]](p0) 53 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s8) = G_ANYEXT [[PTRTOINT]](s1) 54 ; CHECK: $al = COPY [[ANYEXT]](s8) 55 ; CHECK: RET 0, implicit $al 56 %0:_(p0) = COPY $rdi 57 %1:_(s1) = G_PTRTOINT %0(p0) 58 %2:_(s8) = G_ANYEXT %1(s1) 59 $al = COPY %2(s8) 60 RET 0, implicit $al 61 62... 63--- 64name: ptrtoint_s8_p0 65alignment: 16 66tracksRegLiveness: true 67registers: 68 - { id: 0, class: _ } 69 - { id: 1, class: _ } 70body: | 71 bb.1.entry: 72 liveins: $rdi 73 74 ; CHECK-LABEL: name: ptrtoint_s8_p0 75 ; CHECK: liveins: $rdi 76 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi 77 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s8) = G_PTRTOINT [[COPY]](p0) 78 ; CHECK: $al = COPY [[PTRTOINT]](s8) 79 ; CHECK: RET 0, implicit $al 80 %0:_(p0) = COPY $rdi 81 %1:_(s8) = G_PTRTOINT %0(p0) 82 $al = COPY %1(s8) 83 RET 0, implicit $al 84 85... 86--- 87name: ptrtoint_s16_p0 88alignment: 16 89tracksRegLiveness: true 90registers: 91 - { id: 0, class: _ } 92 - { id: 1, class: _ } 93body: | 94 bb.1.entry: 95 liveins: $rdi 96 97 ; CHECK-LABEL: name: ptrtoint_s16_p0 98 ; CHECK: liveins: $rdi 99 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi 100 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s16) = G_PTRTOINT [[COPY]](p0) 101 ; CHECK: $ax = COPY [[PTRTOINT]](s16) 102 ; CHECK: RET 0, implicit $ax 103 %0:_(p0) = COPY $rdi 104 %1:_(s16) = G_PTRTOINT %0(p0) 105 $ax = COPY %1(s16) 106 RET 0, implicit $ax 107 108... 109--- 110name: ptrtoint_s32_p0 111alignment: 16 112tracksRegLiveness: true 113registers: 114 - { id: 0, class: _ } 115 - { id: 1, class: _ } 116body: | 117 bb.1.entry: 118 liveins: $rdi 119 120 ; CHECK-LABEL: name: ptrtoint_s32_p0 121 ; CHECK: liveins: $rdi 122 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi 123 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p0) 124 ; CHECK: $eax = COPY [[PTRTOINT]](s32) 125 ; CHECK: RET 0, implicit $eax 126 %0:_(p0) = COPY $rdi 127 %1:_(s32) = G_PTRTOINT %0(p0) 128 $eax = COPY %1(s32) 129 RET 0, implicit $eax 130 131... 132--- 133name: ptrtoint_s64_p0 134alignment: 16 135tracksRegLiveness: true 136registers: 137 - { id: 0, class: _ } 138 - { id: 1, class: _ } 139body: | 140 bb.1.entry: 141 liveins: $rdi 142 143 ; CHECK-LABEL: name: ptrtoint_s64_p0 144 ; CHECK: liveins: $rdi 145 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi 146 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY]](p0) 147 ; CHECK: $rax = COPY [[PTRTOINT]](s64) 148 ; CHECK: RET 0, implicit $rax 149 %0:_(p0) = COPY $rdi 150 %1:_(s64) = G_PTRTOINT %0(p0) 151 $rax = COPY %1(s64) 152 RET 0, implicit $rax 153 154... 155