]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.match_or_pattern.txt
Auto merge of #84904 - ssomers:btree_drop_kv_in_place, r=Mark-Simulacrum
[rust.git] / src / test / run-make-fulldeps / coverage-reports / expected_show_coverage.match_or_pattern.txt
1     1|       |#![feature(or_patterns)]
2     2|       |
3     3|      1|fn main() {
4     4|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
5     5|      1|    // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
6     6|      1|    // dependent conditions.
7     7|      1|    let is_true = std::env::args().len() == 1;
8     8|      1|
9     9|      1|    let mut a: u8 = 0;
10    10|      1|    let mut b: u8 = 0;
11    11|      1|    if is_true {
12    12|      1|        a = 2;
13    13|      1|        b = 0;
14    14|      1|    }
15                    ^0
16    15|      1|    match (a, b) {
17    16|       |        // Or patterns generate MIR `SwitchInt` with multiple targets to the same `BasicBlock`.
18    17|       |        // This test confirms a fix for Issue #79569.
19    18|      0|        (0 | 1, 2 | 3) => {}
20    19|      1|        _ => {}
21    20|       |    }
22    21|      1|    if is_true {
23    22|      1|        a = 0;
24    23|      1|        b = 0;
25    24|      1|    }
26                    ^0
27    25|      1|    match (a, b) {
28    26|      0|        (0 | 1, 2 | 3) => {}
29    27|      1|        _ => {}
30    28|       |    }
31    29|      1|    if is_true {
32    30|      1|        a = 2;
33    31|      1|        b = 2;
34    32|      1|    }
35                    ^0
36    33|      1|    match (a, b) {
37    34|      0|        (0 | 1, 2 | 3) => {}
38    35|      1|        _ => {}
39    36|       |    }
40    37|      1|    if is_true {
41    38|      1|        a = 0;
42    39|      1|        b = 2;
43    40|      1|    }
44                    ^0
45    41|      1|    match (a, b) {
46    42|      1|        (0 | 1, 2 | 3) => {}
47    43|      0|        _ => {}
48    44|       |    }
49    45|      1|}
50