1# RUN: llc -mtriple=avr -mattr=+elpm -mattr=+elpmx -start-before=greedy %s -o - \ 2# RUN: | FileCheck %s 3# RUN: llc -mtriple=avr -mattr=+elpm -mattr=-elpmx -start-before=greedy %s -o - \ 4# RUN: | FileCheck --check-prefix=NOX %s 5 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). 9 10--- | 11 target triple = "avr--" 12 define void @test_elpmbrdz() { 13 entry: 14 ret void 15 } 16... 17 18--- 19name: test_elpmbrdz 20tracksRegLiveness: true 21body: | 22 bb.0.entry: 23 liveins: $r31r30 24 25 ; CHECK-LABEL: test_elpmbrdz 26 ; CHECK: ; %bb.0: 27 ; CHECK-NEXT: ldi r24, 1 28 ; CHECK-NEXT: out 29 ; CHECK-NEXT: elpm r31, Z 30 ; CHECK-NEXT: ret 31 32 ; NOX-LABEL: test_elpmbrdz 33 ; NOX: ; %bb.0: 34 ; NOX-NEXT: ldi r24, 1 35 ; NOX-NEXT: out 36 ; NOX-NEXT: elpm 37 ; NOX-NEXT: mov r31, r0 38 ; NOX-NEXT: ret 39 40 %1:zreg = COPY killed $r31r30 41 %2:ld8 = LDIRdK 1 42 %3:gpr8 = ELPMBRdZ %1, %2, implicit-def dead $r0 43 $r31 = COPY %3 44 RET implicit $r31 45... 46