When llvm-cov tries to open an .gcda file created by clang the following error is showed: warning: Using the gcov compatible mode (this behaviour may be dropped in the future). Unexpected number of edges (in _Z4testi). Invalid .gcda File! And when I tried to open with gcov (4.6.4) the following message appeared: test.gcno:version '402*', prefer '406*' test.gcda:version '402*', prefer version '406*' test.gcno:'_Z4testi' has arcs from exit block test.gcno:'main' has arcs from exit block File 'test.cpp' Lines executed:83.33% of 6 test.cpp:creating 'test.cpp.gcov'
Created attachment 13795 [details] Testcase
Created attachment 13796 [details] Test code
Created attachment 13812 [details] A solution for when GCDA has exit block edges.
So I am planning on applying something like the patch that's here, as it makes sense to warn instead of failing, but the real problem is that clang's generating bogus coverage data right now. In r223193 we started emitting the exit block second instead of last, but this isn't compatible with how gcov worked before 4.7 or 4.8. Since we claim we're generating gcov 4.2 compatible output, the gcov data we're outputting is pretty bogus. Some discussion of this is ongoing on the r223193 review thread: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150309/265388.html
This should be fixed by r232438 - clang emits the 4.2 compatible coverage that llvm-cov understands by default again.