diff options
| author | bors <bors@rust-lang.org> | 2024-04-29 11:54:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-29 11:54:49 +0000 |
| commit | 7a5867425959b4b5d69334fa6f02150dc2a5d128 (patch) | |
| tree | 7074df6418d7e361b71a600181cba27e7eb1f763 /tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs | |
| parent | 90846015cc99aa90290c1f4ee95c571fff6901ef (diff) | |
| parent | eb422d5c7e6adccf83533ddb5a9836f6575bcd35 (diff) | |
| download | rust-7a5867425959b4b5d69334fa6f02150dc2a5d128.tar.gz rust-7a5867425959b4b5d69334fa6f02150dc2a5d128.zip | |
Auto merge of #124255 - RenjiSann:renji/mcdc-nested-expressions, r=Zalathar
MCDC coverage: support nested decision coverage
#123409 provided the initial MCDC coverage implementation.
As referenced in #124144, it does not currently support "nested" decisions, like the following example :
```rust
fn nested_if_in_condition(a: bool, b: bool, c: bool) {
if a && if b || c { true } else { false } {
say("yes");
} else {
say("no");
}
}
```
Note that there is an if-expression (`if b || c ...`) embedded inside a boolean expression in the decision of an outer if-expression.
This PR proposes a workaround for this cases, by introducing a Decision context stack, and by handing several `temporary condition bitmaps` instead of just one.
When instrumenting boolean expressions, if the current node is a leaf condition (i.e. not a `||`/`&&` logical operator nor a `!` not operator), we insert a new decision context, such that if there are more boolean expressions inside the condition, they are handled as separate expressions.
On the codegen LLVM side, we allocate as many `temp_cond_bitmap`s as necessary to handle the maximum encountered decision depth.
Diffstat (limited to 'tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs')
0 files changed, 0 insertions, 0 deletions
