blob: 45d582aae34bffe5237830b7d9e94adfa2d75c0e [file] [log] [blame]
Justin Bognercfb53e42015-03-19 00:02:23 +00001// 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-NEXT %s
Alex Lorenzcb1702d2014-09-30 12:45:13 +00003
Justin Bogner0ef7a2a2015-02-14 02:05:05 +00004// CHECK: Filename Regions Miss Cover Functions Executed
5// CHECK-NEXT: ---
6// CHECK-NEXT: report.cpp 5 2 60.00% 4 75.00%
7// CHECK-NEXT: ---
8// CHECK-NEXT: TOTAL 5 2 60.00% 4 75.00%
9
10// FILT: File 'report.cpp':
11// FILT-NEXT: Name Regions Miss Cover Lines Miss Cover
12// FILT-NEXT: ---
13// FILT-NEXT: _Z3foob 2 1 50.00% 4 2 50.00%
14// FILT-NEXT: _Z3barv 1 0 100.00% 2 0 100.00%
15// FILT-NEXT: _Z4funcv 1 1 0.00% 2 2 0.00%
16// FILT-NEXT: main 1 0 100.00% 5 0 100.00%
17// FILT-NEXT: ---
18// FILT-NEXT: TOTAL 5 2 60.00% 13 4 69.23%
Alex Lorenzcb1702d2014-09-30 12:45:13 +000019
20void foo(bool cond) {
21 if (cond) {
22 }
23}
24
25void bar() {
26}
27
28void func() {
29}
30
31int main() {
32 foo(false);
33 bar();
34 return 0;
35}
Vedant Kumar8d74cb22016-06-29 00:38:21 +000036
37// Test that listing multiple functions in a function view works.
38// RUN: llvm-cov show -o %t.dir %S/Inputs/report.covmapping -instr-profile=%S/Inputs/report.profdata -filename-equivalence -name-regex=".*" %s
39// RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/functions.txt %s
40// FUNCTIONS: _Z3foob
41// FUNCTIONS: _Z3barv
42// FUNCTIONS: _Z4func