about summary refs log tree commit diff
path: root/tests/coverage/mcdc/if.coverage
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-08 05:59:00 +0000
committerbors <bors@rust-lang.org>2025-08-08 05:59:00 +0000
commit2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a (patch)
tree1609159274b26a3f4a74193ec76c62dfe5046b00 /tests/coverage/mcdc/if.coverage
parent67d45f49e09cb8f355df2ffae22cfc3d7ee6c278 (diff)
parentf6283aebcb84c61888c7955a6760e928ecfd2209 (diff)
downloadrust-2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a.tar.gz
rust-2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a.zip
Auto merge of #145077 - Zalathar:rollup-0k4194x, r=Zalathar
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#144400 (`tests/ui/issues/`: The Issues Strike Back [3/N])
 - rust-lang/rust#144764 ([codegen] assume the tag, not the relative discriminant)
 - rust-lang/rust#144807 (Streamline config in bootstrap)
 - rust-lang/rust#144899 (Print CGU reuse statistics in `-Zprint-mono-items`)
 - rust-lang/rust#144909 (Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information)
 - rust-lang/rust#144912 (Resolver: introduce a conditionally mutable Resolver for (non-)speculative resolution.)
 - rust-lang/rust#144914 (Add support for `ty::Instance` path shortening in diagnostics)
 - rust-lang/rust#144931 ([win][arm64ec] Fix msvc-wholearchive for Arm64EC)
 - rust-lang/rust#144999 (coverage: Remove all unstable support for MC/DC instrumentation)
 - rust-lang/rust#145009 (A couple small changes for rust-analyzer next-solver work)
 - rust-lang/rust#145030 (GVN:  Do not flatten derefs with ProjectionElem::Index. )
 - rust-lang/rust#145042 (stdarch subtree update)
 - rust-lang/rust#145047 (move `type_check` out of `compute_regions`)
 - rust-lang/rust#145051 (Prevent name collisions with internal implementation details)
 - rust-lang/rust#145053 (Add a lot of NLL `known-bug` tests)
 - rust-lang/rust#145055 (Move metadata symbol export from exported_non_generic_symbols to exported_symbols)
 - rust-lang/rust#145057 (Clean up some resolved test regressions of const trait removals in std)
 - rust-lang/rust#145068 (Readd myself to review queue)
 - rust-lang/rust#145070 (Add minimal `armv7a-vex-v5` tier three target)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/coverage/mcdc/if.coverage')
