blob: 92f8158db584f24f468be065bc514891cf29ae8d [file] [log] [blame]
Sean Eveson9edfeac2017-08-14 10:20:12 +00001// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=,%S 2>&1 | FileCheck %s
2// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=,%S %s 2>&1 | FileCheck -check-prefix=FILT %s
3// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=,%S %s does-not-exist.cpp 2>&1 | FileCheck -check-prefix=FILT %s
Alex Lorenzcb1702d2014-09-30 12:45:13 +00004
Vedant Kumar016111f2016-09-19 00:38:23 +00005// CHECK: Regions Missed Regions Cover Functions Missed Functions Executed Instantiations Missed Insts. Executed Lines Missed Lines Cover
Justin Bogner0ef7a2a2015-02-14 02:05:05 +00006// CHECK-NEXT: ---
Vedant Kumar016111f2016-09-19 00:38:23 +00007// CHECK-NEXT: report.cpp 5 2 60.00% 4 1 75.00% 4 1 75.00% 13 4 69.23%
Justin Bogner0ef7a2a2015-02-14 02:05:05 +00008// CHECK-NEXT: ---
Vedant Kumar016111f2016-09-19 00:38:23 +00009// CHECK-NEXT: TOTAL 5 2 60.00% 4 1 75.00% 4 1 75.00% 13 4 69.23%
Justin Bogner0ef7a2a2015-02-14 02:05:05 +000010
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%
Alex Lorenzcb1702d2014-09-30 12:45:13 +000020
21void foo(bool cond) {
22 if (cond) {
23 }
24}
25
26void bar() {
27}
28
29void func() {
30}
31
32int main() {
33 foo(false);
34 bar();
35 return 0;
36}
Vedant Kumar8d74cb22016-06-29 00:38:21 +000037
38// Test that listing multiple functions in a function view works.
Sean Eveson9edfeac2017-08-14 10:20:12 +000039// RUN: llvm-cov show -o %t.dir %S/Inputs/report.covmapping -instr-profile=%S/Inputs/report.profdata -path-equivalence=,%S -name-regex=".*" %s
Vedant Kumar8d74cb22016-06-29 00:38:21 +000040// RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/functions.txt %s
41// FUNCTIONS: _Z3foob
42// FUNCTIONS: _Z3barv
43// FUNCTIONS: _Z4func