blob: 4c35401d41c3cc7889260a073ba8f0135aaa3ef7 [file] [log] [blame]
Eli Friedman50479f62017-09-11 22:56:20 +00001// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=,%S 2>&1 -show-region-summary -show-instantiation-summary | FileCheck %s
Sean Eveson9edfeac2017-08-14 10:20:12 +00002// 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
Vedant Kumarfeb3f522017-09-25 23:10:03 +00004// RUN: not llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -path-equivalence=,%S 2>&1 | FileCheck -check-prefix=NO_FILES %s
5
6// NO_FILES: Source files must be specified when -show-functions=true is specified
Alex Lorenzcb1702d2014-09-30 12:45:13 +00007
Vedant Kumar016111f2016-09-19 00:38:23 +00008// CHECK: Regions Missed Regions Cover Functions Missed Functions Executed Instantiations Missed Insts. Executed Lines Missed Lines Cover
Justin Bogner0ef7a2a2015-02-14 02:05:05 +00009// CHECK-NEXT: ---
Vedant Kumar016111f2016-09-19 00:38:23 +000010// 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 +000011// CHECK-NEXT: ---
Vedant Kumar016111f2016-09-19 00:38:23 +000012// 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 +000013
14// FILT: File 'report.cpp':
15// FILT-NEXT: Name Regions Miss Cover Lines Miss Cover
16// FILT-NEXT: ---
17// FILT-NEXT: _Z3foob 2 1 50.00% 4 2 50.00%
18// FILT-NEXT: _Z3barv 1 0 100.00% 2 0 100.00%
19// FILT-NEXT: _Z4funcv 1 1 0.00% 2 2 0.00%
20// FILT-NEXT: main 1 0 100.00% 5 0 100.00%
21// FILT-NEXT: ---
22// FILT-NEXT: TOTAL 5 2 60.00% 13 4 69.23%
Alex Lorenzcb1702d2014-09-30 12:45:13 +000023
24void foo(bool cond) {
25 if (cond) {
26 }
27}
28
29void bar() {
30}
31
32void func() {
33}
34
35int main() {
36 foo(false);
37 bar();
38 return 0;
39}
Vedant Kumar8d74cb22016-06-29 00:38:21 +000040
41// Test that listing multiple functions in a function view works.
Sean Eveson9edfeac2017-08-14 10:20:12 +000042// 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 +000043// RUN: FileCheck -check-prefix=FUNCTIONS -input-file %t.dir/functions.txt %s
44// FUNCTIONS: _Z3foob
45// FUNCTIONS: _Z3barv
46// FUNCTIONS: _Z4func