Does clang/llvm have support to produce test coverage files a开发者_开发问答s was the case with GCC which produced .gcov files. if yes how?
I hear that XCode is still under NDA, but I can talk about LLVM and Clang. LLVM now knows how to emit .gcno files when compiling, and .gcda files when your program is run (linked against libprofile_rt). Inside LLVM, this uses the data from debug info to associate the code with the file and line number information.
To use it, you'll need LLVM and Clang from SVN HEAD. That clang should support the same flags that gcc does for building with coverage; --coverage will do, or you can use -ftest-coverge and -fprofile-arcs individually. For linking, GCC supported -lgcov which is wrong for clang+llvm and should be replaced with --coverage, as the LLVM version of the library is named profile_rt, not libgcov.
精彩评论