rust/tests/mir-opt/const_prop/boolean_identities.rs

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

19 lines
406 B
Rust
Raw Normal View History

2023-09-20 16:43:33 -05:00
//@ unit-test: GVN
2023-09-20 16:43:33 -05:00
// EMIT_MIR boolean_identities.test.GVN.diff
pub fn test(x: bool, y: bool) -> bool {
2023-12-02 14:18:14 -06:00
// CHECK-LABEL: fn test(
// CHECK: debug a => [[a:_.*]];
// CHECK: debug b => [[b:_.*]];
2023-03-20 16:37:36 -05:00
// CHECK: [[a]] = const true;
// CHECK: [[b]] = const false;
// CHECK: _0 = const false;
2023-12-02 14:18:14 -06:00
let a = (y | true);
let b = (x & false);
a & b
}
fn main() {
test(true, false);
}