2 # Test linking an OBJ with a reference to an out-of-date PDB type server
4 # RUN: yaml2obj %s -o %t.obj
5 # RUN: lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s
6 # RUN: lld-link %t.obj -out:%t.exe -debug:ghash -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s
9 # CHECK: warning: Cannot use debug info for '{{.*}}.obj'
10 # CHECK-NEXT: The signature does not match; the file(s) might be out of date
12 # Also test linking an OBJ with a reference to *valid* PDB type server
14 # RUN: yaml2obj %S/Inputs/pdb-type-server-valid-signature.yaml -o %t2.obj
15 # RUN: lld-link %t2.obj -out:%t2.exe -debug -pdb:%t2.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=VALID-SIGNATURE -allow-empty
18 # VALID-SIGNATURE-NOT: warning: Cannot use debug info for '{{.*}}.obj'
19 # VALID-SIGNATURE-NOT: The signature does not match; the file(s) might be out of date
21 # Test an invalid path reference to a PDB type server; as a fallback LLD should try to load the PDB in the same path as the OBJ
22 # RUN: yaml2obj %S/Inputs/pdb-type-server-invalid-path.yaml -o %t3.obj
23 # RUN: cp %S/Inputs/pdb-diff-cl.pdb %T
24 # RUN: lld-link %t3.obj -out:%t3.exe -debug -pdb:%t3.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID-PATH -allow-empty
26 # INVALID-PATH-NOT: warning: Cannot use debug info for '{{.*}}3.obj' [LNK4099]
\r
27 # INVALID-PATH-NOT: failed to load reference 'c:\some_invalid_path_AABB98765\pdb-diff-cl.pdb': [[MSG]]
\r
31 Machine: IMAGE_FILE_MACHINE_AMD64
35 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
53 BytesOfCalleeSavedRegisters: 0
54 OffsetOfExceptionHandler: 0
55 SectionIdOfExceptionHandler: 0
56 Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ]
65 - FileName: 'c:\src\llvm-project\build\t.c'
74 - FileName: 'c:\src\llvm-project\build\t.c'
76 Checksum: 270A878DCC1B845655B162F56C4F5020
79 - 'c:\src\llvm-project\build\t.c'
83 Type: IMAGE_REL_AMD64_SECREL
86 Type: IMAGE_REL_AMD64_SECTION
89 Type: IMAGE_REL_AMD64_SECREL
92 Type: IMAGE_REL_AMD64_SECTION
94 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
97 - Kind: LF_TYPESERVER2
99 Guid: '{1B19DF01-BF22-426B-96CE-5258B8329FE5}'
101 Name: 'pdb-diff-cl.pdb'
103 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
110 SimpleType: IMAGE_SYM_TYPE_NULL
111 ComplexType: IMAGE_SYM_DTYPE_NULL
112 StorageClass: IMAGE_SYM_CLASS_STATIC
115 NumberOfRelocations: 4
116 NumberOfLinenumbers: 0
122 SimpleType: IMAGE_SYM_TYPE_NULL
123 ComplexType: IMAGE_SYM_DTYPE_NULL
124 StorageClass: IMAGE_SYM_CLASS_STATIC
127 NumberOfRelocations: 0
128 NumberOfLinenumbers: 0
134 SimpleType: IMAGE_SYM_TYPE_NULL
135 ComplexType: IMAGE_SYM_DTYPE_NULL
136 StorageClass: IMAGE_SYM_CLASS_STATIC
139 NumberOfRelocations: 0
140 NumberOfLinenumbers: 0
146 SimpleType: IMAGE_SYM_TYPE_NULL
147 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
148 StorageClass: IMAGE_SYM_CLASS_EXTERNAL