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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
391 B
Rust
Raw Normal View History

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