llvm-cov code coverage tool incorrectly marks the following code as reachable.
This example illustrates the issue: https://godbolt.org/z/ha8PMGGG9
#include <stdlib.h>
#include <stdio.h>
void good() {
exit(0);
puts("never get here"); // Code coverage correctly says this is not reached
}
void inner() {
exit(0);
}
void bad() {
inner();
puts("never get here"); // Code coverage says we reach this
}
This commit terminates region when noreturn funtion is hit: 181dfe4
Additional instructions to reproduce this issue in a local workspace:
o clang -c code-cov-issue.c -fprofile-instr-generate -fcoverage-mapping
o clang -o app.exe code-cov-issue.o -fprofile-instr-generate
o ./app.exe
o llvm-profdata merge -o app.profdata *.profraw
o llvm-cov show --instr-profile=app.profdata ./app.exe
llvm-cov code coverage tool incorrectly marks the following code as reachable.
This example illustrates the issue: https://godbolt.org/z/ha8PMGGG9
This commit terminates region when noreturn funtion is hit: 181dfe4
Additional instructions to reproduce this issue in a local workspace:
o clang -c code-cov-issue.c -fprofile-instr-generate -fcoverage-mapping
o clang -o app.exe code-cov-issue.o -fprofile-instr-generate
o ./app.exe
o llvm-profdata merge -o app.profdata *.profraw
o llvm-cov show --instr-profile=app.profdata ./app.exe