1 ; RUN: llvm-pdbutil yaml2pdb %p/Inputs/symbol-offset.yaml --pdb=%t.pdb
3 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=80 %t.pdb \
4 ; RUN: | FileCheck --check-prefix=OFFSET %s
6 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=4 --show-parents \
7 ; RUN: %t.pdb | FileCheck --check-prefix=SHOW-PARENT1 %s
9 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=80 --show-parents \
10 ; RUN: %t.pdb | FileCheck --check-prefix=SHOW-PARENT2 %s
12 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=308 --show-parents \
13 ; RUN: %t.pdb | FileCheck --check-prefix=SHOW-PARENT3 %s
15 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=260 --show-parents \
16 ; RUN: --parent-recurse-depth=1 %t.pdb \
17 ; RUN: | FileCheck --check-prefix=SHOW-PARENT-DEPTH1 %s
19 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=260 --show-parents \
20 ; RUN: --parent-recurse-depth=2 %t.pdb \
21 ; RUN: | FileCheck --check-prefix=SHOW-PARENT-DEPTH2 %s
23 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=416 --show-children\
24 ; RUN: %t.pdb | FileCheck --check-prefix=SHOW-CHILDREN1 %s
26 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=292 --show-children\
27 ; RUN: %t.pdb | FileCheck --check-prefix=SHOW-CHILDREN2 %s
29 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=4 --show-children \
30 ; RUN: --children-recurse-depth=1 %t.pdb \
31 ; RUN: | FileCheck --check-prefix=SHOW-CHILDREN-DEPTH1 %s
33 ; RUN: llvm-pdbutil dump --symbols --modi=0 --symbol-offset=292 --show-children\
34 ; RUN: --children-recurse-depth=2 %t.pdb \
35 ; RUN: | FileCheck --check-prefix=SHOW-CHILDREN-DEPTH2 %s
37 The pdb file is generate from following cpp file and use llvm-pdbutil's pdb2yaml
38 functionality to convert pdb to yaml. Unrelated information was removed from the
40 ; [[clang::always_inline]] int func1(int x) {
44 ; [[clang::always_inline]] int func2(int x, int y) {
45 ; return func1(x + y);
48 ; [[clang::always_inline]] int func3(int x, int y, int z) {
51 ; return x + func1(x);
54 ; int main(int argc, char** argv) {
55 ; return func3(argc, 1, 2);
59 OFFSET: 80 | S_LOCAL [size = 16] `argc`
60 OFFSET-NEXT: type=0x0074 (int), flags = param
62 SHOW-PARENT1: 4 | S_GPROC32 [size = 44] `main`
63 SHOW-PARENT1-NEXT: parent = 0, end = 468, addr = 0001:0176, code size = 137
64 SHOW-PARENT1-NEXT: type = `0x1008 (<unknown UDT>)`, debug start = 0, debug end = 0, flags = none
66 SHOW-PARENT2: 4 | S_GPROC32 [size = 44] `main`
67 SHOW-PARENT2-NEXT: parent = 0, end = 468, addr = 0001:0176, code size = 137
68 SHOW-PARENT2-NEXT: type = `0x1008 (<unknown UDT>)`, debug start = 0, debug end = 0, flags = none
69 SHOW-PARENT2-NEXT: 80 | S_LOCAL [size = 16] `argc`
70 SHOW-PARENT2-NEXT: type=0x0074 (int), flags = param
71 SHOW-PARENT2-NEXT: 468 | S_END [size = 4]
73 SHOW-PARENT3: 4 | S_GPROC32 [size = 44] `main`
74 SHOW-PARENT3-NEXT: parent = 0, end = 468, addr = 0001:0176, code size = 137
75 SHOW-PARENT3-NEXT: type = `0x1008 (<unknown UDT>)`, debug start = 0, debug end = 0, flags = none
76 SHOW-PARENT3-NEXT: 144 | S_INLINESITE [size = 16]
77 SHOW-PARENT3-NEXT: inlinee = 0x1002 (<unknown UDT>), parent = 4, end = 464
78 SHOW-PARENT3-NEXT: 292 | S_INLINESITE [size = 16]
79 SHOW-PARENT3-NEXT: inlinee = 0x1001 (<unknown UDT>), parent = 144, end = 412
80 SHOW-PARENT3-NEXT: 308 | S_LOCAL [size = 12] `x`
81 SHOW-PARENT3-NEXT: type=0x0074 (int), flags = param
82 SHOW-PARENT3-NEXT: 412 | S_INLINESITE_END [size = 4]
83 SHOW-PARENT3-NEXT: 464 | S_INLINESITE_END [size = 4]
84 SHOW-PARENT3-NEXT: 468 | S_END [size = 4]
87 SHOW-PARENT-DEPTH1: 244 | S_INLINESITE [size = 16]
88 SHOW-PARENT-DEPTH1-NEXT: inlinee = 0x1000 (<unknown UDT>), parent = 144, end = 288
89 SHOW-PARENT-DEPTH1-NEXT: 260 | S_LOCAL [size = 12] `x`
90 SHOW-PARENT-DEPTH1-NEXT: type=0x0074 (int), flags = param
91 SHOW-PARENT-DEPTH1-NEXT: 288 | S_INLINESITE_END [size = 4]
93 SHOW-PARENT-DEPTH2: 144 | S_INLINESITE [size = 16]
94 SHOW-PARENT-DEPTH2-NEXT: inlinee = 0x1002 (<unknown UDT>), parent = 4, end = 464
95 SHOW-PARENT-DEPTH2-NEXT: 244 | S_INLINESITE [size = 16]
96 SHOW-PARENT-DEPTH2-NEXT: inlinee = 0x1000 (<unknown UDT>), parent = 144, end = 288
97 SHOW-PARENT-DEPTH2-NEXT: 260 | S_LOCAL [size = 12] `x`
98 SHOW-PARENT-DEPTH2-NEXT: type=0x0074 (int), flags = param
99 SHOW-PARENT-DEPTH2-NEXT: 288 | S_INLINESITE_END [size = 4]
100 SHOW-PARENT-DEPTH2-NEXT: 464 | S_INLINESITE_END [size = 4]
102 SHOW-CHILDREN1: 416 | S_INLINESITE [size = 16]
103 SHOW-CHILDREN1-NEXT: inlinee = 0x1000 (<unknown UDT>), parent = 144, end = 460
104 SHOW-CHILDREN1-NEXT: 432 | S_LOCAL [size = 12] `x`
105 SHOW-CHILDREN1-NEXT: type=0x0074 (int), flags = param
106 SHOW-CHILDREN1-NEXT: 444 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
107 SHOW-CHILDREN1-NEXT: offset = 36, range = [0001:0299,+7)
108 SHOW-CHILDREN1-NEXT: gaps = []
109 SHOW-CHILDREN1-NEXT: 460 | S_INLINESITE_END [size = 4]
111 SHOW-CHILDREN2: 292 | S_INLINESITE [size = 16]
112 SHOW-CHILDREN2-NEXT: inlinee = 0x1001 (<unknown UDT>), parent = 144, end = 412
113 SHOW-CHILDREN2-NEXT: 308 | S_LOCAL [size = 12] `x`
114 SHOW-CHILDREN2-NEXT: type=0x0074 (int), flags = param
115 SHOW-CHILDREN2-NEXT: 320 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
116 SHOW-CHILDREN2-NEXT: offset = 44, range = [0001:0260,+19)
117 SHOW-CHILDREN2-NEXT: gaps = []
118 SHOW-CHILDREN2-NEXT: 336 | S_LOCAL [size = 12] `y`
119 SHOW-CHILDREN2-NEXT: type=0x0074 (int), flags = param
120 SHOW-CHILDREN2-NEXT: 348 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
121 SHOW-CHILDREN2-NEXT: offset = 48, range = [0001:0260,+19)
122 SHOW-CHILDREN2-NEXT: gaps = []
123 SHOW-CHILDREN2-NEXT: 364 | S_INLINESITE [size = 16]
124 SHOW-CHILDREN2-NEXT: inlinee = 0x1000 (<unknown UDT>), parent = 292, end = 408
125 SHOW-CHILDREN2-NEXT: 380 | S_LOCAL [size = 12] `x`
126 SHOW-CHILDREN2-NEXT: type=0x0074 (int), flags = param
127 SHOW-CHILDREN2-NEXT: 392 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
128 SHOW-CHILDREN2-NEXT: offset = 52, range = [0001:0272,+7)
129 SHOW-CHILDREN2-NEXT: gaps = []
130 SHOW-CHILDREN2-NEXT: 408 | S_INLINESITE_END [size = 4]
131 SHOW-CHILDREN2-NEXT: 412 | S_INLINESITE_END [size = 4]
133 SHOW-CHILDREN-DEPTH1: 4 | S_GPROC32 [size = 44] `main`
134 SHOW-CHILDREN-DEPTH1-NEXT: parent = 0, end = 468, addr = 0001:0176, code size = 137
135 SHOW-CHILDREN-DEPTH1-NEXT: type = `0x1008 (<unknown UDT>)`, debug start = 0, debug end = 0, flags = none
136 SHOW-CHILDREN-DEPTH1-NEXT: 48 | S_FRAMEPROC [size = 32]
137 SHOW-CHILDREN-DEPTH1-NEXT: size = 56, padding size = 0, offset to padding = 0
138 SHOW-CHILDREN-DEPTH1-NEXT: bytes of callee saved registers = 0, exception handler addr = 0000:0000
139 SHOW-CHILDREN-DEPTH1-NEXT: local fp reg = NONE, param fp reg = NONE
140 SHOW-CHILDREN-DEPTH1-NEXT: flags = none
141 SHOW-CHILDREN-DEPTH1-NEXT: 80 | S_LOCAL [size = 16] `argc`
142 SHOW-CHILDREN-DEPTH1-NEXT: type=0x0074 (int), flags = param
143 SHOW-CHILDREN-DEPTH1-NEXT: 96 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
144 SHOW-CHILDREN-DEPTH1-NEXT: offset = 4, range = [0001:0197,+116)
145 SHOW-CHILDREN-DEPTH1-NEXT: gaps = []
146 SHOW-CHILDREN-DEPTH1-NEXT: 112 | S_LOCAL [size = 16] `argv`
147 SHOW-CHILDREN-DEPTH1-NEXT: type=0x1006 (<unknown UDT>), flags = param
148 SHOW-CHILDREN-DEPTH1-NEXT: 128 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
149 SHOW-CHILDREN-DEPTH1-NEXT: offset = 8, range = [0001:0197,+116)
150 SHOW-CHILDREN-DEPTH1-NEXT: gaps = []
151 SHOW-CHILDREN-DEPTH1-NEXT: 144 | S_INLINESITE [size = 16]
152 SHOW-CHILDREN-DEPTH1-NEXT: inlinee = 0x1002 (<unknown UDT>), parent = 4, end = 464
153 SHOW-CHILDREN-DEPTH1-NEXT: 464 | S_INLINESITE_END [size = 4]
154 SHOW-CHILDREN-DEPTH1-NEXT: 468 | S_END [size = 4]
156 SHOW-CHILDREN-DEPTH2: 292 | S_INLINESITE [size = 16]
157 SHOW-CHILDREN-DEPTH2-NEXT: inlinee = 0x1001 (<unknown UDT>), parent = 144, end = 412
158 SHOW-CHILDREN-DEPTH2-NEXT: 308 | S_LOCAL [size = 12] `x`
159 SHOW-CHILDREN-DEPTH2-NEXT: type=0x0074 (int), flags = param
160 SHOW-CHILDREN-DEPTH2-NEXT: 320 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
161 SHOW-CHILDREN-DEPTH2-NEXT: offset = 44, range = [0001:0260,+19)
162 SHOW-CHILDREN-DEPTH2-NEXT: gaps = []
163 SHOW-CHILDREN-DEPTH2-NEXT: 336 | S_LOCAL [size = 12] `y`
164 SHOW-CHILDREN-DEPTH2-NEXT: type=0x0074 (int), flags = param
165 SHOW-CHILDREN-DEPTH2-NEXT: 348 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
166 SHOW-CHILDREN-DEPTH2-NEXT: offset = 48, range = [0001:0260,+19)
167 SHOW-CHILDREN-DEPTH2-NEXT: gaps = []
168 SHOW-CHILDREN-DEPTH2-NEXT: 364 | S_INLINESITE [size = 16]
169 SHOW-CHILDREN-DEPTH2-NEXT: inlinee = 0x1000 (<unknown UDT>), parent = 292, end = 408
170 SHOW-CHILDREN-DEPTH2-NEXT: 380 | S_LOCAL [size = 12] `x`
171 SHOW-CHILDREN-DEPTH2-NEXT: type=0x0074 (int), flags = param
172 SHOW-CHILDREN-DEPTH2-NEXT: 392 | S_DEFRANGE_FRAMEPOINTER_REL [size = 16]
173 SHOW-CHILDREN-DEPTH2-NEXT: offset = 52, range = [0001:0272,+7)
174 SHOW-CHILDREN-DEPTH2-NEXT: gaps = []
175 SHOW-CHILDREN-DEPTH2-NEXT: 408 | S_INLINESITE_END [size = 4]
176 SHOW-CHILDREN-DEPTH2-NEXT: 412 | S_INLINESITE_END [size = 4]