1# RUN: not --crash llc -march=aarch64 -o /dev/null -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
2# REQUIRES: aarch64-registered-target
3
4# Undef uses are illegal for generic vregs.
5
6---
7name:            test_undef_use
8liveins:
9body:             |
10  bb.0:
11    %0:_(s32) = G_CONSTANT i32 0
12
13    ; Test generic instruction
14    ; CHECK: *** Bad machine code: Generic virtual register use cannot be undef ***
15    G_STORE %0, undef %1:_(p0) :: (store 4)
16
17    ; Make sure this fails on a post-isel generic instruction.
18    ; CHECK: *** Bad machine code: Generic virtual register use cannot be undef ***
19    $x0 = COPY undef %2:_(s64)
20
21    ; Make sure this fails with a target instruction
22    ; CHECK: *** Bad machine code: Generic virtual register use cannot be undef ***
23    RET_ReallyLR implicit $x0, implicit undef %3:_(s32)
24...
25
26