94 lines · plain
1RUN: yaml2obj %p/Inputs/pdb-hashes-1.yaml -o %t.1.obj2RUN: yaml2obj %p/Inputs/pdb-hashes-2.yaml -o %t.2.obj3RUN: yaml2obj %p/Inputs/pdb-hashes-2-missing.yaml -o %t.2.missing.obj4RUN: lld-link /debug %t.1.obj %t.2.obj /entry:main /nodefaultlib /PDB:%t.nohash.pdb5RUN: lld-link /debug:ghash -verbose %t.1.obj %t.2.obj /entry:main /nodefaultlib /PDB:%t.hash.pdb6RUN: lld-link /debug:ghash %t.1.obj %t.2.missing.obj /entry:main /nodefaultlib /PDB:%t.mixed.pdb7RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.nohash.pdb | FileCheck %s8RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.hash.pdb | FileCheck %s9RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.mixed.pdb | FileCheck %s10 11; These object files were generated via the following inputs and commands:12; ----------------------------------------------13; // obj.h14; namespace NS {15; struct Foo {16; explicit Foo(int x) : X(x) {}17; int X;18; };19;20; int func(const Foo &f);21; }22; ----------------------------------------------23; // obj1.cpp24; #include "obj.h"25;26; int main(int argc, char **argv) {27; NS::Foo f(argc);28; return NS::func(f);29; }30; ----------------------------------------------31; // obj2.cpp32; #include "obj.h"33;34; int NS::func(const Foo &f) {35; return 2 * f.X;36; }37; ----------------------------------------------38; $ clang-cl /Z7 /GS- obj1.cpp /c /o obj1.obj39; $ clang-cl /Z7 /GS- obj2.cpp /c /o obj2.obj40 41CHECK: Types (TPI Stream)42CHECK-NEXT: ============================================================43CHECK-NEXT: Showing 13 records44CHECK-NEXT: 0x1000 | LF_POINTER [size = 12]45CHECK-NEXT: referent = 0x0470 (char*), mode = pointer, opts = None, kind = ptr3246CHECK-NEXT: 0x1001 | LF_ARGLIST [size = 16]47CHECK-NEXT: 0x0074 (int): `int`48CHECK-NEXT: 0x1000: `char**`49CHECK-NEXT: 0x1002 | LF_PROCEDURE [size = 16]50CHECK-NEXT: return type = 0x0074 (int), # args = 2, param list = 0x100151CHECK-NEXT: calling conv = cdecl, options = None52CHECK-NEXT: 0x1003 | LF_STRUCTURE [size = 44] `NS::Foo`53CHECK-NEXT: unique name: `.?AUFoo@NS@@`54CHECK-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>55CHECK-NEXT: options: forward ref | has unique name56CHECK-NEXT: 0x1004 | LF_POINTER [size = 12]57CHECK-NEXT: referent = 0x1003, mode = pointer, opts = None, kind = ptr3258CHECK-NEXT: 0x1005 | LF_ARGLIST [size = 12]59CHECK-NEXT: 0x0074 (int): `int`60CHECK-NEXT: 0x1006 | LF_MFUNCTION [size = 28]61CHECK-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x100562CHECK-NEXT: class type = 0x1003, this type = 0x1004, this adjust = 063CHECK-NEXT: calling conv = thiscall, options = None64CHECK-NEXT: 0x1007 | LF_FIELDLIST [size = 28]65CHECK-NEXT: - LF_MEMBER [name = `X`, Type = 0x0074 (int), offset = 0, attrs = public]66CHECK-NEXT: - LF_ONEMETHOD [name = `Foo`]67CHECK-NEXT: type = 0x1006, vftable offset = -1, attrs = public68CHECK-NEXT: 0x1008 | LF_STRUCTURE [size = 44] `NS::Foo`69CHECK-NEXT: unique name: `.?AUFoo@NS@@`70CHECK-NEXT: vtable: <no type>, base list: <no type>, field list: 0x100771CHECK-NEXT: options: has unique name72CHECK-NEXT: 0x1009 | LF_MODIFIER [size = 12]73CHECK-NEXT: referent = 0x1003, modifiers = const74CHECK-NEXT: 0x100A | LF_POINTER [size = 12]75CHECK-NEXT: referent = 0x1009, mode = ref, opts = None, kind = ptr3276CHECK-NEXT: 0x100B | LF_ARGLIST [size = 12]77CHECK-NEXT: 0x100A: `const NS::Foo&`78CHECK-NEXT: 0x100C | LF_PROCEDURE [size = 16]79CHECK-NEXT: return type = 0x0074 (int), # args = 1, param list = 0x100B80CHECK-NEXT: calling conv = cdecl, options = None81CHECK: Types (IPI Stream)82CHECK-NEXT: ============================================================83CHECK-NEXT: Showing 6 records84CHECK-NEXT: 0x1000 | LF_FUNC_ID [size = 20]85CHECK-NEXT: name = main, type = 0x1002, parent scope = <no type>86CHECK-NEXT: 0x1001 | LF_STRING_ID [size = {{.*}}] ID: <no type>, String: {{.*}}obj.h87CHECK-NEXT: 0x1002 | LF_UDT_SRC_LINE [size = 16]88CHECK-NEXT: udt = 0x1008, file = 4097, line = 289CHECK-NEXT: 0x1003 | LF_MFUNC_ID [size = 16]90CHECK-NEXT: name = Foo, type = 0x1006, class type = 0x100391CHECK-NEXT: 0x1004 | LF_STRING_ID [size = 12] ID: <no type>, String: NS92CHECK-NEXT: 0x1005 | LF_FUNC_ID [size = 20]93CHECK-NEXT: name = func, type = 0x100C, parent scope = 0x100494