2023-09-20 16:43:33 -05:00
|
|
|
//@ unit-test: GVN
|
2020-07-18 17:43:51 -05:00
|
|
|
|
2023-09-20 16:43:33 -05:00
|
|
|
// EMIT_MIR boolean_identities.test.GVN.diff
|
2020-07-18 17:43:51 -05:00
|
|
|
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
|
2020-07-18 17:43:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test(true, false);
|
|
|
|
}
|