0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-21 22:01:17 +01:00
rust/tests/mir-opt/simplify_cfg.rs

20 lines
377 B
Rust

// skip-filecheck
// Test that the goto chain starting from bb0 is collapsed.
//@ compile-flags: -Cpanic=abort
//@ no-prefer-dynamic
// EMIT_MIR simplify_cfg.main.SimplifyCfg-initial.diff
// EMIT_MIR simplify_cfg.main.SimplifyCfg-post-analysis.diff
fn main() {
loop {
if bar() {
break;
}
}
}
#[inline(never)]
fn bar() -> bool {
true
}