1# Using a trick to run simple-register-coalescing twice, that way
2# liveintervals should be preserved while running the machine verifier.
3#
4# RUN: not --crash llc -o - %s -march=hexagon -hexagon-subreg-liveness=false -run-pass simple-register-coalescing -verify-machineinstrs -run-pass simple-register-coalescing 2>&1 | FileCheck -check-prefix=CHECK-NOSUB %s
5# RUN: not --crash llc -o - %s -march=hexagon -hexagon-subreg-liveness=true -run-pass simple-register-coalescing -verify-machineinstrs -run-pass simple-register-coalescing 2>&1 | FileCheck -check-prefix=CHECK-SUB %s
6
7---
8name: test_pass
9tracksRegLiveness: true
10body: |
11  bb.0:
12    A2_nop implicit-def %0:doubleregs
13    A2_nop implicit-def dead %0.isub_lo, implicit-def %0.isub_hi, implicit %0
14    A2_nop implicit %0.isub_hi
15...
16
17---
18name: test_fail
19tracksRegLiveness: true
20body: |
21  bb.0:
22    A2_nop implicit-def %0:doubleregs
23    A2_nop implicit-def dead %0.isub_lo, implicit-def %0.isub_hi, implicit %0
24    A2_nop implicit %0.isub_lo
25
26    A2_nop implicit-def %1:doubleregs
27    A2_nop implicit-def dead %1.isub_lo, implicit-def dead %1.isub_hi, implicit %1
28    A2_nop implicit %1
29
30    A2_nop implicit-def dead %2:doubleregs
31    A2_nop implicit %2
32
33...
34
35###############################################################################
36# We are expecting four "Bad machine code" when subregister liveness is used.
37#
38# CHECK-SUB-NOT: Bad machine code
39#
40# CHECK-SUB: Bad machine code: Live range continues after dead def flag
41# CHECK_SUB-NEXT: function:    test_fail
42# CHECK-SUB:      v. register: %0
43# CHECK-SUB:      lanemask:    0000000000000002
44#
45# CHECK-SUB-NOT: Bad machine code
46#
47# CHECK-SUB: Bad machine code: Live range continues after dead def flag
48# CHECK-SUB-NEXT: function:    test_fail
49# CHECK-SUB:      v. register: %1
50# CHECK-SUB:      lanemask:    0000000000000002
51#
52# CHECK-SUB-NOT: Bad machine code
53#
54# CHECK-SUB: Bad machine code: Live range continues after dead def flag
55# CHECK-SUB-NEXT: function:    test_fail
56# CHECK-SUB:      v. register: %1
57# CHECK-SUB:      lanemask:    0000000000000001
58#
59# CHECK-SUB: Bad machine code: Live range continues after dead def flag
60# CHECK-SUB-NEXT: function:    test_fail
61# CHECK:          v. register: %2
62#
63# CHECK-SUB-NOT: Bad machine code
64
65###############################################################################
66# Without subregister liveness we only detect one of the failing scenarios.
67#
68# CHECK-NOSUB-NOT: Bad machine code
69#
70# CHECK-NOSUB: Bad machine code: Live range continues after dead def flag
71# CHECK-NOSUB-NEXT: function:    test_fail
72# CHECK:            v. register: %2
73#
74# CHECK-NOSUB-NOT: Bad machine code
75