-rw-r--r--tests/coverage/mcdc/if.coverage287
1 files changed, 0 insertions, 287 deletions
diff --git a/tests/coverage/mcdc/if.coverage b/tests/coverage/mcdc/if.coverage
deleted file mode 100644
index fda5525c472..00000000000
--- a/tests/coverage/mcdc/if.coverage
+++ /dev/null
@@ -1,287 +0,0 @@
-   LL|       |#![feature(coverage_attribute)]
-   LL|       |//@ edition: 2021
-   LL|       |//@ compile-flags: -Zcoverage-options=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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:13)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2    Result
-  |  1 { F,  -  = F      }
-  |
-  |  C1-Pair: not covered
-  |  C2-Pair: not covered
-  |  MC/DC Coverage for Decision: 0.00%
-  |
-  ------------------
-   LL|      0|        say("a and b");
-   LL|      2|    } else {
-   LL|      2|        say("not both");
-   LL|      2|    }
-   LL|      2|}
-   LL|       |
-   LL|      2|fn mcdc_check_a(a: bool, b: bool) {
-   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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:13)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2    Result
-  |  1 { F,  -  = F      }
-  |  2 { T,  T  = T      }
-  |
-  |  C1-Pair: covered: (1,2)
-  |  C2-Pair: not covered
-  |  MC/DC Coverage for Decision: 50.00%
-  |
-  ------------------
-   LL|      1|        say("a and b");
-   LL|      1|    } else {
-   LL|      1|        say("not both");
-   LL|      1|    }
-   LL|      2|}
-   LL|       |
-   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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:13)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2    Result
-  |  1 { T,  F  = F      }
-  |  2 { T,  T  = T      }
-  |
-  |  C1-Pair: not covered
-  |  C2-Pair: covered: (1,2)
-  |  MC/DC Coverage for Decision: 50.00%
-  |
-  ------------------
-   LL|      1|        say("a and b");
-   LL|      1|    } else {
-   LL|      1|        say("not both");
-   LL|      1|    }
-   LL|      2|}
-   LL|       |
-   LL|      3|fn mcdc_check_both(a: bool, b: bool) {
-   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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:13)
-  |
-  |  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|      1|        say("a and b");
-   LL|      2|    } else {
-   LL|      2|        say("not both");
-   LL|      2|    }
-   LL|      3|}
-   LL|       |
-   LL|      4|fn mcdc_check_tree_decision(a: bool, b: bool, c: bool) {
-   LL|       |    // This expression is intentionally written in a way
-   LL|       |    // where 100% branch coverage indicates 100% mcdc coverage.
-   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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:14)
-  |     Condition C3 --> (LL:19)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2, C3    Result
-  |  1 { F,  -,  -  = F      }
-  |  2 { T,  F,  F  = F      }
-  |  3 { T,  F,  T  = T      }
-  |  4 { T,  T,  -  = T      }
-  |
-  |  C1-Pair: covered: (1,3)
-  |  C2-Pair: covered: (2,4)
-  |  C3-Pair: covered: (2,3)
-  |  MC/DC Coverage for Decision: 100.00%
-  |
-  ------------------
-   LL|      2|        say("pass");
-   LL|      2|    } else {
-   LL|      2|        say("reject");
-   LL|      2|    }
-   LL|      4|}
-   LL|       |
-   LL|      4|fn mcdc_check_not_tree_decision(a: bool, b: bool, c: bool) {
-   LL|       |    // Contradict to `mcdc_check_tree_decision`,
-   LL|       |    // 100% branch coverage of this expression does not indicate 100% mcdc coverage.
-   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
-  |     Condition C1 --> (LL:9)
-  |     Condition C2 --> (LL:14)
-  |     Condition C3 --> (LL:20)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2, C3    Result
-  |  1 { T,  -,  F  = F      }
-  |  2 { F,  T,  T  = T      }
-  |  3 { T,  -,  T  = T      }
-  |
-  |  C1-Pair: not covered
-  |  C2-Pair: not covered
-  |  C3-Pair: covered: (1,3)
-  |  MC/DC Coverage for Decision: 33.33%
-  |
-  ------------------
-   LL|      2|        say("pass");
-   LL|      2|    } else {
-   LL|      2|        say("reject");
-   LL|      2|    }
-   LL|      4|}
-   LL|       |
-   LL|      3|fn mcdc_nested_if(a: bool, b: bool, c: bool) {
-   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
-  |     Condition C1 --> (LL:8)
-  |     Condition C2 --> (LL:13)
-  |
-  |  Executed MC/DC Test Vectors:
-  |
-  |     C1, C2    Result
-  |  1 { T,  -  = T      }
-  |
-  |  C1-Pair: not covered
-  |  C2-Pair: not covered
-  |  MC/DC Coverage for Decision: 0.00%
-  |
-  ------------------
-   LL|      3|        say("a or b");
-   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
-  |     Condition C1 --> (LL:12)
-  |     Condition C2 --> (LL:17)
-  |
-  |  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|      1|            say("b and c");
-   LL|      2|        }
-   LL|      0|    } else {
-   LL|      0|        say("neither a nor b");
-   LL|      0|    }
-   LL|      3|}
-   LL|       |
-   LL|       |#[coverage(off)]
-   LL|       |fn main() {
-   LL|       |    mcdc_check_neither(false, false);
-   LL|       |    mcdc_check_neither(false, true);
-   LL|       |
-   LL|       |    mcdc_check_a(true, true);
-   LL|       |    mcdc_check_a(false, true);
-   LL|       |
-   LL|       |    mcdc_check_b(true, true);
-   LL|       |    mcdc_check_b(true, false);
-   LL|       |
-   LL|       |    mcdc_check_both(false, true);
-   LL|       |    mcdc_check_both(true, true);
-   LL|       |    mcdc_check_both(true, false);
-   LL|       |
-   LL|       |    mcdc_check_tree_decision(false, true, true);
-   LL|       |    mcdc_check_tree_decision(true, true, false);
-   LL|       |    mcdc_check_tree_decision(true, false, false);
-   LL|       |    mcdc_check_tree_decision(true, false, true);
-   LL|       |
-   LL|       |    mcdc_check_not_tree_decision(false, true, true);
-   LL|       |    mcdc_check_not_tree_decision(true, true, false);
-   LL|       |    mcdc_check_not_tree_decision(true, false, false);
-   LL|       |    mcdc_check_not_tree_decision(true, false, true);
-   LL|       |
-   LL|       |    mcdc_nested_if(true, false, true);
-   LL|       |    mcdc_nested_if(true, true, true);
-   LL|       |    mcdc_nested_if(true, true, false);
-   LL|       |}
-   LL|       |
-   LL|       |#[coverage(off)]
-   LL|       |fn say(message: &str) {
-   LL|       |    core::hint::black_box(message);
-   LL|       |}
-