-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Rust region coverage? #324
Comments
The else arm of the In your example program the else arm isn't executed and has an execution count of 0. In the C++ program, this fact is represented by the Branch Coverage column instead. (Rust currently doesn't support LLVM branch coverage mappings.) |
Why in C++, the else branch does not get its own region even though it does in Rust? |
In Rust with branch coverage enabled ( |
I believe this is an issue on the rustc rather than the cargo-llvm-cov. Would you mind submitting an issue at https://github.com/rust-lang/rust? |
I’m not quite sure what the bug here is supposed to be. Are you referring to the fact that the uncovered else block isn’t highlighted on line 4? |
Yes. I'm not 100% certain that this should be considered a bug, but in any case, since this is a discussion about the behavior of rustc and not cargo-llvm-cov, it is better to discuss it in the rust-lang/rust and not in this repository. |
Hi,
cargo-llvm-cov reports that the following Rust code had 5 region coverage. Why? I count only 4: (1+2) both functions, (3) the if condition, (4) the "then branch". I also looked at the generated llvm-ir but could not figure out where the fifth region came from.
The corresponding C++ program has 4 regions.
cargo-llvm-cov: 0.5.36
LLVM version 17.0.4
The text was updated successfully, but these errors were encountered: