summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-18 00:11:48 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-18 00:11:48 +0000
commit2a12c4e5bdff047c10c2e8ca3b70e3cd86a8b858 (patch)
treeac6762134947abdd2d010aea1338e81e93e80081 /test
parent1881227389bfb5a39bd47ccc84504d8d81031bf5 (diff)
downloadllvm-2a12c4e5bdff047c10c2e8ca3b70e3cd86a8b858.tar.gz
llvm-2a12c4e5bdff047c10c2e8ca3b70e3cd86a8b858.tar.bz2
llvm-2a12c4e5bdff047c10c2e8ca3b70e3cd86a8b858.tar.xz
DebugInfo: Do not rely on the compilation dir (index 0) for files in line tables shared between compilation units
When emitting assembly there's no support for emitting separate line tables for each compilation unit - so LLVM emits .loc directives producing a single line table. Line tables have an implicit directory (index 0) equal to the compilation directory (DW_AT_comp_dir) of the compilation unit that references them. If multiple compilation units (with possibly disparate compilation directories) reference the same line table, we must avoid relying on this ambiguous directory. Achieve this my simply not setting the compilation directory on the line table when we're in this situation (multiple units while emitting assembly). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/DebugInfo/lto-comp-dir.ll4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/DebugInfo/lto-comp-dir.ll b/test/DebugInfo/lto-comp-dir.ll
index 88d6bf56ae..2637171d6a 100644
--- a/test/DebugInfo/lto-comp-dir.ll
+++ b/test/DebugInfo/lto-comp-dir.ll
@@ -1,4 +1,5 @@
; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=line - | FileCheck %s
+; RUN: %llc_dwarf < %s -filetype=asm | FileCheck --check-prefix=ASM %s
; CHECK: .debug_line contents:
; CHECK-NEXT: Line table prologue:
@@ -11,6 +12,9 @@
; CHECK: file_names[ 1] 0 {{.*}} b.cpp
; CHECK-NOT: file_names
+; ASM: .file 1 "/tmp/dbginfo/a/a.cpp"
+; ASM: .file 2 "/tmp/dbginfo/b/b.cpp"
+
; Generated from the following source compiled to bitcode from within their
; respective directories (with debug info) and linked together with llvm-link