Line data Source code
1 : // Make sure that llvm-cov can read coverage data written in gcov47+ compatible
2 : // format.
3 :
4 : // Compile with these arguments and run the result to generate .gc* files:
5 : // -coverage -Xclang -coverage-no-function-names-in-data
6 : // -Xclang -coverage-cfg-checksum -Xclang -coverage-version='407*'
7 :
8 : // We need shell for cd
9 : // REQUIRES: shell
10 :
11 : // RUN: rm -rf %t
12 : // RUN: mkdir %t
13 : // RUN: cd %t
14 : // RUN: cp %s %p/Inputs/gcov47_compatibility.gc* .
15 :
16 : // RUN: llvm-cov gcov gcov47_compatibility.cpp | FileCheck %s --check-prefix=STDOUT
17 : // STDOUT: File 'gcov47_compatibility.cpp'
18 : // STDOUT: Lines executed:100.00% of 1
19 : // STDOUT: gcov47_compatibility.cpp:creating 'gcov47_compatibility.cpp.gcov'
20 :
21 : // RUN: FileCheck %s --check-prefix=GCOV < %t/gcov47_compatibility.cpp.gcov
22 : // GCOV: -: 0:Runs:1
23 : // GCOV: -: 0:Programs:1
24 :
25 : int main(int argc, const char *argv[]) { // GCOV: -: [[@LINE]]:int main(
26 1 : return 0; // GCOV: 1: [[@LINE]]: return
27 : } // GCOV: -: [[@LINE]]:}
28 :
29 : // llvm-cov doesn't work on big endian yet
30 : // XFAIL: powerpc-, powerpc64-, s390x, mips-, mips64-, sparc
|