diff options
author | Bob Haarman <llvm@inglorion.net> | 2017-05-25 21:12:15 +0000 |
---|---|---|
committer | Bob Haarman <llvm@inglorion.net> | 2017-05-25 21:12:15 +0000 |
commit | 55256ada254f08bd86b4baa912eb1339af205ed6 (patch) | |
tree | 66305e1280859e5604fb9fabf538260b5c7f6279 /llvm/test/DebugInfo/PDB/pdbdump-source-names.test | |
parent | c4e4b7e31e8efc917352286aa6e22d78b659d44d (diff) | |
download | bcm5719-llvm-55256ada254f08bd86b4baa912eb1339af205ed6.tar.gz bcm5719-llvm-55256ada254f08bd86b4baa912eb1339af205ed6.zip |
[pdb] pad source file name buffer at the end instead of the beginning
Summary:
DbiStreamBuilder calculated the offset of the source file names inside
the file info substream as the size of the file info substream minus
the size of the file names. Since the file info substream is padded to
a multiple of 4 bytes, this caused the first file name to be aligned
on a 4-byte boundary. By contrast, DbiModuleList would read the file
names immediately after the file name offset table, without skipping
to the next 4-byte boundary. This change makes it so that the file
names are written to the location where DbiModuleList expects them,
and puts any necessary padding for the file info substream after the
file names instead of before it.
Reviewers: amccarth, rnk, zturner
Reviewed By: amccarth, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33475
llvm-svn: 303917
Diffstat (limited to 'llvm/test/DebugInfo/PDB/pdbdump-source-names.test')
-rw-r--r-- | llvm/test/DebugInfo/PDB/pdbdump-source-names.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/PDB/pdbdump-source-names.test b/llvm/test/DebugInfo/PDB/pdbdump-source-names.test new file mode 100644 index 00000000000..181f4d5e0ee --- /dev/null +++ b/llvm/test/DebugInfo/PDB/pdbdump-source-names.test @@ -0,0 +1,20 @@ +# Test that we can write source file names to PDBs and read them back. +# Because the subsection the file names are stored in is 4-byte +# aligned, there is a possibility of misaligning the file names. This +# will cause them to be read back empty or truncated. To guard +# against this, we test with two different lengths of file name data +# that differ by one byte, so that at least one of those will only +# pass if alignment is implemented correctly. + +RUN: llvm-pdbdump yaml2pdb -pdb=%T/source-names-1.pdb %p/Inputs/source-names-1.yaml +RUN: llvm-pdbdump pdb2yaml -dbi-module-source-info %T/source-names-1.pdb \ +RUN: | FileCheck -check-prefix=CHECK1 %s +RUN: llvm-pdbdump yaml2pdb -pdb=%T/source-names-2.pdb %p/Inputs/source-names-2.yaml +RUN: llvm-pdbdump pdb2yaml -dbi-module-source-info %T/source-names-2.pdb \ +RUN: | FileCheck -check-prefix=CHECK2 %s + +CHECK1: SourceFiles: +CHECK1: 'C:\src\test.c' + +CHECK2: SourceFiles: +CHECK2: 'C:\src\test.cc' |