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

// EMIT_MIR boolean_identities.test.DataflowConstProp.diff

// CHECK-LABEL: fn test(
pub fn test(x: bool, y: bool) -> bool {
    // CHECK-NOT: BitAnd(
    // CHECK-NOT: BitOr(
    (y | true) & (x & false)
    // CHECK: _0 = const false;
    // CHECK-NOT: BitAnd(
    // CHECK-NOT: BitOr(
}

// CHECK-LABEL: fn main(
fn main() {
    test(true, false);
}