Hi All, We trying to use clang+llvm to generate the gcc coverage format as clang version 3.6.0 $clang --coverage -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data -Xclang -coverage-version='407*' test.c $a.out $llvm-cov gcov test.gcda Unexpected version: *704. Invalid .gcno File! Debugging the above cause ,But any hints from experts here ,will help a lot . Appreciate your time ,Thank you ~Umesh
Mohamed Galal
2015-Apr-28 13:46 UTC
[LLVMdev] [cfe-dev] GCC compatibility code coverage issue .
I had the same problem. And I've fixed it by using -fprofile-arcs -ftest-coverage instead of --coverage flag. https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html On Tue, Apr 28, 2015 at 6:52 AM, Umesh Kalappa <umesh.kalappa0 at gmail.com> wrote:> Hi All, > > We trying to use clang+llvm to generate the gcc coverage format as > > clang version 3.6.0 > > $clang --coverage -Xclang -coverage-cfg-checksum -Xclang > -coverage-no-function-names-in-data -Xclang -coverage-version='407*' > test.c > > $a.out > > $llvm-cov gcov test.gcda > > Unexpected version: *704. > Invalid .gcno File! > > Debugging the above cause ,But any hints from experts here ,will help a > lot . > > Appreciate your time ,Thank you > ~Umesh > _______________________________________________ > cfe-dev mailing list > cfe-dev at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150428/bfce1153/attachment.html>
On Tuesday, April 28, 2015, Umesh Kalappa <umesh.kalappa0 at gmail.com> wrote:> Hi All, > > We trying to use clang+llvm to generate the gcc coverage format as > > clang version 3.6.0 > > $clang --coverage -Xclang -coverage-cfg-checksum -Xclang > -coverage-no-function-names-in-data -Xclang -coverage-version='407*' > test.c > > $a.out > > $llvm-cov gcov test.gcda > > Unexpected version: *704. > Invalid .gcno File!The llvm-cov tool supports the 402* format, which is what clang emits by default. If you remove the -Xclang arguments from your compilation it should work.> Debugging the above cause ,But any hints from experts here ,will help a > lot . > > Appreciate your time ,Thank you > ~Umesh > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <javascript:;> http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150428/0636d93f/attachment.html>
Umesh Kalappa
2015-Apr-29 03:36 UTC
[LLVMdev] [cfe-dev] GCC compatibility code coverage issue .
Thank you Mohamed for the quick reply ,unfortunately the solution didn't worked for me . bash-4.1$ clang -g -O0 -fprofile-arcs -ftest-coverage -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data test.c bash-4.1$ ./a.out bash-4.1$ llvm-cov gcov test.c Unexpected end of memory buffer: 386832052. Invalid .gcno File! bash-4.1$ clang -v clang version 3.6.0 (tags/RELEASE_360/final) Target: x86_64-unknown-linux-gnu Thread model: posix Thank you again. ~Umesh On Tue, Apr 28, 2015 at 7:16 PM, Mohamed Galal <mohamed.g.ebrahim at gmail.com> wrote:> I had the same problem. And I've fixed it by using -fprofile-arcs > -ftest-coverage instead of --coverage flag. > > https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html > > On Tue, Apr 28, 2015 at 6:52 AM, Umesh Kalappa <umesh.kalappa0 at gmail.com> > wrote: >> >> Hi All, >> >> We trying to use clang+llvm to generate the gcc coverage format as >> >> clang version 3.6.0 >> >> $clang --coverage -Xclang -coverage-cfg-checksum -Xclang >> -coverage-no-function-names-in-data -Xclang -coverage-version='407*' >> test.c >> >> $a.out >> >> $llvm-cov gcov test.gcda >> >> Unexpected version: *704. >> Invalid .gcno File! >> >> Debugging the above cause ,But any hints from experts here ,will help a >> lot . >> >> Appreciate your time ,Thank you >> ~Umesh >> _______________________________________________ >> cfe-dev mailing list >> cfe-dev at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev > >
Hi Justin , Thank you for the reply,but without version too ,the llvm-cov fails i.e bash-4.1$ clang -fprofile-arcs -ftest-coverage test.c bash-4.1$ ./a.out bash-4.1$ llvm-cov gcov test.c Unexpected number of edges (in main). Invalid .gcda File! bash-4.1$ clang -g -O0 -fprofile-arcs -ftest-coverage -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data test.c bash-4.1$ ./a.out bash-4.1$ llvm-cov gcov test.c Unexpected end of memory buffer: 386832052. Invalid .gcno File! bash-4.1$ clang -v clang version 3.6.0 (tags/RELEASE_360/final) Target: x86_64-unknown-linux-gnu Thread model: posix Thank you ~Umesh On Tue, Apr 28, 2015 at 8:32 PM, Justin Bogner <justin at justinbogner.com> wrote:> > On Tuesday, April 28, 2015, Umesh Kalappa <umesh.kalappa0 at gmail.com> wrote: >> >> Hi All, >> >> We trying to use clang+llvm to generate the gcc coverage format as >> >> clang version 3.6.0 >> >> $clang --coverage -Xclang -coverage-cfg-checksum -Xclang >> -coverage-no-function-names-in-data -Xclang -coverage-version='407*' >> test.c >> >> $a.out >> >> $llvm-cov gcov test.gcda >> >> Unexpected version: *704. >> Invalid .gcno File! > > > The llvm-cov tool supports the 402* format, which is what clang emits by > default. If you remove the -Xclang arguments from your compilation it should > work. > >> >> Debugging the above cause ,But any hints from experts here ,will help a >> lot . >> >> Appreciate your time ,Thank you >> ~Umesh >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev