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

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Mon Apr 23 08:24:33 PDT 2018


Ah, I see - thanks for explaining! (I have no further context/don't work on
the Windows side of things - so will leave the rest of the thread to others
who might have more relevant info)

On Mon, Apr 23, 2018 at 8:23 AM Jan Kokemüller <jan.kokemueller at gmail.com>
wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180423/892c0570/attachment.html>


More information about the cfe-dev mailing list