xref: /aosp_15_r20/external/llvm/test/tools/llvm-cov/Inputs/README (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerThese inputs were pre-generated to allow for easier testing of llvm-cov.
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard WorkerThe files used to test the gcov compatible code coverage tool were generated
4*9880d681SAndroid Build Coastguard Workerusing the following method:
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker  test.gcno and test.gcda were create by running clang:
7*9880d681SAndroid Build Coastguard Worker    clang++ -g -ftest-coverage -fprofile-arcs test.cpp
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker  test.cpp.gcov was created by running gcov 4.2.1:
10*9880d681SAndroid Build Coastguard Worker    gcov test.cpp
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard WorkerThe 'covmapping' files that are used to test llvm-cov contain raw sections
13*9880d681SAndroid Build Coastguard Workerwith the coverage mapping data generated by the compiler and linker. They are
14*9880d681SAndroid Build Coastguard Workercreated by running clang and llvm-cov:
15*9880d681SAndroid Build Coastguard Worker  clang++ -fprofile-instr-generate -fcoverage-mapping -o test test.cpp
16*9880d681SAndroid Build Coastguard Worker  llvm-cov convert-for-testing -o test.covmapping test
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard WorkerThe 'profdata' files were generated by running an instrumented version of the
19*9880d681SAndroid Build Coastguard Workerprogram and merging the raw profile data using llvm-profdata.
20*9880d681SAndroid Build Coastguard Worker  ./test
21*9880d681SAndroid Build Coastguard Worker  llvm-profdata merge -o test.profdata default.profraw
22