1 /// Test that llvm-cov supports a fake gcov 4.2 format used before clang 11.
3 // RUN: rm -rf %t && mkdir %t && cd %t
4 // RUN: echo -e '\n\n\n\n\n\n\n\n\n' > test.cpp && echo > test.h
5 // RUN: llvm-cov gcov test. --gcno=%S/Inputs/gcov-fake-4.2.gcno --gcda=%S/Inputs/gcov-fake-4.2.gcda | FileCheck %s
6 // RUN: FileCheck %s --check-prefix=C < test.cpp.gcov
7 // RUN: FileCheck %s --check-prefix=H < test.h.gcov
9 // CHECK: File 'test.cpp'
10 // CHECK-NEXT: Lines executed:84.21% of 38
11 // CHECK-NEXT: Creating 'test.cpp.gcov'
13 // CHECK-NEXT: File './test.h'
14 // CHECK-NEXT: Lines executed:100.00% of 1
15 // CHECK-NEXT: Creating 'test.h.gcov'
18 // C: -: 0:Source:test.cpp
19 // C-NEXT: -: 0:Graph:{{.*}}gcov-fake-4.2.gcno
20 // C-NEXT: -: 0:Data:{{.*}}gcov-fake-4.2.gcda
21 /// `Runs` is stored in GCOV_TAG_OBJECT_SUMMARY with a length of 9.
22 // C-NEXT: -: 0:Runs:2
23 // C-NEXT: -: 0:Programs:1
33 // C-NEXT:8589934592: 10:
35 // H: -: 0:Source:./test.h
36 // H-NEXT: -: 0:Graph:{{.*}}gcov-fake-4.2.gcno
37 // H-NEXT: -: 0:Data:{{.*}}gcov-fake-4.2.gcda
38 // H-NEXT: -: 0:Runs:2
39 // H-NEXT: -: 0:Programs:1