summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-06-20 21:19:22 +0000
committerReid Kleckner <rnk@google.com>2017-06-20 21:19:22 +0000
commit91ef9de643e9a7043bcf88599882e6d8345d46cf (patch)
tree5e5e886ce94d945d1a634b42c61134ab7ca45567 /llvm/test/DebugInfo
parent4d121e21823cf0b2c53829e1e2889582754f1ab9 (diff)
downloadbcm5719-llvm-91ef9de643e9a7043bcf88599882e6d8345d46cf.tar.gz
bcm5719-llvm-91ef9de643e9a7043bcf88599882e6d8345d46cf.zip
[codeview] YAMLize all section offsets and indices in symbol records
We forgot to serialize these because llvm-readobj didn't dump them. They are typically all zeros in an object file. The linker fills them in with relocations before adding them to the PDB. Now we can properly round trip these symbols through pdb2yaml -> yaml2pdb. I made these fields optional with a zero default so that we can elide them from our test cases. llvm-svn: 305857
Diffstat (limited to 'llvm/test/DebugInfo')
-rw-r--r--llvm/test/DebugInfo/COFF/globals.ll38
-rw-r--r--llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test3
2 files changed, 40 insertions, 1 deletions
diff --git a/llvm/test/DebugInfo/COFF/globals.ll b/llvm/test/DebugInfo/COFF/globals.ll
index aadf6ab557f..0d1b9413e3d 100644
--- a/llvm/test/DebugInfo/COFF/globals.ll
+++ b/llvm/test/DebugInfo/COFF/globals.ll
@@ -1,5 +1,6 @@
; RUN: llc < %s | FileCheck %s --check-prefix=ASM
; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s --check-prefix=OBJ
+; RUN: llc < %s -filetype=obj | obj2yaml | FileCheck %s --check-prefix=YAML
; C++ source to regenerate:
; $ cat t.cpp
@@ -109,6 +110,43 @@
; OBJ: ]
; OBJ: ]
+; YAML-LABEL: - Name: '.debug$S'
+; YAML: Subsections:
+; YAML: - !Symbols
+; YAML: Records:
+; YAML: - Kind: S_COMPILE3
+; YAML: Compile3Sym:
+; YAML: - !Symbols
+; YAML: Records:
+; YAML: - Kind: S_LDATA32
+; YAML: DataSym:
+; YAML-NOT: Segment
+; YAML: Type: 116
+; YAML-NOT: Segment
+; YAML: DisplayName: first
+; YAML-NOT: Segment
+; YAML: - Kind: S_GTHREAD32
+; YAML: ThreadLocalDataSym:
+; YAML: Type: 4097
+; YAML: DisplayName: middle
+; YAML: - Kind: S_GDATA32
+; YAML: DataSym:
+; YAML-NOT: Segment
+; YAML: Type: 116
+; YAML-NOT: Offset
+; YAML-NOT: Segment
+; YAML: DisplayName: last
+; YAML-NOT: Segment
+
+; The missing offsets are represented as relocations against this section.
+; YAML: Relocations:
+; YAML: - VirtualAddress: 92
+; YAML: SymbolName: '?first@@3HA'
+; YAML: Type: IMAGE_REL_AMD64_SECREL
+; YAML: - VirtualAddress: 96
+; YAML: SymbolName: '?first@@3HA'
+; YAML: Type: IMAGE_REL_AMD64_SECTION
+
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
diff --git a/llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test b/llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test
index 574065176b5..7afa1c3b2a7 100644
--- a/llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test
+++ b/llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test
@@ -55,6 +55,7 @@ YAML: CodeSize: 10
YAML: DbgStart: 3
YAML: DbgEnd: 8
YAML: FunctionType: 4097
+YAML: Offset: 16
YAML: Segment: 1
YAML: Flags: [ HasFP ]
YAML: DisplayName: main
@@ -178,4 +179,4 @@ YAML: Rva: 20480
YAML: Length: 8
YAML: Characteristics: 1107296320
YAML: Name: .reloc
-YAML: ... \ No newline at end of file
+YAML: ...
OpenPOWER on IntegriCloud