DebugLoc associated with a machine instruction is used to emit location entries. DebugLoc associated with a DBG_VALUE is used to identify lexical scope of the variable. After register allocation, while inserting DBG_VALUE remember original debug location for the first instruction and reuse it, otherwise dwarf writer may be mislead in identifying the variable's scope.
llvm-svn: 124845
diff --git a/llvm/test/CodeGen/X86/dbg-value-range.ll b/llvm/test/CodeGen/X86/dbg-value-range.ll
index 4d615d7..ff7f8c6 100644
--- a/llvm/test/CodeGen/X86/dbg-value-range.ll
+++ b/llvm/test/CodeGen/X86/dbg-value-range.ll
@@ -44,12 +44,12 @@
; check that variable bar:b value range is appropriately trucated in debug info. Here Ltmp5 is end of
; location range.
-;CHECK:Ltmp5
+;CHECK:Ltmp7
;CHECK-NEXT: DEBUG_VALUE: bar:b <- undef
;CHECK:Ldebug_loc0:
;CHECK-NEXT: .quad Ltmp
-;CHECK-NEXT: .quad Ltmp5
+;CHECK-NEXT: .quad Ltmp7
;CHECK-NEXT: .short 1
;CHECK-NEXT: .byte 85
;CHECK-NEXT: .quad 0