1 // RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence 2>&1 | FileCheck %s
2 // RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT %s
3 // RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp does-not-exist.cpp 2>&1 | FileCheck -check-prefix=FILT %s
4 
5 // CHECK: Regions    Missed Regions     Cover   Functions  Missed Functions  Executed  Instantiations   Missed Insts.  Executed       Lines      Missed Lines     Cover
6 // CHECK-NEXT: ---
7 // CHECK-NEXT: report.cpp                          5                 2    60.00%           4                 1    75.00%               4               1    75.00%          13                 4    69.23%
8 // CHECK-NEXT: ---
9 // CHECK-NEXT: TOTAL                               5                 2    60.00%           4                 1    75.00%               4               1    75.00%          13                 4    69.23%
10 
11 // FILT: File 'report.cpp':
12 // FILT-NEXT: Name        Regions  Miss   Cover  Lines  Miss   Cover
13 // FILT-NEXT: ---
14 // FILT-NEXT: _Z3foob           2     1  50.00%      4     2  50.00%
15 // FILT-NEXT: _Z3barv           1     0 100.00%      2     0 100.00%
16 // FILT-NEXT: _Z4funcv          1     1   0.00%      2     2   0.00%
17 // FILT-NEXT: main              1     0 100.00%      5     0 100.00%
18 // FILT-NEXT: ---
19 // FILT-NEXT: TOTAL             5     2  60.00%     13     4  69.23%
20 
21 void foo(bool cond) {
22   if (cond) {
23   }
24 }
25 
26 void bar() {
27 }
28 
29 void func() {
30 }
31 
32 int main() {
33   foo(false);
34   bar();
35   return 0;
36 }
37 
38 // Test that listing multiple functions in a function view works.
39 // RUN: llvm-cov show -o %t.dir %S/Inputs/report.covmapping -instr-profile=%S/Inputs/report.profdata -filename-equivalence -name-regex=".*" %s
40 // RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/functions.txt %s
41 // FUNCTIONS: _Z3foob
42 // FUNCTIONS: _Z3barv
43 // FUNCTIONS: _Z4func
44