1 // RUN: llvm-profdata merge %S/Inputs/branch-templates.proftext -o %t.profdata
2 // RUN: llvm-cov show --show-expansions --show-branches=count %S/Inputs/branch-templates.o32l -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs | FileCheck %S/Inputs/branch-templates.cpp
3 // RUN: llvm-cov report --show-branch-summary %S/Inputs/branch-templates.o32l -instr-profile %t.profdata -show-functions -path-equivalence=/tmp,%S/Inputs %S/Inputs/branch-templates.cpp | FileCheck %s -check-prefix=REPORT
4 // RUN: llvm-cov report --show-branch-summary %S/Inputs/branch-templates.o32l -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs | FileCheck %s -check-prefix=REPORTFILE
6 // RUN: yaml2obj %S/Inputs/branch-templates-single.yaml -o %t.o
7 // RUN: llvm-profdata merge %S/Inputs/branch-templates-single.proftext -o %t.profdata
8 // RUN: llvm-cov show --show-expansions --show-branches=count %t.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs | FileCheck %S/Inputs/branch-templates.cpp
10 // REPORT: Name Regions Miss Cover Lines Miss Cover Branches Miss Cover
12 // REPORT-NEXT: main 7 1 85.71% 10 1 90.00% 6 3 50.00%
13 // REPORT-NEXT: _Z4funcIiEiT_ 5 2 60.00% 7 3 57.14% 2 1 50.00%
14 // REPORT-NEXT: _Z4funcIbEiT_ 5 2 60.00% 7 4 42.86% 2 1 50.00%
15 // REPORT-NEXT: _Z4funcIfEiT_ 5 2 60.00% 7 3 57.14% 2 1 50.00%
17 // REPORT-NEXT: TOTAL 22 7 68.18% 31 11 64.52% 12 6 50.00%
19 // Make sure the covered branch tally for the function instantiation group is
20 // merged to reflect maximum branch coverage of a single instantiation, just
21 // like what is done for lines and regions. Also, the total branch tally
22 // summary for an instantiation group should agree with the total number of
23 // branches in the definition (In this case, 2 and 6 for func<>() and main(),
24 // respectively). This is returned by: FunctionCoverageSummary::get(const
25 // InstantiationGroup &Group, ...)
27 // REPORTFILE: Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover Branches Missed Branches Cover
28 // REPORTFILE-NEXT: ---
29 // REPORTFILE-NEXT: branch-templates.cpp 12 3 75.00% 2 0 100.00% 17 4 76.47% 8 4 50.00%
30 // REPORTFILE-NEXT: ---
31 // REPORTFILE-NEXT: TOTAL 12 3 75.00% 2 0 100.00% 17 4 76.47% 8 4 50.00%