blob: 49425eb5f62415b525703d9f3591f6c53417bb3a [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
Vedant Kumar62eb0fd2017-02-05 20:11:08 +00002// RUN: llvm-cov report -show-functions %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 -show-functions %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
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.
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