Index: llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.cpp =================================================================== --- llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.cpp +++ llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.cpp @@ -0,0 +1,63 @@ +// Build with "cl.exe /Zi /GR- /GX- every-type.cpp /link /debug /nodefaultlib /entry:main" + +// clang-format off +void *__purecall = 0; + +void __cdecl operator delete(void *,unsigned int) {} + +struct FooStruct { }; // LF_STRUCTURE + +class FooClass { // LF_CLASS + // LF_FIELDLIST + enum NestedEnum { // LF_ENUM + // LF_NESTTYPE + A, B, C // LF_ENUMERATE + }; + + void RegularMethod() {} // LF_ARGLIST + // LF_ONEMETHOD + // LF_MFUNCTION + + void OverloadedMethod(int) {} // LF_METHODLIST + // LF_METHOD + void OverloadedMethod(int, int) {} + + int HiNibble : 4; // LF_BITFIELD + int LoNibble : 4; + NestedEnum EnumVariable; // LF_MEMBER + static void *StaticMember; // LF_POINTER + // LF_STMEMBER +}; + +void *FooClass::StaticMember = nullptr; + +class Inherit : public FooClass { // LF_BCLASS +public: + virtual ~Inherit() {} // LF_VTSHAPE + // LF_VFUNCTAB +}; + +class VInherit : public virtual FooClass { // LF_VBCLASS + +}; + +class IVInherit : public VInherit { // LF_IVBCLASS +}; + +union TheUnion { + int X; // LF_UNION +}; + +int SomeArray[7] = {1, 2, 3, 4, 5, 6, 7}; // LF_ARRAY + +int main(int argc, char **argv) { // LF_PROCEDURE + const int X = 7; // LF_MODIFIER + + FooStruct FooStructInstance; + FooClass FooClassInstance; + Inherit InheritInstance; + VInherit VInheritInstance; + IVInherit IVInheritInstance; + TheUnion UnionInstance; + return SomeArray[argc]; +} Index: llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.yaml =================================================================== --- llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.yaml +++ llvm/trunk/test/DebugInfo/PDB/Inputs/every-type.yaml @@ -0,0 +1,272 @@ +--- +TpiStream: + Records: + # int* [Index: 0x1000] + - Kind: LF_POINTER + Pointer: + ReferentType: 116 # int + Attrs: 32778 + # const int* [Index: 0x1001] + - Kind: LF_MODIFIER + Modifier: + ModifiedType: 0x1000 + Modifiers: [ Const ] + # char* [Index: 0x1002] + - Kind: LF_POINTER + Pointer: + ReferentType: 1136 # char* + Attrs: 32778 + # (int, char **) [Index: 0x1003] + - Kind: LF_ARGLIST + ArgList: + ArgIndicies: [ 116, 0x1002 ] + # (int, double) [Index: 0x1004] + - Kind: LF_ARGLIST + ArgList: + ArgIndicies: [ 116, 65 ] # (int, double) + # int main(int argc, char **argv) [Index: 0x1005] + - Kind: LF_PROCEDURE + Procedure: + ReturnType: 117 # int + CallConv: NearC # __cdecl + Options: [ None ] + ParameterCount: 2 + ArgumentList: 0x1003 # (int, char**) + #