104 lines · plain
1## Tests blocks matching by called function names in inferStaleProfile.2 3# REQUIRES: system-linux4# RUN: split-file %s %t5# RUN: %clangxx %cxxflags %t/main.cpp -o %t.exe -Wl,-q -nostdlib6# RUN: llvm-bolt %t.exe -o %t.out --data %t/yaml --profile-ignore-hash -v=1 \7# RUN: --dyno-stats --print-cfg --infer-stale-profile=1 --match-with-call-graph 2>&1 | FileCheck %s8 9# CHECK: BOLT-INFO: matched 1 functions with call graph10 11#--- main.cpp12void foo() {}13 14void bar() {}15 16void qux() {17 foo();18 bar();19}20 21void fred() {22 foo();23 qux();24 bar();25 bar();26 foo();27}28 29int main() {30 return 0;31}32 33#--- yaml34---35header:36 profile-version: 137 binary-name: 'match-functions-with-calls-as-anchors.s.tmp.exe'38 binary-build-id: '<unknown>'39 profile-flags: [ lbr ]40 profile-origin: branch profile reader41 profile-events: ''42 dfs-order: false43 hash-func: xxh344functions:45 - name: main46 fid: 047 hash: 0x000000000000000148 exec: 149 nblocks: 650 blocks:51 - bid: 152 hash: 0x000000000000000153 insns: 154 succ: [ { bid: 3, cnt: 1} ]55 - name: _Z3foov56 fid: 157 hash: 0x000000000000000258 exec: 159 nblocks: 660 blocks:61 - bid: 162 hash: 0x000000000000000263 insns: 164 succ: [ { bid: 3, cnt: 1} ]65 66 - name: _Z3barv67 fid: 268 hash: 0x000000000000000369 exec: 170 nblocks: 671 blocks:72 - bid: 173 hash: 0x000000000000000374 insns: 175 succ: [ { bid: 3, cnt: 1} ]76 - name: _Z3quxv77 fid: 378 hash: 0x000000000000000479 exec: 480 nblocks: 681 blocks:82 - bid: 183 hash: 0x000000000000000484 insns: 185 succ: [ { bid: 3, cnt: 1} ]86 calls: [ { off : 0, fid : 1, cnt : 0},87 { off : 0, fid : 2, cnt : 0} ]88 - name: _Z4bazv89 fid: 490 hash: 0x000000000000000591 exec: 192 nblocks: 693 blocks:94 - bid: 195 hash: 0x000000000000000596 insns: 197 succ: [ { bid: 3, cnt: 1} ]98 calls: [ { off : 0, fid : 3, cnt : 0},99 { off : 0, fid : 1, cnt : 0},100 { off : 0, fid : 2, cnt : 0},101 { off : 0, fid : 1, cnt : 0},102 { off : 0, fid : 2, cnt : 0} ]103...104