1 # RUN: llc -mtriple=avr -mattr=+elpm -mattr=+elpmx -start-before=greedy %s -o - \
3 # RUN: llc -mtriple=avr -mattr=+elpm -mattr=-elpmx -start-before=greedy %s -o - \
4 # RUN: | FileCheck --check-prefix=NOX %s
6 # This test checks the expansion of the 16-bit ELPM pseudo instruction and that
7 # the register allocator won't use R31R30 as an output register (which would
8 # lead to undefined behavior).
11 target triple = "avr--"
12 define void @test_elpmbrdz() {
20 tracksRegLiveness: true
25 ; CHECK-LABEL: test_elpmbrdz
27 ; CHECK-NEXT: ldi r24, 1
29 ; CHECK-NEXT: elpm r31, Z
32 ; NOX-LABEL: test_elpmbrdz
34 ; NOX-NEXT: ldi r24, 1
37 ; NOX-NEXT: mov r31, r0
40 %1:zreg = COPY killed $r31r30
42 %3:gpr8 = ELPMBRdZ %1, %2, implicit-def dead $r0