diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-10-28 21:23:23 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-11-07 11:15:18 +1100 |
| commit | f5df56b26b5a9c46299e74591602940c0e48b08c (patch) | |
| tree | 5e45e4f86e3b70a650bef318bbbae57b1ba26554 /tests/coverage-map/nested_loops.rs | |
| parent | 8eef39f0825f03629373e430063f331149da6d37 (diff) | |
| download | rust-f5df56b26b5a9c46299e74591602940c0e48b08c.tar.gz rust-f5df56b26b5a9c46299e74591602940c0e48b08c.zip | |
coverage: Flatten `coverage-map/status-quo/` into its parent directory
Diffstat (limited to 'tests/coverage-map/nested_loops.rs')
| -rw-r--r-- | tests/coverage-map/nested_loops.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/coverage-map/nested_loops.rs b/tests/coverage-map/nested_loops.rs new file mode 100644 index 00000000000..4c7c7842796 --- /dev/null +++ b/tests/coverage-map/nested_loops.rs @@ -0,0 +1,25 @@ +fn main() { + let is_true = std::env::args().len() == 1; + let mut countdown = 10; + + 'outer: while countdown > 0 { + let mut a = 100; + let mut b = 100; + for _ in 0..50 { + if a < 30 { + break; + } + a -= 5; + b -= 5; + if b < 90 { + a -= 10; + if is_true { + break 'outer; + } else { + a -= 2; + } + } + } + countdown -= 1; + } +} |
