]> git.lizzy.rs Git - rust.git/blob - tests/run-make/coverage-reports/expected_show_coverage.simple_loop.txt
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / run-make / coverage-reports / expected_show_coverage.simple_loop.txt
1     1|       |#![allow(unused_assignments)]
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 countdown = 0;
10    10|      1|
11    11|      1|    if
12    12|      1|        is_true
13    13|      1|    {
14    14|      1|        countdown
15    15|      1|        =
16    16|      1|            10
17    17|      1|        ;
18    18|      1|    }
19                    ^0
20    19|       |
21    20|       |    loop
22    21|       |    {
23    22|       |        if
24    23|     11|            countdown
25    24|     11|                ==
26    25|     11|            0
27    26|       |        {
28    27|      1|            break
29    28|       |            ;
30    29|     10|        }
31    30|     10|        countdown
32    31|     10|        -=
33    32|     10|        1
34    33|       |        ;
35    34|       |    }
36    35|      1|}
37