• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Test that we can write source file names to PDBs and read them back.
2# Because the subsection the file names are stored in is 4-byte
3# aligned, there is a possibility of misaligning the file names. This
4# will cause them to be read back empty or truncated.  To guard
5# against this, we test with two different lengths of file name data
6# that differ by one byte, so that at least one of those will only
7# pass if alignment is implemented correctly.
8
9RUN: rm -rf %t && mkdir -p %t
10RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-1.pdb %p/Inputs/source-names-1.yaml
11RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-1.pdb \
12RUN:     | FileCheck -check-prefix=CHECK1 %s
13RUN: llvm-pdbutil yaml2pdb -pdb=%t/source-names-2.pdb %p/Inputs/source-names-2.yaml
14RUN: llvm-pdbutil pdb2yaml -module-files %t/source-names-2.pdb \
15RUN:     | FileCheck -check-prefix=CHECK2 %s
16
17CHECK1: SourceFiles:
18CHECK1: 'C:\src\test.c'
19
20CHECK2: SourceFiles:
21CHECK2: 'C:\src\test.cc'
22