mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
19 lines
387 B
Rust
19 lines
387 B
Rust
//@ unit-test: 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);
|
|
}
|