xref: /llvm-project/llvm/test/MachineVerifier/test_g_ptrtoint.mir (revision d20190e68413634b87f0f9426312a0e9d8456d18)
1#RUN: not --crash llc -o - -mtriple=arm64 -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
2# REQUIRES: aarch64-registered-target
3
4---
5name:            test_ptrtoint
6legalized:       true
7regBankSelected: false
8selected:        false
9tracksRegLiveness: true
10liveins:
11body:             |
12  bb.0:
13
14    %0:_(s64) = G_IMPLICIT_DEF
15    %1:_(p0) = G_IMPLICIT_DEF
16    %2:_(<2 x s64>) = G_IMPLICIT_DEF
17    %3:_(<2 x p0>) = G_IMPLICIT_DEF
18
19    ; CHECK: Bad machine code: Too few operands
20    %4:_(s64) = G_PTRTOINT
21
22    ; CHECK: Bad machine code: Too few operands
23    ; CHECK: Bad machine code: Explicit definition marked as use
24    G_PTRTOINT %1
25
26    ; CHECK: Bad machine code: ptrtoint result type must not be a pointer
27    %5:_(p0) = G_PTRTOINT %1
28
29    ; CHECK: Bad machine code: ptrtoint result type must not be a pointer
30    %6:_(<2 x p0>) = G_PTRTOINT %0
31
32    ; CHECK: Bad machine code: ptrtoint source type must be a pointer
33    %7:_(<2 x s64>) = G_PTRTOINT %2
34
35    ; CHECK: Bad machine code: operand types must be all-vector or all-scalar
36    %8:_(s64) = G_PTRTOINT %3
37
38    ; CHECK: Bad machine code: operand types must preserve number of vector elements
39    %9:_(<4 x s64>) = G_INTTOPTR %3
40
41    ; CHECK: Bad machine code: operand types must preserve number of vector elements
42    %10:_(<4 x p0>) = G_IMPLICIT_DEF
43    %11:_(<2 x s64>) = G_PTRTOINT %10
44
45...
46