2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: DataflowConstProp
|
2023-04-15 12:00:43 -05:00
|
|
|
|
|
|
|
// EMIT_MIR boolean_identities.test.DataflowConstProp.diff
|
2024-01-07 23:16:22 -06:00
|
|
|
|
|
|
|
// 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)
|
2024-01-07 23:16:22 -06:00
|
|
|
// 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
|
|
|
}
|
|
|
|
|
2024-01-07 23:16:22 -06:00
|
|
|
// CHECK-LABEL: fn main(
|
2023-04-15 12:00:43 -05:00
|
|
|
fn main() {
|
|
|
|
test(true, false);
|
|
|
|
}
|