[clang-tidy][use-internal-linkage]fix false positives for global overloaded operator...
[llvm-project.git] / lld / test / COFF / pdb-invalid-func-type-2.yaml
blob7d47e72640b7306cee6d4f9ef911ef6748017dc5
1 # This test has an S_GPROC32_ID symbol that doesn't refer to an LF_FUNC_ID
2 # record. Make sure we have reasonable behavior.
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 --check-prefix=WARNING
6 # RUN: llvm-pdbutil dump -symbols %t.pdb | FileCheck %s
7 # RUN: lld-link %t.obj -out:%t.exe -debug -debug:ghash -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s --check-prefix=WARNING
8 # RUN: llvm-pdbutil dump -symbols %t.pdb | FileCheck %s
10 # WARNING: warning: procedure symbol record for `main` in {{.*}}.tmp.obj refers to PDB item index 0x{{.*}} which is not a valid function ID record
12 # CHECK: Mod 0000 | `{{.*}}pdb-invalid-func-type{{.*}}.tmp.obj`:
13 # CHECK:      4 | S_GPROC32 [size = 44] `main`
14 # CHECK:          parent = 0, end = 80, addr = 0001:0000, code size = 3
15 # CHECK:          type = `0x0007 (<not translated>)`, debug start = 0, debug end = 2, flags = none
16 # CHECK:     48 | S_FRAMEPROC [size = 32]
17 # CHECK:     80 | S_END [size = 4]
19 --- !COFF
20 header:
21   Machine:         IMAGE_FILE_MACHINE_AMD64
22   Characteristics: [  ]
23 sections:
24   - Name:            '.debug$S'
25     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
26     Alignment:       1
27     Subsections:
28       - !Symbols
29         Records:
30           - Kind:            S_GPROC32_ID
31             ProcSym:
32               CodeSize:        3
33               DbgStart:        0
34               DbgEnd:          2
35               # Refers to the wrong kind of type record (LF_PROCEDURE vs
36               # LF_FUNC_ID).
37               FunctionType:    4097
38               Flags:           [  ]
39               DisplayName:     main
40           - Kind:            S_FRAMEPROC
41             FrameProcSym:
42               TotalFrameBytes: 0
43               PaddingFrameBytes: 0
44               OffsetToPadding: 0
45               BytesOfCalleeSavedRegisters: 0
46               OffsetOfExceptionHandler: 0
47               SectionIdOfExceptionHandler: 0
48               Flags:           [ AsynchronousExceptionHandling, OptimizedForSpeed ]
49           - Kind:            S_PROC_ID_END
50             ScopeEndSym:
51       - !Lines
52         CodeSize:        3
53         Flags:           [  ]
54         RelocOffset:     0
55         RelocSegment:    0
56         Blocks:
57           - FileName:        'c:\src\llvm-project\build\t.c'
58             Lines:
59               - Offset:          0
60                 LineStart:       1
61                 IsStatement:     true
62                 EndDelta:        0
63             Columns:
64       - !FileChecksums
65         Checksums:
66           - FileName:        'c:\src\llvm-project\build\t.c'
67             Kind:            MD5
68             Checksum:        270A878DCC1B845655B162F56C4F5020
69       - !StringTable
70         Strings:
71           - 'c:\src\llvm-project\build\t.c'
72     Relocations:
73       - VirtualAddress:  44
74         SymbolName:      main
75         Type:            IMAGE_REL_AMD64_SECREL
76       - VirtualAddress:  48
77         SymbolName:      main
78         Type:            IMAGE_REL_AMD64_SECTION
79       - VirtualAddress:  100
80         SymbolName:      main
81         Type:            IMAGE_REL_AMD64_SECREL
82       - VirtualAddress:  104
83         SymbolName:      main
84         Type:            IMAGE_REL_AMD64_SECTION
85   - Name:            '.debug$T'
86     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
87     Alignment:       1
88     Types:
89       - Kind:            LF_ARGLIST
90         ArgList:
91           ArgIndices:      [ 0 ]
92       - Kind:            LF_PROCEDURE
93         Procedure:
94           ReturnType:      116
95           CallConv:        NearC
96           Options:         [ None ]
97           ParameterCount:  0
98           ArgumentList:    4096
99       - Kind:            LF_FUNC_ID
100         FuncId:
101           ParentScope:     0
102           FunctionType:    4097
103           Name:            main
104   - Name:            '.text$mn'
105     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
106     Alignment:       16
107     SectionData:     33C0C3
108 symbols:
109   - Name:            '.debug$S'
110     Value:           0
111     SectionNumber:   1
112     SimpleType:      IMAGE_SYM_TYPE_NULL
113     ComplexType:     IMAGE_SYM_DTYPE_NULL
114     StorageClass:    IMAGE_SYM_CLASS_STATIC
115     SectionDefinition:
116       Length:          328
117       NumberOfRelocations: 4
118       NumberOfLinenumbers: 0
119       CheckSum:        0
120       Number:          0
121   - Name:            '.debug$T'
122     Value:           0
123     SectionNumber:   2
124     SimpleType:      IMAGE_SYM_TYPE_NULL
125     ComplexType:     IMAGE_SYM_DTYPE_NULL
126     StorageClass:    IMAGE_SYM_CLASS_STATIC
127     SectionDefinition:
128       Length:          564
129       NumberOfRelocations: 0
130       NumberOfLinenumbers: 0
131       CheckSum:        0
132       Number:          0
133   - Name:            '.text$mn'
134     Value:           0
135     SectionNumber:   3
136     SimpleType:      IMAGE_SYM_TYPE_NULL
137     ComplexType:     IMAGE_SYM_DTYPE_NULL
138     StorageClass:    IMAGE_SYM_CLASS_STATIC
139     SectionDefinition:
140       Length:          3
141       NumberOfRelocations: 0
142       NumberOfLinenumbers: 0
143       CheckSum:        4021952397
144       Number:          0
145   - Name:            main
146     Value:           0
147     SectionNumber:   3
148     SimpleType:      IMAGE_SYM_TYPE_NULL
149     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
150     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL