1 RUN: rm -rf %t && mkdir %t && cd %t
2 RUN: cp %S/Inputs/test.gcno %S/Inputs/test.gcda .
4 RUN: llvm-cov gcov -i test.cpp 2> %t.err | FileCheck %s --check-prefixes=OUT
5 RUN: FileCheck %s --check-prefix=I < test.cpp.gcov
6 RUN: cp test.cpp.gcov saved.cpp.gcov
8 # -i does not read source files. No ENOENT diagnostic.
11 # -n suppresses the .gcov output.
12 RUN: llvm-cov gcov -i -n test. | FileCheck %s --check-prefixes=OUT
13 RUN: not ls test..gcov
15 # The output filename is formed by appending ".gcov" to the specifiled filename.
16 RUN: llvm-cov gcov -i test. | FileCheck %s --check-prefix=OUT
17 RUN: cmp test..gcov saved.cpp.gcov
19 RUN: llvm-cov gcov -i -b test.cpp | FileCheck %s --check-prefixes=OUT,OUT-B
20 RUN: FileCheck %s --check-prefixes=I,I-B --match-full-lines --strict-whitespace < test.cpp.gcov
22 # Many other options are ignored.
23 RUN: rm -f test.cpp.gcov && llvm-cov gcov -i -a -c -l -p -u -x test.cpp
24 RUN: cmp test.cpp.gcov saved.cpp.gcov
27 OUT-NEXT:Lines executed:81.40% of 43
28 OUT-B-NEXT:Branches executed:100.00% of 15
29 OUT-B-NEXT:Taken at least once:86.67% of 15
32 OUT-NEXT:File 'test.h'
33 OUT-NEXT:Lines executed:100.00% of 1
34 OUT-B-NEXT:No branches
39 I:function:10,4294967296,_ZN1A1BEv
40 I-NEXT:function:12,0,_Z7uselessv
41 I-NEXT:function:14,0,_Z12more_uselessv
42 I-NEXT:function:18,1,_Z3foov
43 I-NEXT:function:23,0,_Z3barv
44 I-NEXT:function:28,4,_Z6assignii
45 I-NEXT:function:32,1,_Z15initialize_gridv
46 I-NEXT:function:38,1,main
47 I:lcount:10,4294967296
49 I-B-NEXT:branch:33,taken
50 I-B-NEXT:branch:33,taken
52 I-NEXT:function:2,1,_ZN1AC2Ev