1 # RUN: llc -run-pass=twoaddressinstruction -mtriple=x86_64-- -o - %s -experimental-debug-variable-locations | FileCheck %s
3 # REQUIRES: x86-registered-target
5 # Test that a new instruction (LEA) is created when the two-addr add below is
6 # converted to three address; and that an appropriate substitution is created.
7 # Maybe at some point we'll normalise DBG_INSTR_REFs on output, but until then,
10 # CHECK: debugValueSubstitutions:
11 # CHECK-NEXT: - { srcinst: 1, srcop: 0, dstinst: 2, dstop: 0, subreg: 0 }
14 # CHECK-SAME: debug-instr-number 2
16 # CHECK: DBG_INSTR_REF dbg-instr-ref(1, 0)
20 tracksRegLiveness: true
23 - { id: 0, class: gr32 }
24 - { id: 1, class: gr32 }
25 - { id: 2, class: gr32 }
27 - { reg: '$edi', virtual-reg: '%0' }
30 machineFunctionInfo: {}
35 %0:gr32 = COPY killed $edi
36 %1:gr32 = SHL32ri killed %0, 5, implicit-def dead $eflags
37 %2:gr32 = ADD32ri_DB killed %1, 3, implicit-def dead $eflags, debug-instr-number 1
38 DBG_INSTR_REF dbg-instr-ref(1, 0)