]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/while_storage.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / mir-opt / while_storage.rs
1 // Test that we correctly generate StorageDead statements for while loop
2 // conditions on all branches
3
4 fn get_bool(c: bool) -> bool {
5     c
6 }
7
8 // EMIT_MIR while_storage.while_loop.PreCodegen.after.mir
9 fn while_loop(c: bool) {
10     while get_bool(c) {
11         if get_bool(c) {
12             break;
13         }
14     }
15 }
16
17 fn main() {
18     while_loop(false);
19 }