ProfileData: Introduce InstrProfWriter using the naive text format
[oota-llvm.git] / test / tools / llvm-profdata / simple.test
1 RUN: llvm-profdata merge %p/Inputs/foo3-1.profdata %p/Inputs/foo3-2.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3
2 RUN: llvm-profdata merge %p/Inputs/foo3-2.profdata %p/Inputs/foo3-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3
3 FOO3: foo:
4 FOO3: Counters: 3
5 FOO3: Function count: 8
6 FOO3: Block counts: [7, 6]
7 FOO3: Total functions: 1
8 FOO3: Maximum function count: 8
9 FOO3: Maximum internal block count: 7
10
11 RUN: llvm-profdata merge %p/Inputs/foo4-1.profdata %p/Inputs/foo4-2.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO4
12 RUN: llvm-profdata merge %p/Inputs/foo4-2.profdata %p/Inputs/foo4-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO4
13 FOO4: foo:
14 FOO4: Counters: 4
15 FOO4: Function count: 18
16 FOO4: Block counts: [28, 38, 48]
17 FOO4: Total functions: 1
18 FOO4: Maximum function count: 18
19 FOO4: Maximum internal block count: 48
20
21 RUN: llvm-profdata merge %p/Inputs/foo3bar3-1.profdata %p/Inputs/foo3bar3-2.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3BAR3
22 RUN: llvm-profdata merge %p/Inputs/foo3bar3-2.profdata %p/Inputs/foo3bar3-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3BAR3
23 FOO3BAR3: foo:
24 FOO3BAR3: Counters: 3
25 FOO3BAR3: Function count: 19
26 FOO3BAR3: Block counts: [22, 28]
27 FOO3BAR3: bar:
28 FOO3BAR3: Counters: 3
29 FOO3BAR3: Function count: 36
30 FOO3BAR3: Block counts: [42, 50]
31 FOO3BAR3: Total functions: 2
32 FOO3BAR3: Maximum function count: 36
33 FOO3BAR3: Maximum internal block count: 50
34
35 RUN: llvm-profdata merge %p/Inputs/empty.profdata %p/Inputs/foo3-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3EMPTY
36 FOO3EMPTY: foo:
37 FOO3EMPTY: Counters: 3
38 FOO3EMPTY: Function count: 1
39 FOO3EMPTY: Block counts: [2, 3]
40 FOO3EMPTY: Total functions: 1
41 FOO3EMPTY: Maximum function count: 1
42 FOO3EMPTY: Maximum internal block count: 3
43
44 RUN: llvm-profdata merge %p/Inputs/foo3-1.profdata %p/Inputs/foo3bar3-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=FOO3FOO3BAR3
45 FOO3FOO3BAR3: foo:
46 FOO3FOO3BAR3: Counters: 3
47 FOO3FOO3BAR3: Function count: 3
48 FOO3FOO3BAR3: Block counts: [5, 8]
49 FOO3FOO3BAR3: bar:
50 FOO3FOO3BAR3: Counters: 3
51 FOO3FOO3BAR3: Function count: 7
52 FOO3FOO3BAR3: Block counts: [11, 13]
53 FOO3FOO3BAR3: Total functions: 2
54 FOO3FOO3BAR3: Maximum function count: 7
55 FOO3FOO3BAR3: Maximum internal block count: 13
56
57 RUN: llvm-profdata merge %p/Inputs/foo3-1.profdata %p/Inputs/bar3-1.profdata 2>&1 | llvm-profdata show - -all-functions -counts | FileCheck %s --check-prefix=DISJOINT
58 DISJOINT: foo:
59 DISJOINT: Counters: 3
60 DISJOINT: Function count: 1
61 DISJOINT: Block counts: [2, 3]
62 DISJOINT: bar:
63 DISJOINT: Counters: 3
64 DISJOINT: Function count: 1
65 DISJOINT: Block counts: [2, 3]
66 DISJOINT: Total functions: 2
67 DISJOINT: Maximum function count: 1
68 DISJOINT: Maximum internal block count: 3