add x86_64 Int Num.neg support for gen_dev

This commit is contained in:
satotake 2021-11-16 15:21:44 +00:00 committed by GitHub
parent b03ed18553
commit 71bef85984
5 changed files with 59 additions and 1 deletions

View file

@ -1214,7 +1214,18 @@ fn tail_call_elimination() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-dev"))]
fn int_negate_dev() {
// Dev backend yet to have `Num.maxInt` or `Num.minInt`.
// TODO Remove this test and add "gen-dev" feature the below
// after implementing the both.
assert_evals_to!("Num.neg 123", -123, i64);
assert_evals_to!("Num.neg -123", 123, i64);
assert_evals_to!("Num.neg 0", 0, i64);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn int_negate() {
assert_evals_to!("Num.neg 123", -123, i64);
assert_evals_to!("Num.neg Num.maxInt", -i64::MAX, i64);