1 //===- llvm/unittest/DebugInfo/PDB/PDBApiTest.cpp -------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include <unordered_map>
11 
12 #include "llvm/ADT/STLExtras.h"
13 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
14 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
15 #include "llvm/DebugInfo/PDB/IPDBSession.h"
16 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
17 #include "llvm/DebugInfo/PDB/IPDBTable.h"
18 
19 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
20 #include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
21 #include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
22 #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
23 #include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
24 #include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
25 #include "llvm/DebugInfo/PDB/PDBSymbolCustom.h"
26 #include "llvm/DebugInfo/PDB/PDBSymbolData.h"
27 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
28 #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
29 #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
30 #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
31 #include "llvm/DebugInfo/PDB/PDBSymbolLabel.h"
32 #include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
33 #include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
34 #include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
35 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
36 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
37 #include "llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h"
38 #include "llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h"
39 #include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
40 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h"
41 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
42 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
43 #include "llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h"
44 #include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
45 #include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
46 #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
47 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
48 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
49 #include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
50 #include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
51 #include "llvm/DebugInfo/PDB/PDBTypes.h"
52 #include "gtest/gtest.h"
53 using namespace llvm;
54 using namespace llvm::pdb;
55 
56 namespace {
57 
58 #define MOCK_SYMBOL_ACCESSOR(Func)                                             \
59   decltype(std::declval<IPDBRawSymbol>().Func()) Func() const override {       \
60     typedef decltype(IPDBRawSymbol::Func()) ReturnType;                        \
61     return ReturnType();                                                       \
62   }
63 
64 class MockSession : public IPDBSession {
65   uint64_t getLoadAddress() const override { return 0; }
66   void setLoadAddress(uint64_t Address) override {}
67   std::unique_ptr<PDBSymbolExe> getGlobalScope() override { return nullptr; }
68   std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override {
69     return nullptr;
70   }
71   std::unique_ptr<IPDBSourceFile>
72   getSourceFileById(uint32_t SymbolId) const override {
73     return nullptr;
74   }
75 
76   std::unique_ptr<PDBSymbol>
77   findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override {
78     return nullptr;
79   }
80   std::unique_ptr<IPDBEnumLineNumbers>
81   findLineNumbers(const PDBSymbolCompiland &Compiland,
82                   const IPDBSourceFile &File) const override {
83     return nullptr;
84   }
85   std::unique_ptr<IPDBEnumLineNumbers>
86   findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override {
87     return nullptr;
88   }
89   std::unique_ptr<IPDBEnumSourceFiles>
90   findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern,
91                   PDB_NameSearchFlags Flags) const override {
92     return nullptr;
93   }
94   std::unique_ptr<IPDBSourceFile>
95   findOneSourceFile(const PDBSymbolCompiland *Compiland,
96                     llvm::StringRef Pattern,
97                     PDB_NameSearchFlags Flags) const override {
98     return nullptr;
99   }
100   std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
101   findCompilandsForSourceFile(llvm::StringRef Pattern,
102                               PDB_NameSearchFlags Flags) const override {
103     return nullptr;
104   }
105   std::unique_ptr<PDBSymbolCompiland>
106   findOneCompilandForSourceFile(llvm::StringRef Pattern,
107                                 PDB_NameSearchFlags Flags) const override {
108     return nullptr;
109   }
110 
111   std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override {
112     return nullptr;
113   }
114   std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
115       const PDBSymbolCompiland &Compiland) const override {
116     return nullptr;
117   }
118 
119   std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override {
120     return nullptr;
121   }
122 
123   std::unique_ptr<IPDBEnumTables> getEnumTables() const override {
124     return nullptr;
125   }
126 };
127 
128 class MockRawSymbol : public IPDBRawSymbol {
129 public:
130   MockRawSymbol(PDB_SymType SymType)
131       : Type(SymType) {}
132 
133   void dump(raw_ostream &OS, int Indent) const override {}
134 
135   std::unique_ptr<IPDBEnumSymbols>
136   findChildren(PDB_SymType Type) const override {
137     return nullptr;
138   }
139   std::unique_ptr<IPDBEnumSymbols>
140   findChildren(PDB_SymType Type, StringRef Name,
141                PDB_NameSearchFlags Flags) const override {
142     return nullptr;
143   }
144   std::unique_ptr<IPDBEnumSymbols>
145   findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
146                     uint32_t RVA) const override {
147     return nullptr;
148   }
149   std::unique_ptr<IPDBEnumSymbols>
150   findInlineFramesByRVA(uint32_t RVA) const override {
151     return nullptr;
152   }
153 
154   void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const override {}
155   void getFrontEndVersion(VersionInfo &Version) const override {}
156   void getBackEndVersion(VersionInfo &Version) const override {}
157 
158   PDB_SymType getSymTag() const override { return Type; }
159 
160   std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const override {
161     return {};
162   }
163 
164   MOCK_SYMBOL_ACCESSOR(getAccess)
165   MOCK_SYMBOL_ACCESSOR(getAddressOffset)
166   MOCK_SYMBOL_ACCESSOR(getAddressSection)
167   MOCK_SYMBOL_ACCESSOR(getAge)
168   MOCK_SYMBOL_ACCESSOR(getArrayIndexTypeId)
169   MOCK_SYMBOL_ACCESSOR(getBaseDataOffset)
170   MOCK_SYMBOL_ACCESSOR(getBaseDataSlot)
171   MOCK_SYMBOL_ACCESSOR(getBaseSymbolId)
172   MOCK_SYMBOL_ACCESSOR(getBuiltinType)
173   MOCK_SYMBOL_ACCESSOR(getBitPosition)
174   MOCK_SYMBOL_ACCESSOR(getCallingConvention)
175   MOCK_SYMBOL_ACCESSOR(getClassParentId)
176   MOCK_SYMBOL_ACCESSOR(getCompilerName)
177   MOCK_SYMBOL_ACCESSOR(getCount)
178   MOCK_SYMBOL_ACCESSOR(getCountLiveRanges)
179   MOCK_SYMBOL_ACCESSOR(getLanguage)
180   MOCK_SYMBOL_ACCESSOR(getLexicalParentId)
181   MOCK_SYMBOL_ACCESSOR(getLibraryName)
182   MOCK_SYMBOL_ACCESSOR(getLiveRangeStartAddressOffset)
183   MOCK_SYMBOL_ACCESSOR(getLiveRangeStartAddressSection)
184   MOCK_SYMBOL_ACCESSOR(getLiveRangeStartRelativeVirtualAddress)
185   MOCK_SYMBOL_ACCESSOR(getLocalBasePointerRegisterId)
186   MOCK_SYMBOL_ACCESSOR(getLowerBoundId)
187   MOCK_SYMBOL_ACCESSOR(getMemorySpaceKind)
188   MOCK_SYMBOL_ACCESSOR(getName)
189   MOCK_SYMBOL_ACCESSOR(getNumberOfAcceleratorPointerTags)
190   MOCK_SYMBOL_ACCESSOR(getNumberOfColumns)
191   MOCK_SYMBOL_ACCESSOR(getNumberOfModifiers)
192   MOCK_SYMBOL_ACCESSOR(getNumberOfRegisterIndices)
193   MOCK_SYMBOL_ACCESSOR(getNumberOfRows)
194   MOCK_SYMBOL_ACCESSOR(getObjectFileName)
195   MOCK_SYMBOL_ACCESSOR(getOemId)
196   MOCK_SYMBOL_ACCESSOR(getOemSymbolId)
197   MOCK_SYMBOL_ACCESSOR(getOffsetInUdt)
198   MOCK_SYMBOL_ACCESSOR(getPlatform)
199   MOCK_SYMBOL_ACCESSOR(getRank)
200   MOCK_SYMBOL_ACCESSOR(getRegisterId)
201   MOCK_SYMBOL_ACCESSOR(getRegisterType)
202   MOCK_SYMBOL_ACCESSOR(getRelativeVirtualAddress)
203   MOCK_SYMBOL_ACCESSOR(getSamplerSlot)
204   MOCK_SYMBOL_ACCESSOR(getSignature)
205   MOCK_SYMBOL_ACCESSOR(getSizeInUdt)
206   MOCK_SYMBOL_ACCESSOR(getSlot)
207   MOCK_SYMBOL_ACCESSOR(getSourceFileName)
208   MOCK_SYMBOL_ACCESSOR(getStride)
209   MOCK_SYMBOL_ACCESSOR(getSubTypeId)
210   MOCK_SYMBOL_ACCESSOR(getSymbolsFileName)
211   MOCK_SYMBOL_ACCESSOR(getSymIndexId)
212   MOCK_SYMBOL_ACCESSOR(getTargetOffset)
213   MOCK_SYMBOL_ACCESSOR(getTargetRelativeVirtualAddress)
214   MOCK_SYMBOL_ACCESSOR(getTargetVirtualAddress)
215   MOCK_SYMBOL_ACCESSOR(getTargetSection)
216   MOCK_SYMBOL_ACCESSOR(getTextureSlot)
217   MOCK_SYMBOL_ACCESSOR(getTimeStamp)
218   MOCK_SYMBOL_ACCESSOR(getToken)
219   MOCK_SYMBOL_ACCESSOR(getTypeId)
220   MOCK_SYMBOL_ACCESSOR(getUavSlot)
221   MOCK_SYMBOL_ACCESSOR(getUndecoratedName)
222   MOCK_SYMBOL_ACCESSOR(getUnmodifiedTypeId)
223   MOCK_SYMBOL_ACCESSOR(getUpperBoundId)
224   MOCK_SYMBOL_ACCESSOR(getVirtualBaseDispIndex)
225   MOCK_SYMBOL_ACCESSOR(getVirtualBaseOffset)
226   MOCK_SYMBOL_ACCESSOR(getVirtualTableShapeId)
227   MOCK_SYMBOL_ACCESSOR(getDataKind)
228   MOCK_SYMBOL_ACCESSOR(getGuid)
229   MOCK_SYMBOL_ACCESSOR(getOffset)
230   MOCK_SYMBOL_ACCESSOR(getThisAdjust)
231   MOCK_SYMBOL_ACCESSOR(getVirtualBasePointerOffset)
232   MOCK_SYMBOL_ACCESSOR(getLocationType)
233   MOCK_SYMBOL_ACCESSOR(getMachineType)
234   MOCK_SYMBOL_ACCESSOR(getThunkOrdinal)
235   MOCK_SYMBOL_ACCESSOR(getLength)
236   MOCK_SYMBOL_ACCESSOR(getVirtualBaseTableType)
237   MOCK_SYMBOL_ACCESSOR(getLiveRangeLength)
238   MOCK_SYMBOL_ACCESSOR(getVirtualAddress)
239   MOCK_SYMBOL_ACCESSOR(getUdtKind)
240   MOCK_SYMBOL_ACCESSOR(hasConstructor)
241   MOCK_SYMBOL_ACCESSOR(hasCustomCallingConvention)
242   MOCK_SYMBOL_ACCESSOR(hasFarReturn)
243   MOCK_SYMBOL_ACCESSOR(isCode)
244   MOCK_SYMBOL_ACCESSOR(isCompilerGenerated)
245   MOCK_SYMBOL_ACCESSOR(isConstType)
246   MOCK_SYMBOL_ACCESSOR(isEditAndContinueEnabled)
247   MOCK_SYMBOL_ACCESSOR(isFunction)
248   MOCK_SYMBOL_ACCESSOR(getAddressTaken)
249   MOCK_SYMBOL_ACCESSOR(getNoStackOrdering)
250   MOCK_SYMBOL_ACCESSOR(hasAlloca)
251   MOCK_SYMBOL_ACCESSOR(hasAssignmentOperator)
252   MOCK_SYMBOL_ACCESSOR(hasCTypes)
253   MOCK_SYMBOL_ACCESSOR(hasCastOperator)
254   MOCK_SYMBOL_ACCESSOR(hasDebugInfo)
255   MOCK_SYMBOL_ACCESSOR(hasEH)
256   MOCK_SYMBOL_ACCESSOR(hasEHa)
257   MOCK_SYMBOL_ACCESSOR(hasFramePointer)
258   MOCK_SYMBOL_ACCESSOR(hasInlAsm)
259   MOCK_SYMBOL_ACCESSOR(hasInlineAttribute)
260   MOCK_SYMBOL_ACCESSOR(hasInterruptReturn)
261   MOCK_SYMBOL_ACCESSOR(hasLongJump)
262   MOCK_SYMBOL_ACCESSOR(hasManagedCode)
263   MOCK_SYMBOL_ACCESSOR(hasNestedTypes)
264   MOCK_SYMBOL_ACCESSOR(hasNoInlineAttribute)
265   MOCK_SYMBOL_ACCESSOR(hasNoReturnAttribute)
266   MOCK_SYMBOL_ACCESSOR(hasOptimizedCodeDebugInfo)
267   MOCK_SYMBOL_ACCESSOR(hasOverloadedOperator)
268   MOCK_SYMBOL_ACCESSOR(hasSEH)
269   MOCK_SYMBOL_ACCESSOR(hasSecurityChecks)
270   MOCK_SYMBOL_ACCESSOR(hasSetJump)
271   MOCK_SYMBOL_ACCESSOR(hasStrictGSCheck)
272   MOCK_SYMBOL_ACCESSOR(isAcceleratorGroupSharedLocal)
273   MOCK_SYMBOL_ACCESSOR(isAcceleratorPointerTagLiveRange)
274   MOCK_SYMBOL_ACCESSOR(isAcceleratorStubFunction)
275   MOCK_SYMBOL_ACCESSOR(isAggregated)
276   MOCK_SYMBOL_ACCESSOR(isIntroVirtualFunction)
277   MOCK_SYMBOL_ACCESSOR(isCVTCIL)
278   MOCK_SYMBOL_ACCESSOR(isConstructorVirtualBase)
279   MOCK_SYMBOL_ACCESSOR(isCxxReturnUdt)
280   MOCK_SYMBOL_ACCESSOR(isDataAligned)
281   MOCK_SYMBOL_ACCESSOR(isHLSLData)
282   MOCK_SYMBOL_ACCESSOR(isHotpatchable)
283   MOCK_SYMBOL_ACCESSOR(isIndirectVirtualBaseClass)
284   MOCK_SYMBOL_ACCESSOR(isInterfaceUdt)
285   MOCK_SYMBOL_ACCESSOR(isIntrinsic)
286   MOCK_SYMBOL_ACCESSOR(isLTCG)
287   MOCK_SYMBOL_ACCESSOR(isLocationControlFlowDependent)
288   MOCK_SYMBOL_ACCESSOR(isMSILNetmodule)
289   MOCK_SYMBOL_ACCESSOR(isMatrixRowMajor)
290   MOCK_SYMBOL_ACCESSOR(isManagedCode)
291   MOCK_SYMBOL_ACCESSOR(isMSILCode)
292   MOCK_SYMBOL_ACCESSOR(isMultipleInheritance)
293   MOCK_SYMBOL_ACCESSOR(isNaked)
294   MOCK_SYMBOL_ACCESSOR(isNested)
295   MOCK_SYMBOL_ACCESSOR(isOptimizedAway)
296   MOCK_SYMBOL_ACCESSOR(isPacked)
297   MOCK_SYMBOL_ACCESSOR(isPointerBasedOnSymbolValue)
298   MOCK_SYMBOL_ACCESSOR(isPointerToDataMember)
299   MOCK_SYMBOL_ACCESSOR(isPointerToMemberFunction)
300   MOCK_SYMBOL_ACCESSOR(isPureVirtual)
301   MOCK_SYMBOL_ACCESSOR(isRValueReference)
302   MOCK_SYMBOL_ACCESSOR(isRefUdt)
303   MOCK_SYMBOL_ACCESSOR(isReference)
304   MOCK_SYMBOL_ACCESSOR(isRestrictedType)
305   MOCK_SYMBOL_ACCESSOR(isReturnValue)
306   MOCK_SYMBOL_ACCESSOR(isSafeBuffers)
307   MOCK_SYMBOL_ACCESSOR(isScoped)
308   MOCK_SYMBOL_ACCESSOR(isSdl)
309   MOCK_SYMBOL_ACCESSOR(isSingleInheritance)
310   MOCK_SYMBOL_ACCESSOR(isSplitted)
311   MOCK_SYMBOL_ACCESSOR(isStatic)
312   MOCK_SYMBOL_ACCESSOR(hasPrivateSymbols)
313   MOCK_SYMBOL_ACCESSOR(isUnalignedType)
314   MOCK_SYMBOL_ACCESSOR(isUnreached)
315   MOCK_SYMBOL_ACCESSOR(isValueUdt)
316   MOCK_SYMBOL_ACCESSOR(isVirtual)
317   MOCK_SYMBOL_ACCESSOR(isVirtualBaseClass)
318   MOCK_SYMBOL_ACCESSOR(isVirtualInheritance)
319   MOCK_SYMBOL_ACCESSOR(isVolatileType)
320   MOCK_SYMBOL_ACCESSOR(getValue)
321   MOCK_SYMBOL_ACCESSOR(wasInlined)
322   MOCK_SYMBOL_ACCESSOR(getUnused)
323 
324 private:
325   PDB_SymType Type;
326 };
327 
328 class PDBApiTest : public testing::Test {
329 public:
330   std::unordered_map<PDB_SymType, std::unique_ptr<PDBSymbol>> SymbolMap;
331 
332   void SetUp() override {
333     Session.reset(new MockSession());
334 
335     InsertItemWithTag(PDB_SymType::None);
336     InsertItemWithTag(PDB_SymType::Exe);
337     InsertItemWithTag(PDB_SymType::Compiland);
338     InsertItemWithTag(PDB_SymType::CompilandDetails);
339     InsertItemWithTag(PDB_SymType::CompilandEnv);
340     InsertItemWithTag(PDB_SymType::Function);
341     InsertItemWithTag(PDB_SymType::Block);
342     InsertItemWithTag(PDB_SymType::Data);
343     InsertItemWithTag(PDB_SymType::Annotation);
344     InsertItemWithTag(PDB_SymType::Label);
345     InsertItemWithTag(PDB_SymType::PublicSymbol);
346     InsertItemWithTag(PDB_SymType::UDT);
347     InsertItemWithTag(PDB_SymType::Enum);
348     InsertItemWithTag(PDB_SymType::FunctionSig);
349     InsertItemWithTag(PDB_SymType::PointerType);
350     InsertItemWithTag(PDB_SymType::ArrayType);
351     InsertItemWithTag(PDB_SymType::BuiltinType);
352     InsertItemWithTag(PDB_SymType::Typedef);
353     InsertItemWithTag(PDB_SymType::BaseClass);
354     InsertItemWithTag(PDB_SymType::Friend);
355     InsertItemWithTag(PDB_SymType::FunctionArg);
356     InsertItemWithTag(PDB_SymType::FuncDebugStart);
357     InsertItemWithTag(PDB_SymType::FuncDebugEnd);
358     InsertItemWithTag(PDB_SymType::UsingNamespace);
359     InsertItemWithTag(PDB_SymType::VTableShape);
360     InsertItemWithTag(PDB_SymType::VTable);
361     InsertItemWithTag(PDB_SymType::Custom);
362     InsertItemWithTag(PDB_SymType::Thunk);
363     InsertItemWithTag(PDB_SymType::CustomType);
364     InsertItemWithTag(PDB_SymType::ManagedType);
365     InsertItemWithTag(PDB_SymType::Dimension);
366     InsertItemWithTag(PDB_SymType::Max);
367   }
368 
369   template <class ExpectedType> void VerifyDyncast(PDB_SymType Tag) {
370     for (auto item = SymbolMap.begin(); item != SymbolMap.end(); ++item) {
371       EXPECT_EQ(item->first == Tag, llvm::isa<ExpectedType>(*item->second));
372     }
373   }
374 
375   void VerifyUnknownDyncasts() {
376     for (auto item = SymbolMap.begin(); item != SymbolMap.end(); ++item) {
377       bool should_match = false;
378       if (item->first == PDB_SymType::None || item->first >= PDB_SymType::Max)
379         should_match = true;
380 
381       EXPECT_EQ(should_match, llvm::isa<PDBSymbolUnknown>(*item->second));
382     }
383   }
384 
385 private:
386   std::unique_ptr<IPDBSession> Session;
387 
388   void InsertItemWithTag(PDB_SymType Tag) {
389     auto RawSymbol = llvm::make_unique<MockRawSymbol>(Tag);
390     auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol));
391     SymbolMap.insert(std::make_pair(Tag, std::move(Symbol)));
392   }
393 };
394 
395 TEST_F(PDBApiTest, Dyncast) {
396 
397   // Most of the types have a one-to-one mapping between Tag and concrete type.
398   VerifyDyncast<PDBSymbolExe>(PDB_SymType::Exe);
399   VerifyDyncast<PDBSymbolCompiland>(PDB_SymType::Compiland);
400   VerifyDyncast<PDBSymbolCompilandDetails>(PDB_SymType::CompilandDetails);
401   VerifyDyncast<PDBSymbolCompilandEnv>(PDB_SymType::CompilandEnv);
402   VerifyDyncast<PDBSymbolFunc>(PDB_SymType::Function);
403   VerifyDyncast<PDBSymbolBlock>(PDB_SymType::Block);
404   VerifyDyncast<PDBSymbolData>(PDB_SymType::Data);
405   VerifyDyncast<PDBSymbolAnnotation>(PDB_SymType::Annotation);
406   VerifyDyncast<PDBSymbolLabel>(PDB_SymType::Label);
407   VerifyDyncast<PDBSymbolPublicSymbol>(PDB_SymType::PublicSymbol);
408   VerifyDyncast<PDBSymbolTypeUDT>(PDB_SymType::UDT);
409   VerifyDyncast<PDBSymbolTypeEnum>(PDB_SymType::Enum);
410   VerifyDyncast<PDBSymbolTypeFunctionSig>(PDB_SymType::FunctionSig);
411   VerifyDyncast<PDBSymbolTypePointer>(PDB_SymType::PointerType);
412   VerifyDyncast<PDBSymbolTypeArray>(PDB_SymType::ArrayType);
413   VerifyDyncast<PDBSymbolTypeBuiltin>(PDB_SymType::BuiltinType);
414   VerifyDyncast<PDBSymbolTypeTypedef>(PDB_SymType::Typedef);
415   VerifyDyncast<PDBSymbolTypeBaseClass>(PDB_SymType::BaseClass);
416   VerifyDyncast<PDBSymbolTypeFriend>(PDB_SymType::Friend);
417   VerifyDyncast<PDBSymbolTypeFunctionArg>(PDB_SymType::FunctionArg);
418   VerifyDyncast<PDBSymbolFuncDebugStart>(PDB_SymType::FuncDebugStart);
419   VerifyDyncast<PDBSymbolFuncDebugEnd>(PDB_SymType::FuncDebugEnd);
420   VerifyDyncast<PDBSymbolUsingNamespace>(PDB_SymType::UsingNamespace);
421   VerifyDyncast<PDBSymbolTypeVTableShape>(PDB_SymType::VTableShape);
422   VerifyDyncast<PDBSymbolTypeVTable>(PDB_SymType::VTable);
423   VerifyDyncast<PDBSymbolCustom>(PDB_SymType::Custom);
424   VerifyDyncast<PDBSymbolThunk>(PDB_SymType::Thunk);
425   VerifyDyncast<PDBSymbolTypeCustom>(PDB_SymType::CustomType);
426   VerifyDyncast<PDBSymbolTypeManaged>(PDB_SymType::ManagedType);
427   VerifyDyncast<PDBSymbolTypeDimension>(PDB_SymType::Dimension);
428 
429   VerifyUnknownDyncasts();
430 }
431 
432 } // end anonymous namespace
433