【发布时间】:2019-10-09 01:23:16
【问题描述】:
我正在尝试建立一个基本项目,并且我想使用 gcov。当我使用 g++ 时,它可以工作:
g++ main.cpp whatever.cpp -fprofile-arcs -ftest-coverage
gcov的输出是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'
但是,我需要使用 clang。运行编译命令后:
clang++-6.0 main.cpp whatever.cpp -fprofile-arcs -ftest-coverage
我收到以下错误:
main.gcno:version '402*', prefer 'A73*'
gcov: out of memory allocating 16158246392 bytes after a total of 0 bytes
我的gcov版本是7.3.0,和gcc和g++一样。
知道什么是错的,我能做些什么吗?
谢谢!
【问题讨论】:
-
您的意思是
llvm-cov? Clang有自己的覆盖源代码检测方法,目前不知道是否兼容gcov。