[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / llvm / test / tools / llvm-gsymutil / ARM_AArch64 / macho-gsym-callsite-info-exe.yaml
blob557f43d778e582c02f5377b628808d6fb37abfbd
1 ## Test that reconstructs a MachO binary from YAML and generates a callsite-enabled gsym from it - and then verifies the gsym.
2 ## See llvm/test/tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info.test for the script to generate this yaml file
4 # RUN: split-file %s %t
5 # RUN: yaml2obj %t/call_sites.exe.yaml -o %t/call_sites.exe
7 # RUN: llvm-gsymutil --convert=%t/call_sites.exe --callsites-yaml-file=%t/callsites.yaml -o %t/call_sites_exe.gsym
9 # Dump the GSYM file and check the output for callsite information
10 # RUN: llvm-gsymutil %t/call_sites_exe.gsym | FileCheck --check-prefix=CHECK-GSYM %s
13 # CHECK-GSYM:      FunctionInfo @ 0x[[#%x,]]: [0x[[#%x,]] - 0x[[#%x,]]) "func_mainBin_dec_call_everything"
14 # CHECK-GSYM-NEXT: CallSites (by relative return offset):
15 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_dec_01]
16 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_dec_02]
17 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_dec_03]
18 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_inc_01]
19 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_inc_02]
20 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[InternalCall] MatchRegex[func_mainBin_inc_03]
21 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[None] MatchRegex[.*func.*]
22 # CHECK-GSYM-NEXT:   0x[[#%x,]] Flags[ExternalCall] MatchRegex[.*extern_func.*]
25 #--- callsites.yaml
26 functions:
27   - name: func_mainBin_dec_call_everything
28     callsites:
29       - return_offset: 0x0C
30         match_regex: ["func_mainBin_dec_01"]
31         flags:
32           - "InternalCall"
33       - return_offset: 0x10
34         match_regex: ["func_mainBin_dec_02"]
35         flags:
36           - "InternalCall"
37       - return_offset: 0x14
38         match_regex: ["func_mainBin_dec_03"]
39         flags:
40           - "InternalCall"
41       - return_offset: 24
42         match_regex: ["func_mainBin_inc_01"]
43         flags:
44           - "InternalCall"
45       - return_offset: 28
46         match_regex: ["func_mainBin_inc_02"]
47         flags:
48           - "InternalCall"
49       - return_offset: 32
50         match_regex: ["func_mainBin_inc_03"]
51         flags:
52           - "InternalCall"
53       - return_offset: 44
54         match_regex: [".*func.*"]
55       - return_offset: 56
56         match_regex: [".*extern_func.*"]
57         flags:
58           - "ExternalCall"
61 #--- call_sites.exe.yaml
62 --- !mach-o
63 FileHeader:
64   magic:           0xFEEDFACF
65   cputype:         0x100000C
66   cpusubtype:      0x0
67   filetype:        0x2
68   ncmds:           14
69   sizeofcmds:      760
70   flags:           0x200085
71   reserved:        0x0
72 LoadCommands:
73   - cmd:             LC_SEGMENT_64
74     cmdsize:         72
75     segname:         __PAGEZERO
76     vmaddr:          0
77     vmsize:          4294967296
78     fileoff:         0
79     filesize:        0
80     maxprot:         0
81     initprot:        0
82     nsects:          0
83     flags:           0
84   - cmd:             LC_SEGMENT_64
85     cmdsize:         152
86     segname:         __TEXT
87     vmaddr:          4294967296
88     vmsize:          16384
89     fileoff:         0
90     filesize:        16384
91     maxprot:         5
92     initprot:        5
93     nsects:          1
94     flags:           0
95     Sections:
96       - sectname:        __text
97         segname:         __TEXT
98         addr:            0x100000338
99         size:            216
100         offset:          0x338
101         align:           2
102         reloff:          0x0
103         nreloc:          0
104         flags:           0x80000400
105         reserved1:       0x0
106         reserved2:       0x0
107         reserved3:       0x0
108         content:         28000090090140B929050051090100B9C0035FD628000090090140B929050051090100B9C0035FD628000090090140B929050051090100B9C0035FD628000090090140B929050011090100B9C0035FD628000090090140B929050011090100B9C0035FD628000090090140B929050011090100B9C0035FD6FD7BBFA9FD030091E0FFFF97E4FFFF97E8FFFF97ECFFFF97F0FFFF97F4FFFF971F2003D5A8E1015800013FD61F2003D588E1015800013FD6280000901F0100B9FD7BC1A8C0035FD6FD7BBFA9FD030091ECFFFF9700008052FD7BC1A8C0035FD6
109   - cmd:             LC_SEGMENT_64
110     cmdsize:         152
111     segname:         __DATA
112     vmaddr:          4294983680
113     vmsize:          16384
114     fileoff:         16384
115     filesize:        0
116     maxprot:         3
117     initprot:        3
118     nsects:          1
119     flags:           0
120     Sections:
121       - sectname:        __common
122         segname:         __DATA
123         addr:            0x100004000
124         size:            24
125         offset:          0x0
126         align:           3
127         reloff:          0x0
128         nreloc:          0
129         flags:           0x1
130         reserved1:       0x0
131         reserved2:       0x0
132         reserved3:       0x0
133   - cmd:             LC_SEGMENT_64
134     cmdsize:         72
135     segname:         __LINKEDIT
136     vmaddr:          4295000064
137     vmsize:          1648
138     fileoff:         16384
139     filesize:        1648
140     maxprot:         1
141     initprot:        1
142     nsects:          0
143     flags:           0
144   - cmd:             LC_DYLD_INFO_ONLY
145     cmdsize:         48
146     rebase_off:      0
147     rebase_size:     0
148     bind_off:        0
149     bind_size:       0
150     weak_bind_off:   0
151     weak_bind_size:  0
152     lazy_bind_off:   0
153     lazy_bind_size:  0
154     export_off:      16384
155     export_size:     232
156   - cmd:             LC_SYMTAB
157     cmdsize:         24
158     symoff:          16632
159     nsyms:           34
160     stroff:          17176
161     strsize:         568
162   - cmd:             LC_DYSYMTAB
163     cmdsize:         80
164     ilocalsym:       0
165     nlocalsym:       22
166     iextdefsym:      22
167     nextdefsym:      12
168     iundefsym:       34
169     nundefsym:       0
170     tocoff:          0
171     ntoc:            0
172     modtaboff:       0
173     nmodtab:         0
174     extrefsymoff:    0
175     nextrefsyms:     0
176     indirectsymoff:  0
177     nindirectsyms:   0
178     extreloff:       0
179     nextrel:         0
180     locreloff:       0
181     nlocrel:         0
182   - cmd:             LC_LOAD_DYLINKER
183     cmdsize:         32
184     name:            12
185     Content:         '/usr/lib/dyld'
186     ZeroPadBytes:    7
187   - cmd:             LC_UUID
188     cmdsize:         24
189     uuid:            4C4C44E9-5555-3144-A1D3-328233D00078
190   - cmd:             LC_BUILD_VERSION
191     cmdsize:         32
192     platform:        1
193     minos:           720896
194     sdk:             720896
195     ntools:          1
196     Tools:
197       - tool:            4
198         version:         1310720
199   - cmd:             LC_MAIN
200     cmdsize:         24
201     entryoff:        1016
202     stacksize:       0
203   - cmd:             LC_FUNCTION_STARTS
204     cmdsize:         16
205     dataoff:         16616
206     datasize:        16
207   - cmd:             LC_DATA_IN_CODE
208     cmdsize:         16
209     dataoff:         16632
210     datasize:        0
211   - cmd:             LC_CODE_SIGNATURE
212     cmdsize:         16
213     dataoff:         17744
214     datasize:        288
215 LinkEditData:
216   ExportTrie:
217     TerminalSize:    0
218     NodeOffset:      0
219     Name:            ''
220     Flags:           0x0
221     Address:         0x0
222     Other:           0x0
223     ImportName:      ''
224     Children:
225       - TerminalSize:    0
226         NodeOffset:      5
227         Name:            _
228         Flags:           0x0
229         Address:         0x0
230         Other:           0x0
231         ImportName:      ''
232         Children:
233           - TerminalSize:    2
234             NodeOffset:      52
235             Name:            _mh_execute_header
236             Flags:           0x0
237             Address:         0x0
238             Other:           0x0
239             ImportName:      ''
240           - TerminalSize:    3
241             NodeOffset:      56
242             Name:            main
243             Flags:           0x0
244             Address:         0x3F8
245             Other:           0x0
246             ImportName:      ''
247           - TerminalSize:    0
248             NodeOffset:      61
249             Name:            g_
250             Flags:           0x0
251             Address:         0x0
252             Other:           0x0
253             ImportName:      ''
254             Children:
255               - TerminalSize:    4
256                 NodeOffset:      104
257                 Name:            volatile_var
258                 Flags:           0x0
259                 Address:         0x4000
260                 Other:           0x0
261                 ImportName:      ''
262               - TerminalSize:    4
263                 NodeOffset:      110
264                 Name:            func_ptr
265                 Flags:           0x0
266                 Address:         0x4008
267                 Other:           0x0
268                 ImportName:      ''
269               - TerminalSize:    4
270                 NodeOffset:      116
271                 Name:            extern_func_ptr
272                 Flags:           0x0
273                 Address:         0x4010
274                 Other:           0x0
275                 ImportName:      ''
276           - TerminalSize:    0
277             NodeOffset:      122
278             Name:            func_mainBin_
279             Flags:           0x0
280             Address:         0x0
281             Other:           0x0
282             ImportName:      ''
283             Children:
284               - TerminalSize:    0
285                 NodeOffset:      139
286                 Name:            dec_
287                 Flags:           0x0
288                 Address:         0x0
289                 Other:           0x0
290                 ImportName:      ''
291                 Children:
292                   - TerminalSize:    3
293                     NodeOffset:      163
294                     Name:            call_everything
295                     Flags:           0x0
296                     Address:         0x3B0
297                     Other:           0x0
298                     ImportName:      ''
299                   - TerminalSize:    0
300                     NodeOffset:      168
301                     Name:            '0'
302                     Flags:           0x0
303                     Address:         0x0
304                     Other:           0x0
305                     ImportName:      ''
306                     Children:
307                       - TerminalSize:    3
308                         NodeOffset:      182
309                         Name:            '1'
310                         Flags:           0x0
311                         Address:         0x338
312                         Other:           0x0
313                         ImportName:      ''
314                       - TerminalSize:    3
315                         NodeOffset:      187
316                         Name:            '3'
317                         Flags:           0x0
318                         Address:         0x360
319                         Other:           0x0
320                         ImportName:      ''
321                       - TerminalSize:    3
322                         NodeOffset:      192
323                         Name:            '2'
324                         Flags:           0x0
325                         Address:         0x34C
326                         Other:           0x0
327                         ImportName:      ''
328               - TerminalSize:    0
329                 NodeOffset:      197
330                 Name:            inc_0
331                 Flags:           0x0
332                 Address:         0x0
333                 Other:           0x0
334                 ImportName:      ''
335                 Children:
336                   - TerminalSize:    3
337                     NodeOffset:      211
338                     Name:            '2'
339                     Flags:           0x0
340                     Address:         0x388
341                     Other:           0x0
342                     ImportName:      ''
343                   - TerminalSize:    3
344                     NodeOffset:      216
345                     Name:            '1'
346                     Flags:           0x0
347                     Address:         0x374
348                     Other:           0x0
349                     ImportName:      ''
350                   - TerminalSize:    3
351                     NodeOffset:      221
352                     Name:            '3'
353                     Flags:           0x0
354                     Address:         0x39C
355                     Other:           0x0
356                     ImportName:      ''
357   NameList:
358     - n_strx:          235
359       n_type:          0x64
360       n_sect:          0
361       n_desc:          0
362       n_value:         0
363     - n_strx:          295
364       n_type:          0x66
365       n_sect:          0
366       n_desc:          1
367       n_value:         0
368     - n_strx:          353
369       n_type:          0x24
370       n_sect:          1
371       n_desc:          0
372       n_value:         4294968312
373     - n_strx:          1
374       n_type:          0x24
375       n_sect:          0
376       n_desc:          0
377       n_value:         24
378     - n_strx:          359
379       n_type:          0x24
380       n_sect:          1
381       n_desc:          0
382       n_value:         4294968120
383     - n_strx:          1
384       n_type:          0x24
385       n_sect:          0
386       n_desc:          0
387       n_value:         20
388     - n_strx:          380
389       n_type:          0x24
390       n_sect:          1
391       n_desc:          0
392       n_value:         4294968140
393     - n_strx:          1
394       n_type:          0x24
395       n_sect:          0
396       n_desc:          0
397       n_value:         20
398     - n_strx:          401
399       n_type:          0x24
400       n_sect:          1
401       n_desc:          0
402       n_value:         4294968160
403     - n_strx:          1
404       n_type:          0x24
405       n_sect:          0
406       n_desc:          0
407       n_value:         20
408     - n_strx:          422
409       n_type:          0x24
410       n_sect:          1
411       n_desc:          0
412       n_value:         4294968180
413     - n_strx:          1
414       n_type:          0x24
415       n_sect:          0
416       n_desc:          0
417       n_value:         20
418     - n_strx:          443
419       n_type:          0x24
420       n_sect:          1
421       n_desc:          0
422       n_value:         4294968200
423     - n_strx:          1
424       n_type:          0x24
425       n_sect:          0
426       n_desc:          0
427       n_value:         20
428     - n_strx:          464
429       n_type:          0x24
430       n_sect:          1
431       n_desc:          0
432       n_value:         4294968220
433     - n_strx:          1
434       n_type:          0x24
435       n_sect:          0
436       n_desc:          0
437       n_value:         20
438     - n_strx:          485
439       n_type:          0x24
440       n_sect:          1
441       n_desc:          0
442       n_value:         4294968240
443     - n_strx:          1
444       n_type:          0x24
445       n_sect:          0
446       n_desc:          0
447       n_value:         72
448     - n_strx:          519
449       n_type:          0x20
450       n_sect:          2
451       n_desc:          0
452       n_value:         4294983680
453     - n_strx:          535
454       n_type:          0x20
455       n_sect:          2
456       n_desc:          0
457       n_value:         4294983688
458     - n_strx:          547
459       n_type:          0x20
460       n_sect:          2
461       n_desc:          0
462       n_value:         4294983696
463     - n_strx:          1
464       n_type:          0x64
465       n_sect:          1
466       n_desc:          0
467       n_value:         0
468     - n_strx:          2
469       n_type:          0xF
470       n_sect:          1
471       n_desc:          0
472       n_value:         4294968312
473     - n_strx:          8
474       n_type:          0xF
475       n_sect:          1
476       n_desc:          0
477       n_value:         4294968120
478     - n_strx:          29
479       n_type:          0xF
480       n_sect:          1
481       n_desc:          0
482       n_value:         4294968140
483     - n_strx:          50
484       n_type:          0xF
485       n_sect:          1
486       n_desc:          0
487       n_value:         4294968160
488     - n_strx:          71
489       n_type:          0xF
490       n_sect:          1
491       n_desc:          0
492       n_value:         4294968180
493     - n_strx:          92
494       n_type:          0xF
495       n_sect:          1
496       n_desc:          0
497       n_value:         4294968200
498     - n_strx:          113
499       n_type:          0xF
500       n_sect:          1
501       n_desc:          0
502       n_value:         4294968220
503     - n_strx:          134
504       n_type:          0xF
505       n_sect:          1
506       n_desc:          0
507       n_value:         4294968240
508     - n_strx:          168
509       n_type:          0xF
510       n_sect:          2
511       n_desc:          0
512       n_value:         4294983680
513     - n_strx:          184
514       n_type:          0xF
515       n_sect:          2
516       n_desc:          0
517       n_value:         4294983688
518     - n_strx:          196
519       n_type:          0xF
520       n_sect:          2
521       n_desc:          0
522       n_value:         4294983696
523     - n_strx:          215
524       n_type:          0xF
525       n_sect:          1
526       n_desc:          16
527       n_value:         4294967296
528   StringTable:
529     - ' '
530     - _main
531     - _func_mainBin_dec_01
532     - _func_mainBin_dec_02
533     - _func_mainBin_dec_03
534     - _func_mainBin_inc_01
535     - _func_mainBin_inc_02
536     - _func_mainBin_inc_03
537     - _func_mainBin_dec_call_everything
538     - _g_volatile_var
539     - _g_func_ptr
540     - _g_extern_func_ptr
541     - __mh_execute_header
542     - '/tmp/_______________________________________/call_sites.cpp'
543     - '/tmp/_______________________________________/call_sites.o'
544     - _main
545     - _func_mainBin_dec_01
546     - _func_mainBin_dec_02
547     - _func_mainBin_dec_03
548     - _func_mainBin_inc_01
549     - _func_mainBin_inc_02
550     - _func_mainBin_inc_03
551     - _func_mainBin_dec_call_everything
552     - _g_volatile_var
553     - _g_func_ptr
554     - _g_extern_func_ptr
555     - ''
556     - ''
557   FunctionStarts:  [ 0x338, 0x34C, 0x360, 0x374, 0x388, 0x39C, 0x3B0, 0x3F8 ]