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.*]
27 - name: func_mainBin_dec_call_everything
30 match_regex: ["func_mainBin_dec_01"]
34 match_regex: ["func_mainBin_dec_02"]
38 match_regex: ["func_mainBin_dec_03"]
42 match_regex: ["func_mainBin_inc_01"]
46 match_regex: ["func_mainBin_inc_02"]
50 match_regex: ["func_mainBin_inc_03"]
54 match_regex: [".*func.*"]
56 match_regex: [".*extern_func.*"]
61 #--- call_sites.exe.yaml
108 content: 28000090090140B929050051090100B9C0035FD628000090090140B929050051090100B9C0035FD628000090090140B929050051090100B9C0035FD628000090090140B929050011090100B9C0035FD628000090090140B929050011090100B9C0035FD628000090090140B929050011090100B9C0035FD6FD7BBFA9FD030091E0FFFF97E4FFFF97E8FFFF97ECFFFF97F0FFFF97F4FFFF971F2003D5A8E1015800013FD61F2003D588E1015800013FD6280000901F0100B9FD7BC1A8C0035FD6FD7BBFA9FD030091ECFFFF9700008052FD7BC1A8C0035FD6
144 - cmd: LC_DYLD_INFO_ONLY
182 - cmd: LC_LOAD_DYLINKER
185 Content: '/usr/lib/dyld'
189 uuid: 4C4C44E9-5555-3144-A1D3-328233D00078
190 - cmd: LC_BUILD_VERSION
203 - cmd: LC_FUNCTION_STARTS
207 - cmd: LC_DATA_IN_CODE
211 - cmd: LC_CODE_SIGNATURE
235 Name: _mh_execute_header
271 Name: extern_func_ptr
294 Name: call_everything
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
541 - __mh_execute_header
542 - '/tmp/_______________________________________/call_sites.cpp'
543 - '/tmp/_______________________________________/call_sites.o'
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
557 FunctionStarts: [ 0x338, 0x34C, 0x360, 0x374, 0x388, 0x39C, 0x3B0, 0x3F8 ]