1 Test llvm-profdata merge with function filters.
3 RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext --text --function="_Z3.*" | FileCheck %s --check-prefix=CHECK-FILTER1
4 RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext --text --no-function="main" | FileCheck %s --check-prefix=CHECK-FILTER1
5 CHECK-FILTER1: _Z3bari:20301:1437
7 CHECK-NEXT: _Z3fooi:7711:610
11 RUN: llvm-profdata merge --sample %p/Inputs/sample-profile.proftext --text --function="_Z3.*" --no-function="fooi$" | FileCheck %s --check-prefix=CHECK-FILTER2
12 CHECK-FILTER2: _Z3bari:20301:1437
17 RUN: llvm-profdata merge --sample --extbinary --use-md5 -output=%t.0.profdata %p/Inputs/sample-profile.proftext
18 RUN: llvm-profdata merge --sample %t.0.profdata --text --function="_Z3fooi" | FileCheck %s --check-prefix=CHECK-FILTER-MD5
19 CHECK-FILTER-MD5: 1228452328526475178:7711:610
21 CHECK-NOT: 15822663052811949562
22 CHECK-NOT: 3727899762981752933
24 RUN: llvm-profdata merge --instr %p/Inputs/basic.proftext --text --function="foo" | FileCheck %s --check-prefix=CHECK-FILTER3
25 RUN: llvm-profdata merge --instr %p/Inputs/basic.proftext --text --no-function="main" | FileCheck %s --check-prefix=CHECK-FILTER3
27 CHECK-NEXT: # Func Hash:
29 CHECK-NEXT: # Num Counters:
31 CHECK-NEXT: # Counter Values:
36 CHECK-NEXT: # Func Hash:
38 CHECK-NEXT: # Num Counters:
40 CHECK-NEXT: # Counter Values:
44 RUN: llvm-profdata merge --instr %p/Inputs/basic.proftext --text --function="foo" --no-function="^foo$" | FileCheck %s --check-prefix=CHECK-FILTER4
46 CHECK-NEXT: # Func Hash:
48 CHECK-NEXT: # Num Counters:
50 CHECK-NEXT: # Counter Values:
54 RUN: llvm-profdata merge --sample %p/Inputs/cs-sample.proftext --text --function="main.*@.*_Z5funcBi" | FileCheck %s --check-prefix=CHECK-FILTER5
55 CHECK-FILTER5: [main:3.1 @ _Z5funcBi:1 @ _Z8funcLeafi]:500853:20
59 CHECK-NEXT: 4: 74941 _Z3fibi:82359
61 CHECK-NEXT: 11: 23327 _Z3fibi:25228
63 CHECK-NEXT: !Attributes: 1
64 CHECK-NEXT: [main:3.1 @ _Z5funcBi]:120:19
66 CHECK-NEXT: 1: 19 _Z8funcLeafi:20
68 CHECK-NEXT: !Attributes: 1