xref: /minix3/external/bsd/llvm/dist/llvm/test/tools/llvm-profdata/count-mismatch.proftext (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc# Make sure we don't try to combine counters with the same function
2*0a6a1f1dSLionel Sambuc# name and a matching hash if the number of counters differs
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambuc# RUN: llvm-profdata merge %s -o %t.profdata 2>&1 | FileCheck -check-prefix=MERGE_ERRS %s
5*0a6a1f1dSLionel Sambuc# RUN: llvm-profdata show %t.profdata -all-functions -counts > %t.out
6*0a6a1f1dSLionel Sambuc# RUN: FileCheck %s -input-file %t.out
7*0a6a1f1dSLionel Sambucfoo
8*0a6a1f1dSLionel Sambuc1024
9*0a6a1f1dSLionel Sambuc4
10*0a6a1f1dSLionel Sambuc1
11*0a6a1f1dSLionel Sambuc2
12*0a6a1f1dSLionel Sambuc4
13*0a6a1f1dSLionel Sambuc8
14*0a6a1f1dSLionel Sambuc
15*0a6a1f1dSLionel Sambuc# The hash matches, but we can't combine these because the number of
16*0a6a1f1dSLionel Sambuc# counters differs.
17*0a6a1f1dSLionel Sambuc# MERGE_ERRS: count-mismatch.proftext: foo: Function count mismatch
18*0a6a1f1dSLionel Sambucfoo
19*0a6a1f1dSLionel Sambuc1024
20*0a6a1f1dSLionel Sambuc3
21*0a6a1f1dSLionel Sambuc2
22*0a6a1f1dSLionel Sambuc4
23*0a6a1f1dSLionel Sambuc8
24*0a6a1f1dSLionel Sambuc
25*0a6a1f1dSLionel Sambuc# This one does match, so it should combine with the first just fine.
26*0a6a1f1dSLionel Sambuc# CHECK: Hash: 0x{{0+}}400
27*0a6a1f1dSLionel Sambuc# CHECK-NEXT: Counters: 4
28*0a6a1f1dSLionel Sambuc# CHECK-NEXT: Function count: 5
29*0a6a1f1dSLionel Sambuc# CHECK-NEXT: Block counts: [10, 20, 40]
30*0a6a1f1dSLionel Sambucfoo
31*0a6a1f1dSLionel Sambuc1024
32*0a6a1f1dSLionel Sambuc4
33*0a6a1f1dSLionel Sambuc4
34*0a6a1f1dSLionel Sambuc8
35*0a6a1f1dSLionel Sambuc16
36*0a6a1f1dSLionel Sambuc32
37*0a6a1f1dSLionel Sambuc
38*0a6a1f1dSLionel Sambuc# CHECK: Total functions: 1
39*0a6a1f1dSLionel Sambuc# CHECK: Maximum function count: 5
40*0a6a1f1dSLionel Sambuc# CHECK: Maximum internal block count: 40
41