1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-04-01 18:33:56 +00:00

[llvm-pdbdump] Add some tests for llvm-pdbdump.

This adds only a very basic set of tests that dump a few
functions and object files.

Differential Revision: http://reviews.llvm.org/D7656
Reviewed By: David Blaikie

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230083 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner 2015-02-20 23:05:57 +00:00
parent ca6245c554
commit 7b9dbc91b9
9 changed files with 67 additions and 0 deletions

@ -0,0 +1,7 @@
// Build with "cl.exe /Zi empty.cpp /link /debug /nodefaultlib /entry:main"
void *__purecall = 0;
int main() {
return 42;
}

Binary file not shown.

@ -0,0 +1,6 @@
// Compile with "cl /GR- /Zi /c /Ox /Oy symbolformat-fpo.cpp"
// Refer to symbolformat.cpp for linking instructions.
unsigned fpo_func(unsigned n) {
return n * 2;
}

@ -0,0 +1,24 @@
// Compile with "cl /c /Zi /GR- symbolformat.cpp"
// Compile symbolformat-fpo.cpp (see file for instructions)
// Link with "link symbolformat.obj symbolformat-fpo.obj /debug /nodefaultlib
// /entry:main /out:symbolformat.exe"
int __cdecl _purecall(void) { return 0; }
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;
return 0;
}

Binary file not shown.

@ -0,0 +1 @@
config.unsupported = not config.have_dia_sdk

@ -0,0 +1,14 @@
; RUN: llvm-pdbdump %p/Inputs/empty.pdb | FileCheck %s -check-prefix SUMMARY_CHECK
; RUN: llvm-pdbdump -functions %p/Inputs/empty.pdb | FileCheck %s -check-prefix MAIN_CHECK
; Check PDB file summary information
; SUMMARY_CHECK: empty.pdb
; SUMMARY_CHECK: Guid: {0B355641-86A0-A249-896F-9988FAE52FF0}
; SUMMARY_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:

@ -0,0 +1,14 @@
; RUN: llvm-pdbdump -all -hidden -group-by=compiland %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=FORMAT %s
; The format here is func [0x<rva_start>+<prologue_length> - 0x<rva_end>-<epilogue_length>]
; FORMAT: test\DebugInfo\PDB\Inputs\symbolformat-fpo.obj
; FORMAT-DAG: func [0x001130+0 - 0x001137-1] (VFrame) uint32_t __cdecl fpo_func(uint32_t)
; FORMAT: d:\src\llvm\test\DebugInfo\PDB\Inputs\symbolformat.obj
; FORMAT-DAG: func [0x001060+3 - 0x001067-2] (EBP) int32_t __cdecl _purecall()
; FORMAT-DAG: func [0x001070+6 - 0x001099-4] (EBP) int32_t __cdecl main(int32_t, char**)
; FORMAT-DAG: func [0x0010b0+7 - 0x0010c7-4] (EBP) void __thiscall A::A()
; FORMAT-DAG: func [0x0010d0+7 - 0x0010ef-4] (EBP) void __thiscall B::B()
; FORMAT-DAG: thunk [0x000010f6 - 0x000010fa] (Pcode) B::`vcall'{0}'
; FORMAT-DAG: func [0x001100+7 - 0x00110b-4] (EBP) virtual void __thiscall B::PureFunc()
; FORMAT-DAG: func [0x001110+7 - 0x00111b-4] (EBP) void __thiscall A::RegularFunc()
; FORMAT-DAG: func [0x001120+7 - 0x00112b-4] (EBP) virtual void __thiscall A::VirtualFunc()

@ -31,6 +31,7 @@ config.host_ldflags = "@HOST_LDFLAGS@"
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