[cfe-dev] clang-cl: missing code coverage when exception handling is enabled

Jan Kokemüller via cfe-dev cfe-dev at lists.llvm.org
Mon Apr 23 08:23:37 PDT 2018


On 23.04.2018 16:52, David Blaikie wrote:
> What do you mean by "won't work" - in the sense that a function that has exceptions enabled but no exception path is tested won't have full coverage? That seems arguably correct/useful?

Currently functions that use exceptions are not instrumented at all. All
code in such functions shows up as '-' in the .gcov files.

For example: If you use std::string in a function and have exceptions
enabled with "/EHsc" this function won't be instrumented as std::string
might throw std::bad_alloc.

This is a pretty new feature though[1]. It works great for the Firefox
code base, but they have exceptions disabled I think.


[1]: https://marco-c.github.io/2018/01/09/code-coverage-with-clang-on-windows.html



More information about the cfe-dev mailing list