Index: test/DebugInfo/PDB/Inputs/empty.cpp =================================================================== --- /dev/null +++ test/DebugInfo/PDB/Inputs/empty.cpp @@ -0,0 +1,3 @@ +int main() { + return 42; +} Index: test/DebugInfo/PDB/Inputs/symbolformat-fpo.cpp =================================================================== --- /dev/null +++ test/DebugInfo/PDB/Inputs/symbolformat-fpo.cpp @@ -0,0 +1,5 @@ +#include + +void fpo_func(int n) { + printf("N = %d", n); +} \ No newline at end of file Index: test/DebugInfo/PDB/Inputs/symbolformat.cpp =================================================================== --- /dev/null +++ test/DebugInfo/PDB/Inputs/symbolformat.cpp @@ -0,0 +1,20 @@ +#include + +struct A { + virtual void PureFunc() = 0; + virtual void VirtualFunc() {} + void RegularFunc() {} +}; + +struct B : public A { + void PureFunc() override {} +}; + +int main(int argc, char **argv) { + B b; + auto PureAddr = &B::PureFunc; + auto VirtualAddr = &A::PureFunc; + auto RegularAddr = &A::RegularFunc; + printf("%p", PureAddr); + return 0; +} Index: test/DebugInfo/PDB/lit.local.cfg =================================================================== --- /dev/null +++ test/DebugInfo/PDB/lit.local.cfg @@ -0,0 +1 @@ +config.unsupported = not config.have_dia_sdk Index: test/DebugInfo/PDB/pdbdump-flags.test =================================================================== --- /dev/null +++ test/DebugInfo/PDB/pdbdump-flags.test @@ -0,0 +1,22 @@ +; RUN: llvm-pdbdump -all %p/Inputs/empty.pdb | FileCheck %s -check-prefix ALL_CHECK +; RUN: llvm-pdbdump -functions %p/Inputs/empty.pdb | FileCheck %s -check-prefix MAIN_CHECK +; RUN: llvm-pdbdump -group-by=compiland %p/Inputs/empty.pdb | FileCheck %s -check-prefix GROUP_COMPILAND +; RUN: llvm-pdbdump -group-by=type %p/Inputs/empty.pdb | FileCheck %s -check-prefix GROUP_TYPE + +; Check PDB file summary information +; ALL_CHECK: DebugInfo\pdb\Inputs\empty.pdb +; ALL_CHECK: Guid: {BFA72074-7EF0-3C43-AC20-C54BE55A95AD} +; ALL_CHECK: Attributes: HasPrivateSymbols + +; Check that running with only -compilands doesn't include unwanted symbol types +; MAIN_CHECK: (EBP) int32_t __cdecl main() +; MAIN_CHECK-NOT: vtbl: +; MAIN_CHECK-NOT: enum: +; MAIN_CHECK-NOT: class: +; MAIN_CHECK-NOT: data: + +; Check that running with group-by=compiland always lists compilands using an arbitrary MSVCRT compiland. +; GROUP_COMPILAND: initsect.obj + +; Check that running with group-by=type but not specifying -compilands does NOT list compilands +; GROUP_TYPE-NOT: initsect.obj Index: test/DebugInfo/PDB/pdbdump-func-format.test =================================================================== --- /dev/null +++ test/DebugInfo/PDB/pdbdump-func-format.test @@ -0,0 +1,21 @@ +; RUN: llvm-pdbdump -hidden -vtables %p/Inputs/symbolformat.pdb | FileCheck %s --check-prefix VTABLE_CHECK +; RUN: llvm-pdbdump -hidden -functions %p/Inputs/symbolformat.pdb | FileCheck %s --check-prefix MODIFIERS_CHECK +; RUN: llvm-pdbdump -thunks --group-by=compiland %p/Inputs/symbolformat.pdb | FileCheck %s --check-prefix THUNK_CHECK +; RUN: llvm-pdbdump -functions --group-by=compiland %p/Inputs/symbolformat.pdb | FileCheck %s --check-prefix FPO_CHECK +; RUN: llvm-pdbdump -functions %p/Inputs/symbolformat.pdb | FileCheck %s --check-prefix ADDRS_CHECK + +; VTABLE_CHECK: A:: (2 entries) + +; THUNK_CHECK: (Pcode) B::`vcall'{0}' +; THUNK_CHECK: thunk {{\[0x[0-9a-f]+ \- 0x[0-9a-f]+\]}} (Standard) WriteFile + +; MODIFIERS_CHECK: virtual void __thiscall PureFunc() = 0 +; MODIFIERS_CHECK: virtual void __thiscall VirtualFunc() +; MODIFIERS_CHECK-NOT: virtual void __thiscall VirtualFunc() = 0 +; MODIFIERS_CHECK: void __thiscall RegularFunc() +; MODIFIERS_CHECK-NOT: virtual void __thiscall RegularFunc() + +; FPO_CHECK: (VFrame) void __cdecl fpo_func + +; The format here is func [0x+ - 0x-] +; ADDRS_CHECK: func {{\[0x[0-9a-f]+\+[0-9]+ \- 0x[0-9a-f]+\-[0-9]+\]}} (EBP) int32_t __cdecl main Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -31,6 +31,7 @@ config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" config.have_zlib = "@HAVE_LIBZ@" +config.have_dia_sdk = "@HAVE_DIA_SDK@" config.enable_ffi = "@LLVM_ENABLE_FFI@" # Support substitution of the tools_dir with user parameters. This is