summary refs log tree commit diff
path: root/src/test/mir-opt/while-storage.rs
blob: 56f6c3380a719b0c7e2c591939ed723513a4fa2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test that we correctly generate StorageDead statements for while loop
// conditions on all branches

fn get_bool(c: bool) -> bool {
    c
}

// EMIT_MIR rustc.while_loop.PreCodegen.after.mir
fn while_loop(c: bool) {
    while get_bool(c) {
        if get_bool(c) {
            break;
        }
    }
}

fn main() {
    while_loop(false);
}