#include "llvm/DebugInfo/CodeView/TypeIndexDiscovery.h"
#include "llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h"
#include "llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h"
#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
#include "llvm/Support/Allocator.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
usingnamespacellvm;
usingnamespacellvm::codeview;
class TypeIndexIteratorTest : public testing::Test { … };
namespace leafs {
static FuncIdRecord FuncId(TypeIndex(1), TypeIndex(2), "FuncId");
static MemberFuncIdRecord MemFuncId(TypeIndex(3), TypeIndex(4), "FuncId");
static StringIdRecord StringId(TypeIndex(5), "TheString");
static struct { … } StringList;
static struct { … } BuildInfo;
static UdtSourceLineRecord UdtSourceLine(TypeIndex(12), TypeIndex(13), 0);
static UdtModSourceLineRecord UdtModSourceLine(TypeIndex(14), TypeIndex(15), 0,
0);
static ModifierRecord Modifier(TypeIndex(16), ModifierOptions::None);
static ProcedureRecord Procedure(TypeIndex(17), CallingConvention::PpcCall,
FunctionOptions::None, 0, TypeIndex(18));
static MemberFunctionRecord MemberFunction(TypeIndex(19), TypeIndex(20),
TypeIndex(21),
CallingConvention::ThisCall,
FunctionOptions::None, 2,
TypeIndex(22), 0);
static struct { … } ArgList;
static ArrayRecord Array(TypeIndex(26), TypeIndex(27), 10, "MyArray");
static ClassRecord Class(TypeRecordKind::Class, 3, ClassOptions::None,
TypeIndex(28), TypeIndex(29), TypeIndex(30), 10,
"MyClass", "MyClassUniqueName");
static ClassRecord Struct(TypeRecordKind::Struct, 3, ClassOptions::None,
TypeIndex(31), TypeIndex(32), TypeIndex(33), 10,
"MyClass", "MyClassUniqueName");
static UnionRecord Union(1, ClassOptions::None, TypeIndex(34), 10, "MyUnion",
"MyUnionUniqueName");
static EnumRecord Enum(1, ClassOptions::None, TypeIndex(35), "MyEnum",
"EnumUniqueName", TypeIndex(36));
static BitFieldRecord BitField(TypeIndex(37), 1, 0);
static VFTableRecord VFTable(TypeIndex(38), TypeIndex(39), 1, "VFT", { … });
static VFTableShapeRecord VTableShape({ … });
static struct { … } MethodOverloadList;
static PointerRecord Pointer(TypeIndex(44), PointerKind::Near32,
PointerMode::Pointer, PointerOptions::Const, 3);
static PointerRecord MemberPointer(
TypeIndex(45), PointerKind::Near32, PointerMode::PointerToDataMember,
PointerOptions::Const, 3,
MemberPointerInfo(TypeIndex(46),
PointerToMemberRepresentation::GeneralData));
}
namespace members {
static BaseClassRecord BaseClass(MemberAccess::Public, TypeIndex(47), 0);
static EnumeratorRecord Enumerator(MemberAccess::Public,
APSInt(APInt(8, 3, false)), "Test");
DataMemberRecord DataMember(MemberAccess::Public, TypeIndex(48), 0, "Test");
OverloadedMethodRecord OverloadedMethod(3, TypeIndex(49), "MethodList");
static struct { … } OneMethod;
static NestedTypeRecord NestedType(TypeIndex(54), "MyClass");
static StaticDataMemberRecord StaticDataMember(MemberAccess::Public,
TypeIndex(55), "Foo");
static VirtualBaseClassRecord VirtualBaseClass(TypeRecordKind::VirtualBaseClass,
MemberAccess::Public,
TypeIndex(56), TypeIndex(57), 0,
0);
static VFPtrRecord VFPtr(TypeIndex(58));
static ListContinuationRecord Continuation(TypeIndex(59));
}
TEST_F(TypeIndexIteratorTest, FuncId) { … }
TEST_F(TypeIndexIteratorTest, MemFuncId) { … }
TEST_F(TypeIndexIteratorTest, StringId) { … }
TEST_F(TypeIndexIteratorTest, SubstrList) { … }
TEST_F(TypeIndexIteratorTest, BuildInfo) { … }
TEST_F(TypeIndexIteratorTest, UdtSrcLine) { … }
TEST_F(TypeIndexIteratorTest, UdtModSrcLine) { … }
TEST_F(TypeIndexIteratorTest, Modifier) { … }
TEST_F(TypeIndexIteratorTest, Procedure) { … }
TEST_F(TypeIndexIteratorTest, MemFunc) { … }
TEST_F(TypeIndexIteratorTest, ArgList) { … }
TEST_F(TypeIndexIteratorTest, Array) { … }
TEST_F(TypeIndexIteratorTest, Class) { … }
TEST_F(TypeIndexIteratorTest, Struct) { … }
TEST_F(TypeIndexIteratorTest, Union) { … }
TEST_F(TypeIndexIteratorTest, Enum) { … }
TEST_F(TypeIndexIteratorTest, Bitfield) { … }
TEST_F(TypeIndexIteratorTest, VTable) { … }
TEST_F(TypeIndexIteratorTest, VTShape) { … }
TEST_F(TypeIndexIteratorTest, OverloadList) { … }
TEST_F(TypeIndexIteratorTest, Pointer) { … }
TEST_F(TypeIndexIteratorTest, MemberPointer) { … }
TEST_F(TypeIndexIteratorTest, ManyTypes) { … }
TEST_F(TypeIndexIteratorTest, FieldListBaseClass) { … }
TEST_F(TypeIndexIteratorTest, FieldListEnumerator) { … }
TEST_F(TypeIndexIteratorTest, FieldListMember) { … }
TEST_F(TypeIndexIteratorTest, FieldListMethod) { … }
TEST_F(TypeIndexIteratorTest, FieldListOneMethod) { … }
TEST_F(TypeIndexIteratorTest, FieldListNestedType) { … }
TEST_F(TypeIndexIteratorTest, FieldListStaticMember) { … }
TEST_F(TypeIndexIteratorTest, FieldListVirtualBase) { … }
TEST_F(TypeIndexIteratorTest, FieldListVFTable) { … }
TEST_F(TypeIndexIteratorTest, FieldListContinuation) { … }
TEST_F(TypeIndexIteratorTest, ManyMembers) { … }
TEST_F(TypeIndexIteratorTest, ProcSym) { … }
TEST_F(TypeIndexIteratorTest, DataSym) { … }
TEST_F(TypeIndexIteratorTest, RegisterSym) { … }
TEST_F(TypeIndexIteratorTest, CallerSym) { … }
TEST_F(TypeIndexIteratorTest, Precomp) { … }
TEST_F(TypeIndexIteratorTest, VariableSizeIntegers) { … }
TEST_F(TypeIndexIteratorTest, UsingNamespace) { … }