150
|
1 RUN: yaml2obj %p/Inputs/pdb-hashes-1.yaml > %t.1.obj
|
|
2 RUN: yaml2obj %p/Inputs/pdb-hashes-2.yaml > %t.2.obj
|
|
3 RUN: yaml2obj %p/Inputs/pdb-hashes-2-missing.yaml > %t.2.missing.obj
|
|
4 RUN: lld-link /debug %t.1.obj %t.2.obj /entry:main /nodefaultlib /PDB:%t.nohash.pdb
|
|
5 RUN: lld-link /debug:ghash %t.1.obj %t.2.obj /entry:main /nodefaultlib /PDB:%t.hash.pdb
|
|
6 RUN: lld-link /debug:ghash %t.1.obj %t.2.missing.obj /entry:main /nodefaultlib /PDB:%t.mixed.pdb
|
|
7 RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.nohash.pdb | FileCheck %s
|
|
8 RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.hash.pdb | FileCheck %s
|
|
9 RUN: llvm-pdbutil dump -types -ids -dont-resolve-forward-refs %t.mixed.pdb | FileCheck %s
|
|
10
|
|
11 ; These object files were generated via the following inputs and commands:
|
|
12 ; ----------------------------------------------
|
|
13 ; // obj.h
|
|
14 ; 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.cpp
|
|
24 ; #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.cpp
|
|
32 ; #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.obj
|
|
39 ; $ clang-cl /Z7 /GS- obj2.cpp /c /o obj2.obj
|
|
40
|
|
41 CHECK: Types (TPI Stream)
|
|
42 CHECK-NEXT: ============================================================
|
|
43 CHECK-NEXT: Showing 13 records
|
|
44 CHECK-NEXT: 0x1000 | LF_POINTER [size = 12]
|
|
45 CHECK-NEXT: referent = 0x0470 (char*), mode = pointer, opts = None, kind = ptr32
|
|
46 CHECK-NEXT: 0x1001 | LF_ARGLIST [size = 16]
|
|
47 CHECK-NEXT: 0x0074 (int): `int`
|
|
48 CHECK-NEXT: 0x1000: `char**`
|
|
49 CHECK-NEXT: 0x1002 | LF_PROCEDURE [size = 16]
|
|
50 CHECK-NEXT: return type = 0x0074 (int), # args = 2, param list = 0x1001
|
|
51 CHECK-NEXT: calling conv = cdecl, options = None
|
|
52 CHECK-NEXT: 0x1003 | LF_STRUCTURE [size = 44] `NS::Foo`
|
|
53 CHECK-NEXT: unique name: `.?AUFoo@NS@@`
|
|
54 CHECK-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
|
|
55 CHECK-NEXT: options: forward ref | has unique name
|
|
56 CHECK-NEXT: 0x1004 | LF_POINTER [size = 12]
|
|
57 CHECK-NEXT: referent = 0x1003, mode = pointer, opts = None, kind = ptr32
|
|
58 CHECK-NEXT: 0x1005 | LF_ARGLIST [size = 12]
|
|
59 CHECK-NEXT: 0x0074 (int): `int`
|
|
60 CHECK-NEXT: 0x1006 | LF_MFUNCTION [size = 28]
|
|
61 CHECK-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1005
|
|
62 CHECK-NEXT: class type = 0x1003, this type = 0x1004, this adjust = 0
|
|
63 CHECK-NEXT: calling conv = thiscall, options = None
|
|
64 CHECK-NEXT: 0x1007 | LF_FIELDLIST [size = 28]
|
|
65 CHECK-NEXT: - LF_MEMBER [name = `X`, Type = 0x0074 (int), offset = 0, attrs = public]
|
|
66 CHECK-NEXT: - LF_ONEMETHOD [name = `Foo`]
|
|
67 CHECK-NEXT: type = 0x1006, vftable offset = -1, attrs = public
|
|
68 CHECK-NEXT: 0x1008 | LF_STRUCTURE [size = 44] `NS::Foo`
|
|
69 CHECK-NEXT: unique name: `.?AUFoo@NS@@`
|
|
70 CHECK-NEXT: vtable: <no type>, base list: <no type>, field list: 0x1007
|
|
71 CHECK-NEXT: options: has unique name
|
|
72 CHECK-NEXT: 0x1009 | LF_MODIFIER [size = 12]
|
|
73 CHECK-NEXT: referent = 0x1003, modifiers = const
|
|
74 CHECK-NEXT: 0x100A | LF_POINTER [size = 12]
|
|
75 CHECK-NEXT: referent = 0x1009, mode = ref, opts = None, kind = ptr32
|
|
76 CHECK-NEXT: 0x100B | LF_ARGLIST [size = 12]
|
|
77 CHECK-NEXT: 0x100A: `const NS::Foo&`
|
|
78 CHECK-NEXT: 0x100C | LF_PROCEDURE [size = 16]
|
|
79 CHECK-NEXT: return type = 0x0074 (int), # args = 1, param list = 0x100B
|
|
80 CHECK-NEXT: calling conv = cdecl, options = None
|
|
81 CHECK: Types (IPI Stream)
|
|
82 CHECK-NEXT: ============================================================
|
|
83 CHECK-NEXT: Showing 6 records
|
|
84 CHECK-NEXT: 0x1000 | LF_FUNC_ID [size = 20]
|
|
85 CHECK-NEXT: name = main, type = 0x1002, parent scope = <no type>
|
|
86 CHECK-NEXT: 0x1001 | LF_STRING_ID [size = {{.*}}] ID: <no type>, String: {{.*}}obj.h
|
|
87 CHECK-NEXT: 0x1002 | LF_UDT_SRC_LINE [size = 16]
|
|
88 CHECK-NEXT: udt = 0x1008, file = 4097, line = 2
|
|
89 CHECK-NEXT: 0x1003 | LF_MFUNC_ID [size = 16]
|
|
90 CHECK-NEXT: name = Foo, type = 0x1006, class type = 0x1003
|
|
91 CHECK-NEXT: 0x1004 | LF_STRING_ID [size = 12] ID: <no type>, String: NS
|
|
92 CHECK-NEXT: 0x1005 | LF_FUNC_ID [size = 20]
|
|
93 CHECK-NEXT: name = func, type = 0x100C, parent scope = 0x1004
|