xref: /llvm-project/llvm/test/MachineVerifier/test_g_bzero.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---
4name:            test_bzero
5legalized:       true
6regBankSelected: false
7selected:        false
8tracksRegLiveness: true
9liveins:
10body:             |
11  bb.0:
12
13    %ptr:_(p0) = G_IMPLICIT_DEF
14    %cst1:_(s64) = G_CONSTANT i64 4
15    %cst2:_(s8) = G_CONSTANT i8 7
16
17    ; CHECK: *** Bad machine code: bzero must have 1 memory operand ***
18    G_BZERO %ptr, %cst2, 0
19
20    ; CHECK: *** Bad machine code: bzero memory operand must be a store ***
21    G_BZERO %ptr, %cst2, 0 :: (load (s32))
22
23    ; CHECK: *** Bad machine code: Missing mayLoad flag ***
24    ; CHECK: *** Bad machine code: bzero memory operand must be a store ***
25    G_BZERO %ptr, %cst2, 0 :: (load store (s32))
26
27    ; CHECK: *** Bad machine code: inconsistent bzero address space ***
28    G_BZERO %ptr, %cst2, 0 :: (store (s32), addrspace 1)
29
30    ; CHECK: *** Bad machine code: bzero operand must be a pointer ***
31    G_BZERO %cst1, %cst2, 0 :: (store (s32))
32
33    ; CHECK: *** Bad machine code: 'tail' flag (last operand) must be an immediate 0 or 1 ***
34    G_BZERO %ptr, %cst2, 2 :: (store (s32))
35...
36