rust/src/test/mir-opt/while-storage.rs

20 lines
343 B
Rust
Raw Normal View History

// Test that we correctly generate StorageDead statements for while loop
// conditions on all branches
fn get_bool(c: bool) -> bool {
c
}
2020-04-02 21:09:01 +00:00
// 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);
}