Made test pass

This commit is contained in:
Asher Frost 2024-12-01 16:03:40 -05:00
parent 7055253564
commit c2d06e3658
No known key found for this signature in database
GPG key ID: 4C8BA25CB3670AF4
2 changed files with 8 additions and 13 deletions

View file

@ -1162,22 +1162,18 @@ pub(crate) fn run_low_level<'a, 'ctx>(
env.builder env.builder
.build_int_s_extend(arg.into_int_value(), to, "inc_cast") .build_int_s_extend(arg.into_int_value(), to, "inc_cast")
} }
//U16 -> X32 //U16 -> X32
(false, _, true) => { (false, _, true) => {
env.builder env.builder
.build_int_z_extend(arg.into_int_value(), to, "inc_cast") .build_int_z_extend(arg.into_int_value(), to, "inc_cast")
}, },
//I16 -> U32 //I16 -> U32
(true,false,true) (true,false,true)
//Any case where it is not an extension, also perhaps warn here? //Any case where it is not an extension, also perhaps warn here?
| (_, _, false) => { | (_, _, false) => {
Ok(env.builder Ok(env.builder
.new_build_int_cast_sign_flag(arg.into_int_value(), to, to_signed, "inc_cast")) .new_build_int_cast_sign_flag(arg.into_int_value(), to, to_signed, "inc_cast"))
} }
}; };
let Ok(value) = result else { todo!() }; let Ok(value) = result else { todo!() };

View file

@ -3999,13 +3999,12 @@ fn infinity_f32() {
fn infinity_f64() { fn infinity_f64() {
assert_evals_to!(r"Num.infinityF64", f64::INFINITY, f64); assert_evals_to!(r"Num.infinityF64", f64::INFINITY, f64);
} }
#[allow(clippy::non_minimal_cfg)]
#[test] #[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))] #[cfg(any(feature = "gen-llvm"))]
fn cast_signed_unsigned() { fn cast_signed_unsigned() {
assert_evals_to!(r"Num.toI16 255u8",255,i16); assert_evals_to!(r"Num.toI16 255u8", 255, i16);
assert_evals_to!(r"Num.toU16 127i8",127,u16); assert_evals_to!(r"Num.toU16 127i8", 127, u16);
assert_evals_to!(r"Num.toU8 127i8",127,u8); assert_evals_to!(r"Num.toU8 127i8", 127, u8);
assert_evals_to!(r"Num.toI8 127u8",127,i8); assert_evals_to!(r"Num.toI8 127u8", 127, i8);
} }