about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/boolean_identities.rs
blob: f23749312f232d2d3c559960a1cb95d388889c24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ test-mir-pass: GVN

// EMIT_MIR boolean_identities.test.GVN.diff
pub fn test(x: bool, y: bool) -> bool {
    // CHECK-LABEL: fn test(
    // CHECK: debug a => [[a:_.*]];
    // CHECK: debug b => [[b:_.*]];
    // CHECK: [[a]] = const true;
    // CHECK: [[b]] = const false;
    // CHECK: _0 = const false;
    let a = (y | true);
    let b = (x & false);
    a & b
}

fn main() {
    test(true, false);
}