xref: /llvm-project/llvm/test/CodeGen/AArch64/fast-regalloc-empty-bb-with-liveins.mir (revision 1bc8b3258e6d42f702fb11eb60d84d0e23935e3e)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple aarch64-apple-ios -run-pass regallocfast -o - %s | FileCheck %s
3# RUN: llc -mtriple aarch64-apple-ios -passes=regallocfast -o - %s | FileCheck %s
4# This test used to crash the fast register alloc.
5# Basically, when a basic block has liveins, the fast regalloc
6# was deferencing the begin iterator of this block. However,
7# when this block is empty and it will just crashed!
8---
9name:            crashing
10tracksRegLiveness: true
11body:             |
12  ; CHECK-LABEL: name: crashing
13  ; CHECK: bb.0:
14  ; CHECK:   successors: %bb.1(0x80000000)
15  ; CHECK:   liveins: $x0, $x1
16  ; CHECK: bb.1:
17  ; CHECK:   renamable $w0 = MOVi32imm -1
18  ; CHECK:   RET_ReallyLR implicit killed $w0
19  bb.1:
20    liveins: $x0, $x1
21
22  bb.2:
23    %0:gpr32 = MOVi32imm -1
24    $w0 = COPY %0
25    RET_ReallyLR implicit $w0
26
27...
28