Open llvmbot opened 4 years ago
Zequan (cc'd) recently landed a series of patches to hide line execution counts for whitespace/comment-only lines.
In general clang's FE-based coverage implementation doesn't behave well when dealing with longjmp (see https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#drawbacks-and-limitations).
In this specific case, clang terminates the current coverage region when it sees a noreturn
call (see https://reviews.llvm.org/D36250). Usually this is fine, but in this case (adding -Xclang -dump-coverage-mapping
):
#0
(12:1 -> 24:2 = #0
)#1
(13:21 -> 15:4 = #1
)#0
- #1
(17:3 -> 24:2 = (#0 - #1)
), i.e. clang thinks the alloca
can't be reached from the entry block if setjmp()
evaluates to trueIt might be possible to fix this by reworking D36250 (to find some other way to make coverage reporting in switches cleaner), but I don't think it's easy to fix reporting issues with longjmp in general.
Looks like a bunch of issues here - there are several blank lines with 0 counts instead of the absence of a count. (perhaps that's just llvm's profdata's way of doing things? Seems problematic/misleading. Especially 0 between rows with 1 without any control flow.
But, yes, also the missing coverage on 17 seems problematic (again, either the absence of a count, if the code has been optimized away maybe, or an accurate count of 1, would be good).
Extended Description
Line 17 is wrongly marked as not executed. The correct coverage should be
1|
.