I am trying to set up a basic project, and I want to use gcov. When I use g++, it works:
g++ main.cpp whatever.cpp -fprofile-arcs -ftest-coverage
The output of gcov is OK:
gcov main.gcno
main.gcda:cannot open data file, assuming not executed
File 'main.cpp'
Lines executed:0.00% of 20
Creating 'main.cpp.gcov'
File '/usr/include/c++/7/iostream'
Lines executed:0.00% of 1
Creating 'iostream.gcov'
However, I need to use clang. After running the compile command:
clang++-6.0 main.cpp whatever.cpp -fprofile-arcs -ftest-coverage
I get the following error:
main.gcno:version '402*', prefer 'A73*'
gcov: out of memory allocating 16158246392 bytes after a total of 0 bytes
My gcov version is 7.3.0, same as gcc and g++.
Any idea what is wrong and what I can do about it?
Thanks!