summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/switch_int.rs
blob: 7158ea4d2bd92ecec53a71950a25be59e4fcdf12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+SimplifyConstCondition-after-const-prop
// ignore-wasm32 compiled with panic=abort by default
#[inline(never)]
fn foo(_: i32) { }

// EMIT_MIR switch_int.main.ConstProp.diff
// EMIT_MIR switch_int.main.SimplifyConstCondition-after-const-prop.diff
fn main() {
    match 1 {
        1 => foo(0),
        _ => foo(-1),
    }
}