Skip to content

Commit

Permalink
Auto merge of #127234 - ZhuUx:inlined-expr, r=davidtwco,Zalathar
Browse files Browse the repository at this point in the history
[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 #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.
  • Loading branch information
bors committed Jul 9, 2024
2 parents 9dcaa7f + 83fa6b7 commit 6be96e3
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 24 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_mir_transform/src/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ struct CallSite<'tcx> {

impl<'tcx> MirPass<'tcx> for Inline {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
// FIXME(#127234): Coverage instrumentation currently doesn't handle inlined
// MIR correctly when Modified Condition/Decision Coverage is enabled.
if sess.instrument_coverage_mcdc() {
return false;
}

if let Some(enabled) = sess.opts.unstable_opts.inline_mir {
return enabled;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function name: mcdc_if::mcdc_check_a
Function name: if::mcdc_check_a
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand All @@ -23,7 +23,7 @@ Number of file 0 mappings: 8
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_b
Function name: if::mcdc_check_b
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand All @@ -48,7 +48,7 @@ Number of file 0 mappings: 8
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_both
Function name: if::mcdc_check_both
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand All @@ -73,7 +73,7 @@ Number of file 0 mappings: 8
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_neither
Function name: if::mcdc_check_neither
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand All @@ -98,7 +98,7 @@ Number of file 0 mappings: 8
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_not_tree_decision
Function name: if::mcdc_check_not_tree_decision
Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down Expand Up @@ -133,7 +133,7 @@ Number of file 0 mappings: 10
- Code(Expression(5, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c4 + (c3 + ((c0 - c1) - c2)))

Function name: mcdc_if::mcdc_check_tree_decision
Function name: if::mcdc_check_tree_decision
Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down Expand Up @@ -168,7 +168,7 @@ Number of file 0 mappings: 10
- Code(Expression(5, Add)) at (prev + 3, 1) to (start + 0, 2)
= ((c3 + c4) + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_nested_if
Function name: if::mcdc_nested_if
Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
LL| |//@ edition: 2021
LL| |//@ min-llvm-version: 18
LL| |//@ compile-flags: -Zcoverage-options=mcdc
LL| |//@ llvm-cov-flags: --show-mcdc
LL| |//@ llvm-cov-flags: --show-branches=count --show-mcdc
LL| |
LL| 2|fn mcdc_check_neither(a: bool, b: bool) {
LL| 2| if a && b {
^0
------------------
| Branch (LL:8): [True: 0, False: 2]
| Branch (LL:13): [True: 0, False: 0]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:14)
|
| Number of Conditions: 2
Expand All @@ -34,6 +37,9 @@
LL| 2| if a && b {
^1
------------------
| Branch (LL:8): [True: 1, False: 1]
| Branch (LL:13): [True: 1, False: 0]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:14)
|
| Number of Conditions: 2
Expand All @@ -60,6 +66,9 @@
LL| 2|fn mcdc_check_b(a: bool, b: bool) {
LL| 2| if a && b {
------------------
| Branch (LL:8): [True: 2, False: 0]
| Branch (LL:13): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:14)
|
| Number of Conditions: 2
Expand Down Expand Up @@ -87,6 +96,9 @@
LL| 3| if a && b {
^2
------------------
| Branch (LL:8): [True: 2, False: 1]
| Branch (LL:13): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:14)
|
| Number of Conditions: 2
Expand Down Expand Up @@ -117,6 +129,10 @@
LL| 4| if a && (b || c) {
^3 ^2
------------------
| Branch (LL:8): [True: 3, False: 1]
| Branch (LL:14): [True: 1, False: 2]
| Branch (LL:19): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:21)
|
| Number of Conditions: 3
Expand Down Expand Up @@ -150,6 +166,10 @@
LL| 4| if (a || b) && c {
^1
------------------
| Branch (LL:9): [True: 3, False: 1]
| Branch (LL:14): [True: 1, False: 0]
| Branch (LL:20): [True: 2, False: 2]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:21)
|
| Number of Conditions: 3
Expand Down Expand Up @@ -180,6 +200,9 @@
LL| 3| if a || b {
^0
------------------
| Branch (LL:8): [True: 3, False: 0]
| Branch (LL:13): [True: 0, False: 0]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:14)
|
| Number of Conditions: 2
Expand All @@ -200,6 +223,9 @@
LL| 3| if b && c {
^2
------------------
| Branch (LL:12): [True: 2, False: 1]
| Branch (LL:17): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:12) to (LL:18)
|
| Number of Conditions: 2
Expand Down
2 changes: 1 addition & 1 deletion tests/coverage/mcdc_if.rs → tests/coverage/mcdc/if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ edition: 2021
//@ min-llvm-version: 18
//@ compile-flags: -Zcoverage-options=mcdc
//@ llvm-cov-flags: --show-mcdc
//@ llvm-cov-flags: --show-branches=count --show-mcdc

fn mcdc_check_neither(a: bool, b: bool) {
if a && b {
Expand Down
21 changes: 21 additions & 0 deletions tests/coverage/mcdc/inlined_expressions.cov-map
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Function name: inlined_expressions::inlined_instance
Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
- expression 2 operands: lhs = Counter(2), rhs = Counter(3)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6)
true = c1
false = (c0 - c1)
- Code(Counter(1)) at (prev + 0, 10) to (start + 0, 11)
- MCDCBranch { true: Counter(2), false: Counter(3), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 10) to (start + 0, 11)
true = c2
false = c3
- Code(Expression(1, Add)) at (prev + 1, 1) to (start + 0, 2)
= ((c2 + c3) + (c0 - c1))

41 changes: 41 additions & 0 deletions tests/coverage/mcdc/inlined_expressions.coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
LL| |#![feature(coverage_attribute)]
LL| |//@ edition: 2021
LL| |//@ min-llvm-version: 18
LL| |//@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
LL| |//@ llvm-cov-flags: --show-branches=count --show-mcdc
LL| |
LL| |#[inline(always)]
LL| 3|fn inlined_instance(a: bool, b: bool) -> bool {
LL| 3| a && b
^2
------------------
| Branch (LL:5): [True: 2, False: 1]
| Branch (LL:10): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:5) to (LL:11)
|
| Number of Conditions: 2
| Condition C1 --> (LL:5)
| Condition C2 --> (LL:10)
|
| Executed MC/DC Test Vectors:
|
| C1, C2 Result
| 1 { F, - = F }
| 2 { T, F = F }
| 3 { T, T = T }
|
| C1-Pair: covered: (1,3)
| C2-Pair: covered: (2,3)
| MC/DC Coverage for Decision: 100.00%
|
------------------
LL| 3|}
LL| |
LL| |#[coverage(off)]
LL| |fn main() {
LL| | let _ = inlined_instance(true, false);
LL| | let _ = inlined_instance(false, true);
LL| | let _ = inlined_instance(true, true);
LL| |}

17 changes: 17 additions & 0 deletions tests/coverage/mcdc/inlined_expressions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![feature(coverage_attribute)]
//@ edition: 2021
//@ min-llvm-version: 18
//@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
//@ llvm-cov-flags: --show-branches=count --show-mcdc

#[inline(always)]
fn inlined_instance(a: bool, b: bool) -> bool {
a && b
}

#[coverage(off)]
fn main() {
let _ = inlined_instance(true, false);
let _ = inlined_instance(false, true);
let _ = inlined_instance(true, true);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function name: mcdc_nested_if::doubly_nested_if_in_condition
Function name: nested_if::doubly_nested_if_in_condition
Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down Expand Up @@ -57,7 +57,7 @@ Number of file 0 mappings: 20
- Code(Expression(12, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_nested_if::nested_if_in_condition
Function name: nested_if::nested_if_in_condition
Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down Expand Up @@ -102,7 +102,7 @@ Number of file 0 mappings: 14
- Code(Expression(9, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_nested_if::nested_in_then_block_in_condition
Function name: nested_if::nested_in_then_block_in_condition
Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down Expand Up @@ -166,7 +166,7 @@ Number of file 0 mappings: 20
- Code(Expression(16, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_nested_if::nested_single_condition_decision
Function name: nested_if::nested_single_condition_decision
Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
LL| |//@ edition: 2021
LL| |//@ min-llvm-version: 18
LL| |//@ compile-flags: -Zcoverage-options=mcdc
LL| |//@ llvm-cov-flags: --show-mcdc
LL| |//@ llvm-cov-flags: --show-branches=count --show-mcdc
LL| |
LL| 4|fn nested_if_in_condition(a: bool, b: bool, c: bool) {
LL| 4| if a && if b || c { true } else { false } {
^3 ^2 ^2 ^1
------------------
| Branch (LL:8): [True: 3, False: 1]
| Branch (LL:13): [True: 2, False: 1]
| Branch (LL:16): [True: 1, False: 2]
| Branch (LL:21): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:46)
|
| Number of Conditions: 2
Expand Down Expand Up @@ -53,6 +58,13 @@
LL| 4| if a && if b || if c && d { true } else { false } { false } else { true } {
^3 ^2 ^1 ^1 ^1 ^2 ^1
------------------
| Branch (LL:8): [True: 3, False: 1]
| Branch (LL:13): [True: 1, False: 2]
| Branch (LL:16): [True: 1, False: 2]
| Branch (LL:21): [True: 1, False: 1]
| Branch (LL:24): [True: 1, False: 1]
| Branch (LL:29): [True: 1, False: 0]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:78)
|
| Number of Conditions: 2
Expand Down Expand Up @@ -117,6 +129,10 @@
LL| 3| if a && if b { false } else { true } {
^2 ^1 ^1
------------------
| Branch (LL:8): [True: 2, False: 1]
| Branch (LL:13): [True: 1, False: 1]
| Branch (LL:16): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:41)
|
| Number of Conditions: 2
Expand Down Expand Up @@ -145,6 +161,13 @@
LL| 7| if a && if b || c { if d && e { true } else { false } } else { false } {
^6 ^5 ^5 ^2 ^1 ^4 ^1
------------------
| Branch (LL:8): [True: 6, False: 1]
| Branch (LL:13): [True: 1, False: 5]
| Branch (LL:16): [True: 1, False: 5]
| Branch (LL:21): [True: 4, False: 1]
| Branch (LL:28): [True: 2, False: 3]
| Branch (LL:33): [True: 1, False: 1]
------------------
|---> MC/DC Decision Region (LL:8) to (LL:75)
|
| Number of Conditions: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ edition: 2021
//@ min-llvm-version: 18
//@ compile-flags: -Zcoverage-options=mcdc
//@ llvm-cov-flags: --show-mcdc
//@ llvm-cov-flags: --show-branches=count --show-mcdc

fn nested_if_in_condition(a: bool, b: bool, c: bool) {
if a && if b || c { true } else { false } {
Expand Down
Loading

0 comments on commit 6be96e3

Please sign in to comment.