]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/coverage-experiments/src/while.rs
explained lang_item function body (count_code_region)
[rust.git] / src / test / codegen / coverage-experiments / src / while.rs
1 #[inline(always)]
2 pub fn __incr_cov<T>(_region_loc: &str, result: T) -> T {
3     result
4 }
5
6 fn main() {
7     let mut countdown = 10;
8     __incr_cov("block start",());
9     while __incr_cov("while test", countdown > 0) {
10         countdown -= 1;
11     }
12
13     let mut countdown = 10;
14     __incr_cov("after first while loop",());
15     while __incr_cov("while test", countdown > 0) {
16         countdown -= 1;
17         if countdown < 5 {
18             __incr_cov("top of if countdown < 5",());
19             break;
20         }
21         countdown -= 2;
22     }
23 }