1# RUN: llc -march=hexagon -run-pass simple-register-coalescing -verify-coalescing %s -o - | FileCheck %s
2#
3# Check that this doesn't crash.
4# CHECK: ENDLOOP
5
6---
7name:            foo
8tracksRegLiveness: true
9body: |
10  bb.0:
11    successors: %bb.1(0x40000000), %bb.2(0x40000000)
12    liveins: $r0, $r1, $r2, $v0, $v1, $v2, $v3
13
14    %0:hvxwr = COPY $v0
15    %1:intregs = COPY $r0
16    %2:predregs = C2_cmpgtui %1, 2
17    %3:intregs = COPY $r1
18    %4:intregs = COPY $r2
19    %5:hvxvr = COPY $v1
20    %6:hvxwr = V6_vcombine $v1, $v0
21    %7:hvxqr = IMPLICIT_DEF
22    J2_loop0r %bb.1, %3, implicit-def $lc0, implicit-def $sa0, implicit-def $usr
23    J2_jumpf %2, %bb.2, implicit-def $pc
24    J2_jump %bb.1, implicit-def $pc
25
26  bb.1:
27    successors: %bb.2(0x04000000), %bb.1(0x7c000000)
28
29    %8:hvxwr = COPY %0
30    %9:hvxvr = V6_vL32b_ai %4, 0
31    %10:hvxvr = V6_vL32b_ai %4, 128
32    %5:hvxvr = V6_vaddwq %7, %5, %9
33    %11:hvxqr = V6_vgtuw %10, %0.vsub_lo
34    %12:hvxvr = V6_vL32b_ai %4, 256
35    %13:hvxvr = V6_vL32b_ai %4, 384
36    %5:hvxvr = V6_vaddwq %11, %5, %13
37    %7:hvxqr = V6_vgtuw %6.vsub_hi, %13
38    %0:hvxwr = COPY %8
39    %0:hvxwr = V6_vmpyhv_acc %0, %12, %12
40    %6:hvxwr = COPY %8
41    ENDLOOP0 %bb.1, implicit-def $pc, implicit-def $lc0, implicit $sa0, implicit $lc0
42    J2_jump %bb.2, implicit-def $pc
43
44  bb.2:
45...
46