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