2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2023-01-18 18:00:00 -06:00
|
|
|
// compile-flags: --crate-type=lib
|
|
|
|
#![feature(custom_mir, core_intrinsics, inline_const)]
|
|
|
|
use std::intrinsics::mir::*;
|
|
|
|
|
|
|
|
// EMIT_MIR operators.f.built.after.mir
|
|
|
|
#[custom_mir(dialect = "built")]
|
|
|
|
pub fn f(a: i32, b: bool) -> i32 {
|
|
|
|
mir!({
|
|
|
|
a = -a;
|
|
|
|
b = !b;
|
|
|
|
a = a + a;
|
|
|
|
a = a - a;
|
|
|
|
a = a * a;
|
|
|
|
a = a / a;
|
|
|
|
a = a % a;
|
|
|
|
a = a ^ a;
|
|
|
|
a = a & a;
|
|
|
|
a = a << a;
|
|
|
|
a = a >> a;
|
|
|
|
b = a == a;
|
|
|
|
b = a < a;
|
|
|
|
b = a <= a;
|
|
|
|
b = a >= a;
|
|
|
|
b = a > a;
|
2023-01-26 05:29:28 -06:00
|
|
|
let res = Checked(a + a);
|
|
|
|
b = res.1;
|
|
|
|
a = res.0;
|
2023-01-18 18:00:00 -06:00
|
|
|
RET = a;
|
|
|
|
Return()
|
|
|
|
})
|
|
|
|
}
|