diff options
Diffstat (limited to 'test/DebugInfo/PDB')
-rw-r--r-- | test/DebugInfo/PDB/Inputs/symbolformat.cpp | 24 | ||||
-rw-r--r-- | test/DebugInfo/PDB/Inputs/symbolformat.pdb | bin | 143360 -> 35840 bytes | |||
-rw-r--r-- | test/DebugInfo/PDB/pdbdump-flags.test | 34 | ||||
-rw-r--r-- | test/DebugInfo/PDB/pdbdump-symbol-format.test | 74 |
4 files changed, 82 insertions, 50 deletions
diff --git a/test/DebugInfo/PDB/Inputs/symbolformat.cpp b/test/DebugInfo/PDB/Inputs/symbolformat.cpp index c069a35..5479b71 100644 --- a/test/DebugInfo/PDB/Inputs/symbolformat.cpp +++ b/test/DebugInfo/PDB/Inputs/symbolformat.cpp @@ -26,22 +26,42 @@ struct VirtualBase { struct B : public A, protected virtual VirtualBase { void PureFunc() override {} +}; +struct MemberTest { enum NestedEnum { FirstVal, SecondVal }; typedef int NestedTypedef; - NestedEnum EnumVar; - NestedTypedef TypedefVar; + + NestedEnum m_nested_enum; + NestedTypedef m_typedef; + bool m_bool; + char m_char; + wchar_t m_wchar_t; + int m_int; + unsigned m_unsigned; + long m_long; + unsigned long m_unsigned_long; + __int64 m_int64; + unsigned __int64 m_unsigned_int64; + float m_float; + double m_double; + void (*m_pfn_2_args)(int, double); }; typedef int IntType; typedef A ClassAType; +int g_global_int; +void *g_global_pointer = nullptr; + int main(int argc, char **argv) { + // Force symbol references so the linker generates debug info B b; + MemberTest members; auto PureAddr = &B::PureFunc; auto VirtualAddr = &A::PureFunc; auto RegularAddr = &A::RegularFunc; diff --git a/test/DebugInfo/PDB/Inputs/symbolformat.pdb b/test/DebugInfo/PDB/Inputs/symbolformat.pdb Binary files differindex 183870a..53d8a1b 100644 --- a/test/DebugInfo/PDB/Inputs/symbolformat.pdb +++ b/test/DebugInfo/PDB/Inputs/symbolformat.pdb diff --git a/test/DebugInfo/PDB/pdbdump-flags.test b/test/DebugInfo/PDB/pdbdump-flags.test index d8d38cb..badbf07 100644 --- a/test/DebugInfo/PDB/pdbdump-flags.test +++ b/test/DebugInfo/PDB/pdbdump-flags.test @@ -1,32 +1,40 @@ ; RUN: llvm-pdbdump %p/Inputs/empty.pdb | FileCheck %s -check-prefix=NO_ARGS ; RUN: llvm-pdbdump -types %p/Inputs/empty.pdb | FileCheck %s -check-prefix=TYPES ; RUN: llvm-pdbdump -compilands %p/Inputs/empty.pdb | FileCheck %s -check-prefix=COMPILANDS -; RUN: llvm-pdbdump -types -compilands %p/Inputs/empty.pdb | FileCheck %s -check-prefix=BOTH +; RUN: llvm-pdbdump -types -compilands %p/Inputs/empty.pdb | FileCheck %s -check-prefix=MULTIPLE ; Check that neither symbols nor compilands are dumped when neither argument specified. ; NO_ARGS: empty.pdb ; NO_ARGS: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} ; NO_ARGS: Attributes: HasPrivateSymbols -; NO_ARGS-NOT: Dumping compilands -; NO_ARGS-NOT: Dumping symbols +; NO_ARGS-NOT: ---TYPES--- +; NO_ARGS-NOT: ---COMPILANDS--- +; NO_ARGS-NOT: ---GLOBALS--- +; NO_ARGS-NOT: ---SYMBOLS--- -; Check that only symbols are dumped when only -types is specified. +; Check that only types are dumped when only -types is specified. ; TYPES: empty.pdb ; TYPES: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} ; TYPES: Attributes: HasPrivateSymbols -; TYPES: Dumping types -; TYPES-NOT: Dumping compilands +; TYPES: ---TYPES--- +; TYPES-NOT: ---COMPILANDS--- +; TYPES-NOT: ---GLOBALS--- +; TYPES-NOT: ---SYMBOLS--- ; Check that only compilands are dumped when only -compilands is specified. ; COMPILANDS: empty.pdb ; COMPILANDS: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} ; COMPILANDS: Attributes: HasPrivateSymbols -; COMPILANDS-NOT: Dumping types -; COMPILANDS: Dumping compilands +; COMPILANDS: ---COMPILANDS--- +; COMPILANDS-NOT: ---TYPES--- +; COMPILANDS-NOT: ---GLOBALS--- +; COMPILANDS-NOT: ---SYMBOLS--- ; Check that types and compilands are dumped when both arguments are specified. -; BOTH: empty.pdb -; BOTH: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} -; BOTH: Attributes: HasPrivateSymbols -; BOTH: Dumping types -; BOTH: Dumping compilands +; MULTIPLE: empty.pdb +; MULTIPLE: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0} +; MULTIPLE: Attributes: HasPrivateSymbols +; MULTIPLE: ---COMPILANDS--- +; MULTIPLE: ---TYPES--- +; MULTIPLE-NOT: ---GLOBALS--- +; MULTIPLE-NOT: ---SYMBOLS--- diff --git a/test/DebugInfo/PDB/pdbdump-symbol-format.test b/test/DebugInfo/PDB/pdbdump-symbol-format.test index 1540e16..6dd15fe 100644 --- a/test/DebugInfo/PDB/pdbdump-symbol-format.test +++ b/test/DebugInfo/PDB/pdbdump-symbol-format.test @@ -1,49 +1,53 @@ ; RUN: llvm-pdbdump -symbols %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=SYM_FORMAT %s ; RUN: llvm-pdbdump -types %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=TYPES_FORMAT %s -; RUN: llvm-pdbdump -types -class-definitions %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=FULL_CLASS %s +; RUN: llvm-pdbdump -globals %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=GLOBALS %s ; The format is func [0x<rva_start>+<prologue_length> - 0x<rva_end>-<epilogue_length>] +; SYM_FORMAT: ---SYMBOLS--- ; SYM_FORMAT: symbolformat-fpo.obj -; SYM_FORMAT-DAG: func [0x001130+0 - 0x001137-1] (FPO) uint32_t __cdecl fpo_func(uint32_t n) +; SYM_FORMAT-DAG: func [{{.*}}] (FPO) unsigned __cdecl fpo_func(unsigned n) ; SYM_FORMAT: symbolformat.obj -; SYM_FORMAT-DAG: func [0x001140+3 - 0x001147-2] (EBP) int32_t __cdecl _purecall() -; SYM_FORMAT-DAG: func [0x001150+6 - 0x0011b6-4] (EBP) int32_t __cdecl main(int32_t argc, char** argv) -; SYM_FORMAT-DAG: func [0x0010b0+7 - 0x0010c7-4] (EBP) void A::A() -; SYM_FORMAT-DAG: func [0x0011c0+7 - 0x0011f1-6] (EBP) void B::B() -; SYM_FORMAT-DAG: thunk [0x000010f6 - 0x000010fa] (Pcode) B::`vcall'{0}' -; SYM_FORMAT-DAG: func [0x001100+7 - 0x00110b-4] (EBP) virtual void B::PureFunc() -; SYM_FORMAT-DAG: func [0x001110+7 - 0x00111b-4] (EBP) void A::RegularFunc() -; SYM_FORMAT-DAG: func [0x001120+7 - 0x00112b-4] (EBP) virtual void A::VirtualFunc() +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl _purecall() +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl main(int argc, char** argv) +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) void A::A() +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) void B::B() +; SYM_FORMAT-DAG: thunk [{{.*}}] (Pcode) B::`vcall'{0}' +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) virtual void B::PureFunc() +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) void A::RegularFunc() +; SYM_FORMAT-DAG: func [{{.*}}] (EBP) virtual void A::VirtualFunc() +; TYPES_FORMAT: ---TYPES--- ; TYPES_FORMAT: Enums ; TYPES_FORMAT-DAG: enum TestEnum ; TYPES_FORMAT-DAG: enum TestEnumClass -; TYPES_FORMAT: Function Signatures -; TYPES_FORMAT-DAG: int32_t __cdecl () -; TYPES_FORMAT-DAG: int32_t __cdecl (int32_t, char**) -; TYPES_FORMAT-DAG: void (A::)() -; TYPES_FORMAT-DAG: void (B::)() -; TYPES_FORMAT-DAG: void (B::)(B&) -; TYPES_FORMAT-DAG: void (B::)() -; TYPES_FORMAT-DAG: B& (B::)(B&) -; TYPES_FORMAT-DAG: void (A::)(A&) -; TYPES_FORMAT-DAG: void (A::)() -; TYPES_FORMAT-DAG: A& (A::)(A&) ; TYPES_FORMAT: Typedefs -; TYPES_FORMAT-DAG: typedef int32_t IntType +; TYPES_FORMAT-DAG: typedef int IntType ; TYPES_FORMAT-DAG: typedef class A ClassAType ; TYPES_FORMAT: Classes -; TYPES_FORMAT-DAG: class A -; TYPES_FORMAT-DAG: class B +; TYPES_FORMAT: struct A { +; TYPES_FORMAT: public: +; TYPES_FORMAT: virtual void PureFunc() = 0 +; TYPES_FORMAT: virtual void VirtualFunc() +; TYPES_FORMAT: void RegularFunc() +; TYPES_FORMAT: } +; TYPES_FORMAT-DAG: struct MemberTest { +; TYPES_FORMAT: data +0x00 MemberTest::NestedEnum m_nested_enum +; TYPES_FORMAT: data +0x04 int m_typedef +; TYPES_FORMAT: data +0x08 bool m_bool +; TYPES_FORMAT: data +0x09 char m_char +; TYPES_FORMAT: data +0x0a wchar_t m_wchar_t +; TYPES_FORMAT: data +0x0c int m_int +; TYPES_FORMAT: data +0x10 unsigned m_unsigned +; TYPES_FORMAT: data +0x14 long m_long +; TYPES_FORMAT: data +0x18 unsigned long m_unsigned_long +; TYPES_FORMAT: data +0x20 __int64 m_int64 +; TYPES_FORMAT: data +0x28 unsigned __int64 m_unsigned_int64 +; TYPES_FORMAT: data +0x30 float m_float +; TYPES_FORMAT: data +0x38 double m_double +; TYPES_FORMAT: data +0x40 void (__cdecl *m_pfn_2_args)(int, double) +; TYPES_FORMAT: } -; FULL_CLASS: Classes -; FULL_CLASS-DAG: class A { -; FULL_CLASS: public: -; FULL_CLASS: virtual void PureFunc() = 0 -; FULL_CLASS: virtual void VirtualFunc() -; FULL_CLASS: void RegularFunc() -; FULL_CLASS: } -; FULL_CLASS-DAG: class B { -; FULL_CLASS: public: -; FULL_CLASS: virtual void PureFunc() -; FULL_CLASS: }
\ No newline at end of file +; GLOBALS: ---GLOBALS--- +; GLOBALS-DAG: func [{{.*}}] (FPO) unsigned __cdecl fpo_func(unsigned n) +; GLOBALS-DAG: data [{{.*}}] static void* g_global_pointer +; GLOBALS-DAG: data [{{.*}}] static int g_global_int |