summaryrefslogtreecommitdiff
path: root/test/tools/llvm-profdata/generate.test
blob: 71e8b50fcad0e4304c70c3f45a4aeb887fabfe38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
RUN: llvm-profdata generate %p/Inputs/empty.profdata.input | llvm-profdata show -all-functions -counts - | FileCheck %s --check-prefix=EMPTY

EMPTY: Total functions: 0
EMPTY: Maximum function count: 0
EMPTY: Maximum internal block count: 0

RUN: llvm-profdata generate %p/Inputs/foo3-1.profdata.input | llvm-profdata show -all-functions -counts - | FileCheck %s --check-prefix=FOO3

FOO3: foo:
FOO3: Counters: 3
FOO3: Function count: 1
FOO3: Block counts: [2, 3]
FOO3: Total functions: 1
FOO3: Maximum function count: 1
FOO3: Maximum internal block count: 3

RUN: llvm-profdata generate %p/Inputs/foo3bar3-1.profdata.input | llvm-profdata show -all-functions -counts - | FileCheck %s --check-prefix=FOO3BAR3

FOO3BAR3: foo:
FOO3BAR3: Counters: 3
FOO3BAR3: Function count: 2
FOO3BAR3: Block counts: [3, 5]
FOO3BAR3: bar:
FOO3BAR3: Counters: 3
FOO3BAR3: Function count: 7
FOO3BAR3: Block counts: [11, 13]
FOO3BAR3: Total functions: 2
FOO3BAR3: Maximum function count: 7
FOO3BAR3: Maximum internal block count: 13

RUN: not llvm-profdata generate %p/Inputs/invalid-count-later.profdata.input -o /dev/null 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT-LATER
INVALID-COUNT-LATER: error: {{.*}}: Failed to read counter

RUN: not llvm-profdata generate %p/Inputs/bad-hash.profdata.input -o /dev/null 2>&1 | FileCheck %s --check-prefix=BAD-HASH
BAD-HASH: error: {{.*}}: Failed to read hash

RUN: not llvm-profdata generate %p/Inputs/wrong-count.profdata.input -o /dev/null 2>&1 | FileCheck %s --check-prefix=BAD-FUNCTION-COUNT
BAD-FUNCTION-COUNT: error: {{.*}}: Truncated file