xref: /aosp_15_r20/external/llvm/test/tools/llvm-profdata/compat.proftext (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# Compatibility tests for older profile format versions. These ensure
2*9880d681SAndroid Build Coastguard Worker# that we don't break compatibility with an older profile version
3*9880d681SAndroid Build Coastguard Worker# without noticing it.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker# The input file at %S/Inputs/compat.profdata.v1 was generated with
6*9880d681SAndroid Build Coastguard Worker# llvm-profdata merge from r214548.
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY
9*9880d681SAndroid Build Coastguard Workerfunction_count_only
10*9880d681SAndroid Build Coastguard Worker0
11*9880d681SAndroid Build Coastguard Worker1
12*9880d681SAndroid Build Coastguard Worker97531
13*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY:      Hash: 0x{{0+$}}
14*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Counters: 1
15*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Function count: 97531
16*9880d681SAndroid Build Coastguard Worker# FUNC_COUNT_ONLY-NEXT: Block counts: []
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES
19*9880d681SAndroid Build Coastguard Workername with spaces
20*9880d681SAndroid Build Coastguard Worker1024
21*9880d681SAndroid Build Coastguard Worker2
22*9880d681SAndroid Build Coastguard Worker0
23*9880d681SAndroid Build Coastguard Worker0
24*9880d681SAndroid Build Coastguard Worker# SPACES:      Hash: 0x{{0+}}400
25*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Counters: 2
26*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Function count: 0
27*9880d681SAndroid Build Coastguard Worker# SPACES-NEXT: Block counts: [0]
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM
30*9880d681SAndroid Build Coastguard Workerlarge_numbers
31*9880d681SAndroid Build Coastguard Worker4611686018427387903
32*9880d681SAndroid Build Coastguard Worker6
33*9880d681SAndroid Build Coastguard Worker2305843009213693952
34*9880d681SAndroid Build Coastguard Worker1152921504606846976
35*9880d681SAndroid Build Coastguard Worker576460752303423488
36*9880d681SAndroid Build Coastguard Worker288230376151711744
37*9880d681SAndroid Build Coastguard Worker144115188075855872
38*9880d681SAndroid Build Coastguard Worker72057594037927936
39*9880d681SAndroid Build Coastguard Worker# LARGENUM:      Hash: 0x3fffffffffffffff
40*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Counters: 6
41*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Function count: 2305843009213693952
42*9880d681SAndroid Build Coastguard Worker# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 | FileCheck %s -check-prefix=SUMMARY
45*9880d681SAndroid Build Coastguard Worker# SUMMARY: Total functions: 3
46*9880d681SAndroid Build Coastguard Worker# SUMMARY: Maximum function count: 2305843009213693952
47*9880d681SAndroid Build Coastguard Worker# SUMMARY: Maximum internal block count: 1152921504606846976
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v2 -all-functions --counts | FileCheck %s -check-prefix=FORMATV2
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker# FORMATV2: Counters:
52*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:   foo:
53*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Hash: 0x000000000000000a
54*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Counters: 2
55*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Function count: 499500
56*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Block counts: [179900]
57*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:   main:
58*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Hash: 0x000000000000410a
59*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Counters: 4
60*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Function count: 1
61*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT:     Block counts: [1000, 1000000, 499500]
62*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT: Functions shown: 2
63*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT: Total functions: 2
64*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT: Maximum function count: 499500
65*9880d681SAndroid Build Coastguard Worker# FORMATV2-NEXT: Maximum internal block count: 1000000
66*9880d681SAndroid Build Coastguard Worker#
67*9880d681SAndroid Build Coastguard Worker# RUN: llvm-profdata show %S/Inputs/compat.profdata.v4 -all-functions --counts | FileCheck %s -check-prefix=FORMATV4
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Worker# FORMATV4: Counters:
70*9880d681SAndroid Build Coastguard Worker# FORMATV4:   name with spaces:
71*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Hash: 0x0000000000000400
72*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Counters: 2
73*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Function count: 0
74*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Block counts: [0]
75*9880d681SAndroid Build Coastguard Worker# FORMATV4:   function_count_only:
76*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Hash: 0x0000000000000000
77*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Counters: 1
78*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Function count: 97531
79*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Block counts: []
80*9880d681SAndroid Build Coastguard Worker# FORMATV4:   large_numbers:
81*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Hash: 0x3fffffffffffffff
82*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Counters: 6
83*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Function count: 2305843009213693952
84*9880d681SAndroid Build Coastguard Worker# FORMATV4:     Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
85*9880d681SAndroid Build Coastguard Worker# FORMATV4: Functions shown: 3
86*9880d681SAndroid Build Coastguard Worker# FORMATV4: Total functions: 3
87*9880d681SAndroid Build Coastguard Worker# FORMATV4: Maximum function count: 2305843009213693952
88*9880d681SAndroid Build Coastguard Worker# FORMATV4: Maximum internal block count: 1152921504606846976
89