-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
MCDC Coverage: instrument last boolean RHS operands from condition coverage #125766
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
r? compiler |
80c1cbf
to
10d6546
Compare
@rustbot label +A-code-coverage |
10d6546
to
cb22039
Compare
Other than some tiny nitpicks, the main changes seem reasonable. When the nits are addressed (fixed or justified), this should be good to go. |
cb22039
to
b0a0496
Compare
All nitpicks are addressed. This is good to go :) |
Hi, @Zalathar |
I'm happy with this, with or without addressing my tiny nitpick. r+ from me, but I don't actually have permissions to add this to the queue on my own. |
(Sorry for the delay!) |
r=me once the @bors delegate=RenjiSann |
✌️ @RenjiSann, you can now approve this pull request! If @nnethercote told you to " |
Condition coverage extends branch coverage to treat the specific case of last operands of boolean decisions not involved in control flow. This is ultimately made for MCDC to be exhaustive on all boolean expressions. This patch adds a call to `visit_branch_coverage_operation` to track the top-level operand of the said decisions, and changes `visit_coverage_standalone_condition` so MCDC branch registration is called when enabled on these _last RHS_ cases.
b0a0496
to
e15adef
Compare
Done 👍 |
Rollup of 6 pull requests Successful merges: - rust-lang#125447 (Allow constraining opaque types during subtyping in the trait system) - rust-lang#125766 (MCDC Coverage: instrument last boolean RHS operands from condition coverage) - rust-lang#125880 (Remove `src/tools/rust-demangler`) - rust-lang#126154 (StorageLive: refresh storage (instead of UB) when local is already live) - rust-lang#126572 (override user defined channel when using precompiled rustc) - rust-lang#126662 (Unconditionally warn on usage of `wasm32-wasi`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125766 - RenjiSann:fresh-mcdc-branch-on-bool, r=nnethercote MCDC Coverage: instrument last boolean RHS operands from condition coverage Fresh PR from rust-lang#124652 -- This PR ensures that the top-level boolean expressions that are not part of the control flow are correctly instrumented thanks to condition coverage. See discussion on rust-lang#124120. Depends on `@Zalathar` 's condition coverage implementation rust-lang#125756.
@bors retry r- |
…thar [Coverage][MCDC] Group mcdc tests and fix panic when generating mcdc code for inlined expressions. ### Changes 1. Group all mcdc tests to one directory. 2. Since mcdc instruments different mappings for boolean expressions with normal branch coverage as rust-lang#125766 introduces, it would be better also trace branch coverage results in mcdc tests. 3. So far rustc does not call `CoverageInfoBuilderMethods::init_coverage` for inlined functions. As a result, it could panic if it tries to instrument mcdc statements for inlined functions due to uninitialized cond bitmaps. We can reproduce this issue by current nightly rustc and [the test](https://github.com/rust-lang/rust/pull/127234/files#diff-c81af6bf4869aa42f5c7334e3e86344475de362f673f54ce439ec75fcb5ac3e5) with flag `--release`. This patch fixes it.
Fresh PR from #124652
--
This PR ensures that the top-level boolean expressions that are not part of the control flow are correctly instrumented thanks to condition coverage.
See discussion on #124120.
Depends on @Zalathar 's condition coverage implementation #125756.