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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124845 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/X86/dbg-value-range.ll b/test/CodeGen/X86/dbg-value-range.ll
index 4d615d7..ff7f8c6 100644
--- a/test/CodeGen/X86/dbg-value-range.ll
+++ b/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