Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / pdb-type-server-invalid-signature.yaml
blob87c43676848455c79a940c979fd504d5d6645ea5
2 # Test linking an OBJ with a reference to an out-of-date PDB type server
3 # RUN: cd %S/Inputs
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
7 # RUN: cd %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
13 # RUN: cd %S/Inputs
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
16 # RUN: cd %S
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
29 --- !COFF
30 header:
31   Machine:         IMAGE_FILE_MACHINE_AMD64
32   Characteristics: [  ]
33 sections:
34   - Name:            '.debug$S'
35     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
36     Alignment:       1
37     Subsections:
38       - !Symbols
39         Records:
40           - Kind:            S_GPROC32_ID
41             ProcSym:
42               CodeSize:        3
43               DbgStart:        0
44               DbgEnd:          2
45               FunctionType:    4199
46               Flags:           [  ]
47               DisplayName:     main
48           - Kind:            S_FRAMEPROC
49             FrameProcSym:
50               TotalFrameBytes: 0
51               PaddingFrameBytes: 0
52               OffsetToPadding: 0
53               BytesOfCalleeSavedRegisters: 0
54               OffsetOfExceptionHandler: 0
55               SectionIdOfExceptionHandler: 0
56               Flags:           [ AsynchronousExceptionHandling, OptimizedForSpeed ]
57           - Kind:            S_PROC_ID_END
58             ScopeEndSym:
59       - !Lines
60         CodeSize:        3
61         Flags:           [  ]
62         RelocOffset:     0
63         RelocSegment:    0
64         Blocks:
65           - FileName:        'c:\src\llvm-project\build\t.c'
66             Lines:
67               - Offset:          0
68                 LineStart:       1
69                 IsStatement:     true
70                 EndDelta:        0
71             Columns:
72       - !FileChecksums
73         Checksums:
74           - FileName:        'c:\src\llvm-project\build\t.c'
75             Kind:            MD5
76             Checksum:        270A878DCC1B845655B162F56C4F5020
77       - !StringTable
78         Strings:
79           - 'c:\src\llvm-project\build\t.c'
80     Relocations:
81       - VirtualAddress:  44
82         SymbolName:      main
83         Type:            IMAGE_REL_AMD64_SECREL
84       - VirtualAddress:  48
85         SymbolName:      main
86         Type:            IMAGE_REL_AMD64_SECTION
87       - VirtualAddress:  100
88         SymbolName:      main
89         Type:            IMAGE_REL_AMD64_SECREL
90       - VirtualAddress:  104
91         SymbolName:      main
92         Type:            IMAGE_REL_AMD64_SECTION
93   - Name:            '.debug$T'
94     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
95     Alignment:       1
96     Types:
97       - Kind:            LF_TYPESERVER2
98         TypeServer2:
99           Guid:            '{1B19DF01-BF22-426B-96CE-5258B8329FE5}'
100           Age:             18
101           Name:            'pdb-diff-cl.pdb'
102   - Name:            '.text$mn'
103     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
104     Alignment:       16
105     SectionData:     33C0C3
106 symbols:
107   - Name:            '.debug$S'
108     Value:           0
109     SectionNumber:   1
110     SimpleType:      IMAGE_SYM_TYPE_NULL
111     ComplexType:     IMAGE_SYM_DTYPE_NULL
112     StorageClass:    IMAGE_SYM_CLASS_STATIC
113     SectionDefinition:
114       Length:          328
115       NumberOfRelocations: 4
116       NumberOfLinenumbers: 0
117       CheckSum:        0
118       Number:          0
119   - Name:            '.debug$T'
120     Value:           0
121     SectionNumber:   2
122     SimpleType:      IMAGE_SYM_TYPE_NULL
123     ComplexType:     IMAGE_SYM_DTYPE_NULL
124     StorageClass:    IMAGE_SYM_CLASS_STATIC
125     SectionDefinition:
126       Length:          564
127       NumberOfRelocations: 0
128       NumberOfLinenumbers: 0
129       CheckSum:        0
130       Number:          0
131   - Name:            '.text$mn'
132     Value:           0
133     SectionNumber:   3
134     SimpleType:      IMAGE_SYM_TYPE_NULL
135     ComplexType:     IMAGE_SYM_DTYPE_NULL
136     StorageClass:    IMAGE_SYM_CLASS_STATIC
137     SectionDefinition:
138       Length:          3
139       NumberOfRelocations: 0
140       NumberOfLinenumbers: 0
141       CheckSum:        4021952397
142       Number:          0
143   - Name:            main
144     Value:           0
145     SectionNumber:   3
146     SimpleType:      IMAGE_SYM_TYPE_NULL
147     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
148     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL