Does clang/llvm have support to produce test coverage files as was the case with GCC which produced .gcov files. if yes how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.