brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 0b0d37a Raw
36 lines · plain
1Basic tests for sample profiles.2 31- Show all functions4RUN: llvm-profdata show --sample %p/Inputs/sample-profile.proftext | FileCheck %s --check-prefix=SHOW15SHOW1-DAG: Function: main: 184019, 0, 7 sampled lines6SHOW1-DAG: 9: 2064, calls: _Z3bari:1471 _Z3fooi:6317SHOW1-DAG: Function: _Z3fooi: 7711, 610, 1 sampled lines8SHOW1-DAG: Function: _Z3bari: 20301, 1437, 1 sampled lines9SHOW1-DAG: 1: 143710 112- Show only bar12RUN: llvm-profdata show --sample --function=_Z3bari %p/Inputs/sample-profile.proftext | FileCheck %s --check-prefix=SHOW213SHOW2: Function: _Z3bari: 20301, 1437, 1 sampled lines14SHOW2: 1: 143715SHOW2-NOT: Function: main: 184019, 0, 7 sampled lines16SHOW2-NOT: Function: _Z3fooi: 7711, 610, 1 sampled lines17 183- Convert the profile to binary encoding and check that they are both19   identical.20RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext --binary -o - | llvm-profdata show --sample - -o %t-binary21RUN: llvm-profdata show --sample %p/Inputs/sample-profile.proftext -o %t-text22RUN: diff %t-binary %t-text23 244- Merge the binary and text encodings of the profile and check that the25   counters have doubled.26RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext -o %t-binprof27RUN: llvm-profdata merge --sample --text %p/Inputs/sample-profile.proftext %t-binprof -o - | FileCheck %s --check-prefix=MERGE128MERGE1: main:368038:029MERGE1: 9: 4128 _Z3bari:2942 _Z3fooi:126230MERGE1: _Z3bari:40602:287431MERGE1: _Z3fooi:15422:122032 335- Detect invalid text encoding (e.g. instrumentation profile text format).34RUN: not llvm-profdata show --sample %p/Inputs/foo3bar3-1.proftext 2>&1 | FileCheck %s --check-prefix=BADTEXT35BADTEXT: error: {{.+}}: Unrecognized sample profile encoding format36