summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/simplify_cfg.rs
blob: cf7eac4403a284530add300a15e06f49f1285f65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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
}