xref: /llvm-project/llvm/test/MachineVerifier/test_g_ptr_add.mir (revision fd3eaf76ba3392a4406247d996e757ef49f7a8b2)
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_gep
6legalized:       true
7regBankSelected: false
8selected:        false
9tracksRegLiveness: true
10liveins:
11body:             |
12  bb.0:
13
14    %0:_(p0) = G_IMPLICIT_DEF
15    %1:_(s64) = G_IMPLICIT_DEF
16
17    ; CHECK:  Bad machine code: Type mismatch in generic instruction
18    %2:_(s64) = G_PTR_ADD %0, %1
19
20    ; CHECK:  Bad machine code: Type mismatch in generic instruction
21    %3:_(p0) = G_PTR_ADD %1, %1
22
23    ; CHECK: Bad machine code: gep offset operand must not be a pointer
24    %4:_(p0) = G_PTR_ADD %0, %0
25
26    ; CHECK: Bad machine code: Type mismatch in generic instruction
27    %5:_(p1) = G_PTR_ADD %0, %1
28
29    ; CHECK: Bad machine code: gep first operand must be a pointer
30    %6:_(s64) = G_PTR_ADD %1, %1
31
32    %7:_(s32) = G_IMPLICIT_DEF
33
34    ; CHECK: Bad machine code: gep offset operand must match index size for address space
35    %8:_(p0) = G_PTR_ADD %0, %7
36...
37