xref: /aosp_15_r20/external/llvm/test/tools/llvm-profdata/general.proftext (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata merge -sparse=true %s -o %t.profdata
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata merge -sparse=false %s -o %t.profdata.dense
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY
6*9880d681SAndroid Build Coastguard Workerfunction_count_only
7*9880d681SAndroid Build Coastguard Worker0
8*9880d681SAndroid Build Coastguard Worker1
9*9880d681SAndroid Build Coastguard Worker97531
10*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY:      Hash: 0x{{0+$}}
11*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Counters: 1
12*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Function count: 97531
13*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Block counts: []
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata.dense --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES
16*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata --function "name with spaces" --counts | FileCheck %s --check-prefix=SPARSE_SPACES
17*9880d681SAndroid Build Coastguard Workername with spaces
18*9880d681SAndroid Build Coastguard Worker1024
19*9880d681SAndroid Build Coastguard Worker2
20*9880d681SAndroid Build Coastguard Worker0
21*9880d681SAndroid Build Coastguard Worker0
22*9880d681SAndroid Build Coastguard Worker# SPACES:      Hash: 0x{{0+}}400
23*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Counters: 2
24*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Function count: 0
25*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Block counts: [0]
26*9880d681SAndroid Build Coastguard Worker# SPARSE_SPACES-NOT: Function count: 0
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM
29*9880d681SAndroid Build Coastguard Workerlarge_numbers
30*9880d681SAndroid Build Coastguard Worker4611686018427387903
31*9880d681SAndroid Build Coastguard Worker6
32*9880d681SAndroid Build Coastguard Worker2305843009213693952
33*9880d681SAndroid Build Coastguard Worker1152921504606846976
34*9880d681SAndroid Build Coastguard Worker576460752303423488
35*9880d681SAndroid Build Coastguard Worker288230376151711744
36*9880d681SAndroid Build Coastguard Worker144115188075855872
37*9880d681SAndroid Build Coastguard Worker72057594037927936
38*9880d681SAndroid Build Coastguard Worker# LARGENUM:      Hash: 0x3fffffffffffffff
39*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Counters: 6
40*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Function count: 2305843009213693952
41*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata.dense --function hex_hash | FileCheck %s -check-prefix=HEX-HASH
44*9880d681SAndroid Build Coastguard Workerhex_hash
45*9880d681SAndroid Build Coastguard Worker0x1234
46*9880d681SAndroid Build Coastguard Worker1
47*9880d681SAndroid Build Coastguard Worker0
48*9880d681SAndroid Build Coastguard Worker# HEX-HASH: Hash: 0x0000000000001234
49*9880d681SAndroid Build Coastguard Worker# HEX-HASH-NEXT: Counters: 1
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata --function NOSUCHFUNC | FileCheck %s -check-prefix=NOSUCHFUNC
52*9880d681SAndroid Build Coastguard Worker# NOSUCHFUNC-NOT: Counters:
53*9880d681SAndroid Build Coastguard Worker# NOSUCHFUNC: Functions shown: 0
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata --function _ | FileCheck %s -check-prefix=SOMEFUNCS
56*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata.dense --function _ | FileCheck %s -check-prefix=SOMEFUNCS_DENSE
57*9880d681SAndroid Build Coastguard Worker# SOMEFUNCS: Counters:
58*9880d681SAndroid Build Coastguard Worker# SOMEFUNCS-DAG: large_numbers:
59*9880d681SAndroid Build Coastguard Worker# SOMEFUNCS-DAG: function_count_only:
60*9880d681SAndroid Build Coastguard Worker# SOMEFUNCS: Functions shown: 2
61*9880d681SAndroid Build Coastguard Worker# SOMEFUNCS_DENSE: Functions shown: 3
62*9880d681SAndroid Build Coastguard Worker
63*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %t.profdata.dense | FileCheck %s -check-prefix=SUMMARY
64*9880d681SAndroid Build Coastguard Worker# SUMMARY-NOT: Counters:
65*9880d681SAndroid Build Coastguard Worker# SUMMARY-NOT: Functions shown:
66*9880d681SAndroid Build Coastguard Worker# SUMMARY: Total functions: 4
67*9880d681SAndroid Build Coastguard Worker# SUMMARY: Maximum function count: 2305843009213693952
68*9880d681SAndroid Build Coastguard Worker# SUMMARY: Maximum internal block count: 1152921504606846976
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show --detailed-summary %t.profdata.dense | FileCheck %s -check-prefix=DETAILED-SUMMARY
71*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: Detailed summary:
72*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: Total number of blocks: 10
73*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: Total count: 4539628424389557499
74*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 3 blocks with count >= 576460752303423488 account for 80 percentage of the total counts.
75*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 4 blocks with count >= 288230376151711744 account for 90 percentage of the total counts.
76*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 4 blocks with count >= 288230376151711744 account for 95 percentage of the total counts.
77*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 6 blocks with count >= 72057594037927936 account for 99 percentage of the total counts.
78*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 6 blocks with count >= 72057594037927936 account for 99.9 percentage of the total counts.
79*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 6 blocks with count >= 72057594037927936 account for 99.99 percentage of the total counts.
80*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY: 6 blocks with count >= 72057594037927936 account for 99.999 percentage of the total counts.
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-2
83*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY-2: 2 blocks with count >= 1152921504606846976 account for 60 percentage of the total counts.
84*9880d681SAndroid Build Coastguard Worker#
85*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000,900000,999999 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-3
86*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY-3: 2 blocks with count >= 1152921504606846976 account for 60 percentage of the total counts.
87*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY-3: 4 blocks with count >= 288230376151711744 account for 90 percentage of the total counts.
88*9880d681SAndroid Build Coastguard Worker# DETAILED-SUMMARY-3: 6 blocks with count >= 72057594037927936 account for 99.9999 percentage of the total counts.
89