summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/simplify_cfg.rs
blob: a87aaca544cee00b23682d0880821a41b236bb88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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-early-opt.diff
fn main() {
    loop {
        if bar() {
            break;
        }
    }
}

#[inline(never)]
fn bar() -> bool {
    true
}