summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86
diff options
context:
space:
mode:
authorScott Linder <scott@scottlinder.com>2018-02-23 23:01:06 +0000
committerScott Linder <scott@scottlinder.com>2018-02-23 23:01:06 +0000
commit16c7bdaf3245d23b9b441144f5efb610e2044927 (patch)
tree870f3b5c5c606b19951cb4433f3887825bc61e56 /llvm/test/DebugInfo/X86
parent5e2f6ba51e89c9b9625902f0c36493ad46e46a3b (diff)
downloadbcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.tar.gz
bcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.zip
[DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. In this extension a content type is added, DW_LNCT_LLVM_source, which contains the embedded source code of the file. Add new optional attribute for !DIFile IR metadata called source which contains source text. Use this to output the source to the DWARF line table of code objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM to support optional source. Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output format of llvm-dwarfdump to make room for the new attribute on file_names entries, and support embedded sources for the -source option in llvm-objdump. Differential Revision: https://reviews.llvm.org/D42765 llvm-svn: 325970
Diffstat (limited to 'llvm/test/DebugInfo/X86')
-rw-r--r--llvm/test/DebugInfo/X86/debug-macro.ll11
-rw-r--r--llvm/test/DebugInfo/X86/dwarfdump-header-64.s12
-rw-r--r--llvm/test/DebugInfo/X86/dwarfdump-header.s35
-rw-r--r--llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s6
-rw-r--r--llvm/test/DebugInfo/X86/dwarfdump-line-only.s12
-rw-r--r--llvm/test/DebugInfo/X86/generate-odr-hash.ll12
-rw-r--r--llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll16
7 files changed, 78 insertions, 26 deletions
diff --git a/llvm/test/DebugInfo/X86/debug-macro.ll b/llvm/test/DebugInfo/X86/debug-macro.ll
index 6a8e6c0690b..e286b8a733e 100644
--- a/llvm/test/DebugInfo/X86/debug-macro.ll
+++ b/llvm/test/DebugInfo/X86/debug-macro.ll
@@ -28,11 +28,12 @@
; CHECK-NEXT: DW_MACINFO_end_file
; CHECK-LABEL: .debug_line contents:
-; CHECK: Dir Mod Time File Len File Name
-; CHECK: file_names[ 1] {{.*}}debug-macro.cpp
-; CHECK: file_names[ 2] {{.*}}debug-macro.h
-; CHECK: Dir Mod Time File Len File Name
-; CHECK: file_names[ 1] {{.*}}debug-macro1.cpp
+; CHECK: file_names[ 1]:
+; CHECK: name: "debug-macro.cpp"
+; CHECK: file_names[ 2]:
+; CHECK: name: "debug-macro.h"
+; CHECK: file_names[ 1]:
+; CHECK: name: "debug-macro1.cpp"
!llvm.dbg.cu = !{!0, !16, !20}
!llvm.module.flags = !{!13, !14}
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
index b0be6f359af..9c0e31098fb 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
@@ -144,6 +144,14 @@ LH_5_end:
# CHECK: include_directories[ 0] = .debug_str[0x00000028] = "Directory5a"
# CHECK: include_directories[ 1] = .debug_str[0x00000034] = "Directory5b"
# CHECK-NOT: include_directories
-# CHECK: file_names[ 0] 0 0x00000051 0x00000052 "File5a"
-# CHECK: file_names[ 1] 1 0x00000053 0x00000054 "File5b"
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: "File5a"
+# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: mod_time: 0x00000051
+# CHECK-NEXT: length: 0x00000052
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: "File5b"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: mod_time: 0x00000053
+# CHECK-NEXT: length: 0x00000054
# CHECK-NOT: file_names
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header.s b/llvm/test/DebugInfo/X86/dwarfdump-header.s
index 87178945082..702c99197a0 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-header.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-header.s
@@ -258,8 +258,16 @@ LH_4_end:
# CHECK: include_directories[ 1] = "Directory4a"
# CHECK: include_directories[ 2] = "Directory4b"
# CHECK-NOT: include_directories
-# CHECK: file_names[ 1] 1 0x00000041 0x00000042 "File4a"
-# CHECK: file_names[ 2] 0 0x00000043 0x00000044 "File4b"
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: "File4a"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: mod_time: 0x00000041
+# CHECK-NEXT: length: 0x00000042
+# CHECK: file_names[ 2]:
+# CHECK-NEXT: name: "File4b"
+# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: mod_time: 0x00000043
+# CHECK-NEXT: length: 0x00000044
# CHECK-NOT: file_names
# DWARF v5 line-table header.
@@ -329,9 +337,14 @@ LH_5_end:
# CHECK: include_directories[ 0] = .debug_str[0x00000045] = "Directory5a"
# CHECK: include_directories[ 1] = .debug_str[0x00000051] = "Directory5b"
# CHECK-NOT: include_directories
-# CHECK: MD5 Checksum
-# CHECK: file_names[ 0] 0 00112233445566778899aabbccddeeff .debug_line_str[0x00000000] = "File5a"
-# CHECK: file_names[ 1] 1 ffeeddccbbaa99887766554433221100 .debug_line_str[0x00000007] = "File5b"
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: .debug_line_str[0x00000000] = "File5a"
+# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: md5_checksum: 00112233445566778899aabbccddeeff
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: .debug_line_str[0x00000007] = "File5b"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: md5_checksum: ffeeddccbbaa99887766554433221100
# CHECK-NOT: file_names
.section .debug_line_str,"MS",@progbits,1
@@ -410,6 +423,14 @@ dwo_LH_5_end:
# CHECK: include_directories[ 0] = .debug_str[0x0000003d] = "DWODirectory5a"
# CHECK: include_directories[ 1] = .debug_str[0x0000004c] = "DWODirectory5b"
# CHECK-NOT: include_directories
-# CHECK: file_names[ 0] 0 0x00000015 0x00000025 "DWOFile5a"
-# CHECK: file_names[ 1] 1 0x00000035 0x00000045 "DWOFile5b"
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: "DWOFile5a"
+# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: mod_time: 0x00000015
+# CHECK-NEXT: length: 0x00000025
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: "DWOFile5b"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: mod_time: 0x00000035
+# CHECK-NEXT: length: 0x00000045
# CHECK-NOT: file_names
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s b/llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s
index 14a6bb6d535..fcce5618de4 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s
@@ -47,7 +47,8 @@ LH_1_end:
# PART1-NEXT: version: 4
# PART1-NEXT: prologue_length: 0x00000028
# PART1: include_directories[ 1] = "Directory1"
-# PART1: file_names[ 1] {{.*}} "File1"
+# PART1: file_names[ 1]
+# PART1: name: "File1"
# Second line table.
LH_2_start:
@@ -93,5 +94,6 @@ LH_2_end:
# PART2-NEXT: prologue_length: 0x00000022
# PART2-NOT: prologue:
# PART2: include_directories[ 1] = "Dir2"
-# PART2: file_names[ 1] {{.*}} "File2"
+# PART2: file_names[ 1]
+# PART2: name: "File2"
# PART2-NOT: prologue:
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-line-only.s b/llvm/test/DebugInfo/X86/dwarfdump-line-only.s
index 4cd7fb9cb1f..e6074c39fe5 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-line-only.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-line-only.s
@@ -94,7 +94,15 @@ ls_F2: .asciz "File2"
# CHECK: include_directories[ 0] = .debug_str[0x00000000] = "Directory1"
# CHECK: include_directories[ 1] = .debug_str[0x0000000b] = "Directory2"
# CHECK-NOT: include_directories
-# CHECK: file_names[ 0] 1 0x00000051 0x00000052 .debug_line_str[0x00000000] = "File1"
-# CHECK: file_names[ 1] 0 0x00000053 0x00000054 .debug_line_str[0x00000006] = "File2"
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: .debug_line_str[0x00000000] = "File1"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: mod_time: 0x00000051
+# CHECK-NEXT: length: 0x00000052
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: .debug_line_str[0x00000006] = "File2"
+# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: mod_time: 0x00000053
+# CHECK-NEXT: length: 0x00000054
# CHECK-NOT: file_names
# CHECK: 0x0000000000000000 {{.*}} is_stmt end_sequence
diff --git a/llvm/test/DebugInfo/X86/generate-odr-hash.ll b/llvm/test/DebugInfo/X86/generate-odr-hash.ll
index c73a6ded135..24d7ffa74c7 100644
--- a/llvm/test/DebugInfo/X86/generate-odr-hash.ll
+++ b/llvm/test/DebugInfo/X86/generate-odr-hash.ll
@@ -122,8 +122,10 @@
; CHECK-LABEL: .debug_line contents:
; CHECK: Line table prologue
; CHECK-NOT: file_names[
-; SINGLE: file_names{{.*}} "bar.h"
-; CHECK: file_names{{.*}} "bar.cpp"
+; SINGLE: file_names[
+; SINGLE-NEXT: name: "bar.h"
+; CHECK: file_names[
+; CHECK-NEXT: name: "bar.cpp"
; CHECK-NOT: file_names[
; FISSION: .debug_line.dwo contents:
@@ -133,8 +135,10 @@
; FISSION-NOT: standard_opcode_lengths
; FISSION-NOT: include_directories
; FISSION-NOT: file_names[
-; FISSION: file_names{{.*}} "bar.h"
-; FISSION: file_names{{.*}} "bar.cpp"
+; FISSION: file_names[
+; FISSION-NEXT: name: "bar.h"
+; FISSION: file_names[
+; FISSION-NEXT: name: "bar.cpp"
; FISSION-NOT: file_names[
; CHECK-LABEL: .debug_str contents:
diff --git a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
index f3c0527bef0..24a886eca72 100644
--- a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
+++ b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
@@ -27,11 +27,15 @@
; CHECK-NEXT: debug_line[{{.*}}]
; CHECK-NEXT: Line table prologue:
; CHECK-NEXT: total_length: 0x00000038
-; CHECK: file_names[ 1] 0 0x00000000 0x00000000 "simple.c"
+; CHECK: file_names[ 1]:
+; CHECK-NEXT: name: "simple.c"
+; CHECK-NEXT: dir_index: 0
; CHECK: debug_line[{{.*}}]
; CHECK-NEXT: Line table prologue:
; CHECK-NEXT: total_length: 0x00000039
-; CHECK: file_names[ 1] 0 0x00000000 0x00000000 "simple2.c"
+; CHECK: file_names[ 1]:
+; CHECK-NEXT: name: "simple2.c"
+; CHECK-NEXT: dir_index: 0
; CHECK-NOT: file_names
; DWARF3: .debug_info contents:
@@ -46,11 +50,15 @@
; DWARF3-NEXT: debug_line[{{.*}}]
; DWARF3-NEXT: Line table prologue:
; DWARF3-NEXT: total_length: 0x00000038
-; DWARF3: file_names[ 1] 0 0x00000000 0x00000000 "simple.c"
+; DWARF3: file_names[ 1]:
+; DWARF3-NEXT: name: "simple.c"
+; DWARF3-NEXT: dir_index: 0
; DWARF3: debug_line[{{.*}}]
; DWARF3-NEXT: Line table prologue:
; DWARF3-NEXT: total_length: 0x00000039
-; DWARF3: file_names[ 1] 0 0x00000000 0x00000000 "simple2.c"
+; DWARF3: file_names[ 1]:
+; DWARF3-NEXT: name: "simple2.c"
+; DWARF3-NEXT: dir_index: 0
; DWARF3-NOT: file_names
; PR15408
OpenPOWER on IntegriCloud