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 Permalink Normal View History

//@ test-mir-pass: 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);
}