os-rust/tests/mir-opt/dataflow-const-prop/boolean_identities.rs

19 lines
387 B
Rust
Raw Normal View History

//@ unit-test: DataflowConstProp
2023-04-15 17:00:43 +00:00
// EMIT_MIR boolean_identities.test.DataflowConstProp.diff
// CHECK-LABEL: fn test(
2023-04-15 17:00:43 +00:00
pub fn test(x: bool, y: bool) -> bool {
2024-01-11 23:22:33 -08:00
// CHECK-NOT: BitAnd(
// CHECK-NOT: BitOr(
2023-04-15 17:00:43 +00:00
(y | true) & (x & false)
// CHECK: _0 = const false;
2024-01-11 23:22:33 -08:00
// CHECK-NOT: BitAnd(
// CHECK-NOT: BitOr(
2023-04-15 17:00:43 +00:00
}
// CHECK-LABEL: fn main(
2023-04-15 17:00:43 +00:00
fn main() {
test(true, false);
}