File tree 2 files changed +16
-0
lines changed 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 5
5
// RUN: %clang_profuse=%t.profdata -mllvm -pgo-verify-bfi -o - -S -emit-llvm %s 2>%t.errs | FileCheck %s --implicit-check-not="!prof"
6
6
// RUN: FileCheck %s < %t.errs --allow-empty --check-prefix=CHECK-ERROR
7
7
8
+ // RUN: llvm-profdata merge -o %t2.profdata %t1.profraw %t1.profraw %t2.profraw %t2.profraw
9
+ // RUN: llvm-profdata show %t2.profdata | FileCheck %s --check-prefix=COUNTS
10
+
8
11
#include <stdlib.h>
9
12
10
13
// CHECK: @foo({{.*}})
@@ -45,3 +48,5 @@ int main(int argc, char *argv[]) {
45
48
// CHECK-DAG: ![[PROF2]] = !{!"branch_weights", i32 0, i32 1}
46
49
47
50
// CHECK-ERROR-NOT: warning: {{.*}}: Found inconsistent block coverage
51
+
52
+ // COUNTS: Maximum function count: 4
Original file line number Diff line number Diff line change 3
3
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
4
4
// RUN: llvm-profdata show --covered %t.profdata | FileCheck %s --implicit-check-not goo
5
5
6
+ // We deliberately merge the raw profile twice to test that internal counts can
7
+ // grow larger than one. Technically, accumulating coverage values is different
8
+ // than accumulating counts, but this helps discriminate cold functions from hot
9
+ // functions when the number of raw profiles is large.
10
+ // RUN: llvm-profdata merge -o %t2.profdata %t.profraw %t.profraw
11
+ // RUN: llvm-profdata show %t2.profdata | FileCheck %s --check-prefix=COUNTS
12
+
6
13
// RUN: %clang_cspgogen -O1 -mllvm -pgo-function-entry-coverage %s -o %t.cs.out
7
14
// RUN: env LLVM_PROFILE_FILE=%t.csprofraw %run %t.cs.out
8
15
// RUN: llvm-profdata merge -o %t.csprofdata %t.csprofraw
9
16
// RUN: llvm-profdata show --covered %t.csprofdata --showcs | FileCheck %s --implicit-check-not goo
17
+ // RUN: llvm-profdata merge -o %t2.csprofdata %t.csprofraw %t.csprofraw
18
+ // RUN: llvm-profdata show --showcs %t2.csprofdata | FileCheck %s --check-prefix=COUNTS
10
19
11
20
void markUsed (int a ) {
12
21
volatile int g ;
@@ -26,3 +35,5 @@ int main(int argc, char *argv[]) {
26
35
// CHECK-DAG: main
27
36
// CHECK-DAG: foo
28
37
// CHECK-DAG: bar
38
+
39
+ // COUNTS: Maximum function count: 2
You can’t perform that action at this time.
0 commit comments