1# This is an object compiled with /Zi (see the LF_TYPESERVER2 record) without an 2# adjacent type server PDB. Test that LLD fails gracefully on it. 3# Also try linking another OBJ with a reference to the same PDB 4 5# RUN: yaml2obj %s -o %t1.obj 6# RUN: yaml2obj %p/Inputs/pdb-type-server-missing-2.yaml -o %t2.obj 7# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=WARN 8# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug:ghash -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=WARN 9# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=IGNORE -allow-empty 10# RUN: not lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /WX 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=ERR 11# RUN: lld-link %t1.obj %t2.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main /ignore:4099 /WX 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=IGNORE-ERR -allow-empty 12 13# WARN: warning: Cannot use debug info for '{{.*}}.obj' [LNK4099] 14# WARN-NEXT: [[MSG]] 15 16# IGNORE-NOT: warning: Cannot use debug info for '{{.*}}.obj' [LNK4099] 17# IGNORE-NOT: [[MSG]] 18 19# ERR: error: Cannot use debug info for '{{.*}}.obj' [LNK4099] 20# ERR-NEXT: [[MSG]] 21 22# IGNORE-ERR-NOT: error: Cannot use debug info for '{{.*}}.obj' [LNK4099] 23# IGNORE-ERR-NOT: [[MSG]] 24 25--- !COFF 26header: 27 Machine: IMAGE_FILE_MACHINE_AMD64 28 Characteristics: [ ] 29sections: 30 - Name: '.debug$S' 31 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] 32 Alignment: 1 33 Subsections: 34 - !Symbols 35 Records: 36 - Kind: S_GPROC32_ID 37 ProcSym: 38 CodeSize: 3 39 DbgStart: 0 40 DbgEnd: 2 41 FunctionType: 4199 42 Flags: [ ] 43 DisplayName: main 44 - Kind: S_FRAMEPROC 45 FrameProcSym: 46 TotalFrameBytes: 0 47 PaddingFrameBytes: 0 48 OffsetToPadding: 0 49 BytesOfCalleeSavedRegisters: 0 50 OffsetOfExceptionHandler: 0 51 SectionIdOfExceptionHandler: 0 52 Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ] 53 - Kind: S_PROC_ID_END 54 ScopeEndSym: 55 - !Lines 56 CodeSize: 3 57 Flags: [ ] 58 RelocOffset: 0 59 RelocSegment: 0 60 Blocks: 61 - FileName: 'c:\src\llvm-project\build\t.c' 62 Lines: 63 - Offset: 0 64 LineStart: 1 65 IsStatement: true 66 EndDelta: 0 67 Columns: 68 - !FileChecksums 69 Checksums: 70 - FileName: 'c:\src\llvm-project\build\t.c' 71 Kind: MD5 72 Checksum: 270A878DCC1B845655B162F56C4F5020 73 - !StringTable 74 Strings: 75 - 'c:\src\llvm-project\build\t.c' 76 Relocations: 77 - VirtualAddress: 44 78 SymbolName: main 79 Type: IMAGE_REL_AMD64_SECREL 80 - VirtualAddress: 48 81 SymbolName: main 82 Type: IMAGE_REL_AMD64_SECTION 83 - VirtualAddress: 100 84 SymbolName: main 85 Type: IMAGE_REL_AMD64_SECREL 86 - VirtualAddress: 104 87 SymbolName: main 88 Type: IMAGE_REL_AMD64_SECTION 89 - Name: '.debug$T' 90 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] 91 Alignment: 1 92 Types: 93 - Kind: LF_TYPESERVER2 94 TypeServer2: 95 Guid: '{1B19DF01-BF22-426B-96CE-5258B8329FE5}' 96 Age: 18 97 Name: 'C:\src\llvm-project\build\definitely_not_found_for_sure.pdb' 98 - Name: '.text$mn' 99 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] 100 Alignment: 16 101 SectionData: 33C0C3 102symbols: 103 - Name: '.debug$S' 104 Value: 0 105 SectionNumber: 1 106 SimpleType: IMAGE_SYM_TYPE_NULL 107 ComplexType: IMAGE_SYM_DTYPE_NULL 108 StorageClass: IMAGE_SYM_CLASS_STATIC 109 SectionDefinition: 110 Length: 328 111 NumberOfRelocations: 4 112 NumberOfLinenumbers: 0 113 CheckSum: 0 114 Number: 0 115 - Name: '.debug$T' 116 Value: 0 117 SectionNumber: 2 118 SimpleType: IMAGE_SYM_TYPE_NULL 119 ComplexType: IMAGE_SYM_DTYPE_NULL 120 StorageClass: IMAGE_SYM_CLASS_STATIC 121 SectionDefinition: 122 Length: 564 123 NumberOfRelocations: 0 124 NumberOfLinenumbers: 0 125 CheckSum: 0 126 Number: 0 127 - Name: '.text$mn' 128 Value: 0 129 SectionNumber: 3 130 SimpleType: IMAGE_SYM_TYPE_NULL 131 ComplexType: IMAGE_SYM_DTYPE_NULL 132 StorageClass: IMAGE_SYM_CLASS_STATIC 133 SectionDefinition: 134 Length: 3 135 NumberOfRelocations: 0 136 NumberOfLinenumbers: 0 137 CheckSum: 4021952397 138 Number: 0 139 - Name: main 140 Value: 0 141 SectionNumber: 3 142 SimpleType: IMAGE_SYM_TYPE_NULL 143 ComplexType: IMAGE_SYM_DTYPE_FUNCTION 144 StorageClass: IMAGE_SYM_CLASS_EXTERNAL 145... 146