1 Basic tests for sample profiles.
4 RUN: llvm-profdata show --sample %p/Inputs/sample-profile.proftext | FileCheck %s --check-prefix=SHOW1
5 SHOW1-DAG: Function: main: 184019, 0, 7 sampled lines
6 SHOW1-DAG: 9: 2064, calls: _Z3fooi:631 _Z3bari:1471
7 SHOW1-DAG: Function: _Z3fooi: 7711, 610, 1 sampled lines
8 SHOW1-DAG: Function: _Z3bari: 20301, 1437, 1 sampled lines
12 RUN: llvm-profdata show --sample --function=_Z3bari %p/Inputs/sample-profile.proftext | FileCheck %s --check-prefix=SHOW2
13 SHOW2: Function: _Z3bari: 20301, 1437, 1 sampled lines
15 SHOW2-NOT: Function: main: 184019, 0, 7 sampled lines
16 SHOW2-NOT: Function: _Z3fooi: 7711, 610, 1 sampled lines
18 3- Convert the profile to binary encoding and check that they are both
20 RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext --binary -o - | llvm-profdata show --sample - -o %t-binary
21 RUN: llvm-profdata show --sample %p/Inputs/sample-profile.proftext -o %t-text
22 RUN: diff %t-binary %t-text
24 4- Merge the binary and text encodings of the profile and check that the
25 counters have doubled.
26 RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext -o %t-binprof
27 RUN: llvm-profdata merge --sample --text %p/Inputs/sample-profile.proftext %t-binprof -o - | FileCheck %s --check-prefix=MERGE1
29 MERGE1: 9: 4128 _Z3fooi:1262 _Z3bari:2942
30 MERGE1: _Z3bari:40602:2874
31 MERGE1: _Z3fooi:15422:1220
33 5- Detect invalid text encoding (e.g. instrumentation profile text format).
34 RUN: not llvm-profdata show --sample %p/Inputs/foo3bar3-1.proftext 2>&1 | FileCheck %s --check-prefix=BADTEXT
35 BADTEXT: error: {{.+}}: Unrecognized sample profile encoding format