1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3
4--- |
5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6
7  define void @inttoptr_p0_s64() { ret void }
8  define void @ptrtoint_s64_p0() { ret void }
9  define void @ptrtoint_s32_p0() { ret void }
10  define void @ptrtoint_s16_p0() { ret void }
11  define void @ptrtoint_s8_p0() { ret void }
12  define void @ptrtoint_s1_p0() { ret void }
13...
14
15---
16name:            inttoptr_p0_s64
17legalized:       true
18regBankSelected: true
19
20registers:
21  - { id: 0, class: gpr }
22  - { id: 1, class: gpr }
23body:             |
24  bb.0:
25    liveins: $x0
26    ; CHECK-LABEL: name: inttoptr_p0_s64
27    ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
28    ; CHECK: $x0 = COPY [[COPY]]
29    %0(s64) = COPY $x0
30    %1(p0) = G_INTTOPTR %0
31    $x0 = COPY %1(p0)
32...
33
34---
35name:            ptrtoint_s64_p0
36legalized:       true
37regBankSelected: true
38
39registers:
40  - { id: 0, class: gpr }
41  - { id: 1, class: gpr }
42body:             |
43  bb.0:
44    liveins: $x0
45    ; CHECK-LABEL: name: ptrtoint_s64_p0
46    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
47    ; CHECK: $x0 = COPY [[COPY]]
48    %0(p0) = COPY $x0
49    %1(s64) = G_PTRTOINT %0
50    $x0 = COPY %1(s64)
51...
52
53---
54name:            ptrtoint_s32_p0
55legalized:       true
56regBankSelected: true
57
58registers:
59  - { id: 0, class: gpr }
60  - { id: 1, class: gpr }
61body:             |
62  bb.0:
63    liveins: $x0
64    ; CHECK-LABEL: name: ptrtoint_s32_p0
65    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
66    ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
67    ; CHECK: $w0 = COPY [[COPY1]]
68    %0(p0) = COPY $x0
69    %1(s32) = G_PTRTOINT %0
70    $w0 = COPY %1(s32)
71...
72
73---
74name:            ptrtoint_s16_p0
75legalized:       true
76regBankSelected: true
77
78registers:
79  - { id: 0, class: gpr }
80  - { id: 1, class: gpr }
81body:             |
82  bb.0:
83    liveins: $x0
84    ; CHECK-LABEL: name: ptrtoint_s16_p0
85    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
86    ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
87    ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
88    ; CHECK: $w0 = COPY [[COPY2]]
89    %0(p0) = COPY $x0
90    %1(s16) = G_PTRTOINT %0
91    %2:gpr(s32) = G_ANYEXT %1
92    $w0 = COPY %2(s32)
93...
94
95---
96name:            ptrtoint_s8_p0
97legalized:       true
98regBankSelected: true
99
100registers:
101  - { id: 0, class: gpr }
102  - { id: 1, class: gpr }
103body:             |
104  bb.0:
105    liveins: $x0
106    ; CHECK-LABEL: name: ptrtoint_s8_p0
107    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
108    ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
109    ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
110    ; CHECK: $w0 = COPY [[COPY2]]
111    %0(p0) = COPY $x0
112    %1(s8) = G_PTRTOINT %0
113    %2:gpr(s32) = G_ANYEXT %1
114    $w0 = COPY %2(s32)
115...
116
117---
118name:            ptrtoint_s1_p0
119legalized:       true
120regBankSelected: true
121
122registers:
123  - { id: 0, class: gpr }
124  - { id: 1, class: gpr }
125body:             |
126  bb.0:
127    liveins: $x0
128    ; CHECK-LABEL: name: ptrtoint_s1_p0
129    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
130    ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
131    ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
132    ; CHECK: $w0 = COPY [[COPY2]]
133    %0(p0) = COPY $x0
134    %1(s1) = G_PTRTOINT %0
135    %2:gpr(s32) = G_ANYEXT %1
136    $w0 = COPY %2(s32)
137...
138