diff --git a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs index fabf625c18..95659e66b6 100644 --- a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs +++ b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs @@ -1162,22 +1162,18 @@ pub(crate) fn run_low_level<'a, 'ctx>( env.builder .build_int_s_extend(arg.into_int_value(), to, "inc_cast") } - //U16 -> X32 (false, _, true) => { env.builder .build_int_z_extend(arg.into_int_value(), to, "inc_cast") }, - //I16 -> U32 - (true,false,true) + (true,false,true) //Any case where it is not an extension, also perhaps warn here? - | (_, _, false) => { + | (_, _, false) => { Ok(env.builder .new_build_int_cast_sign_flag(arg.into_int_value(), to, to_signed, "inc_cast")) - } - }; let Ok(value) = result else { todo!() }; diff --git a/crates/compiler/test_gen/src/gen_num.rs b/crates/compiler/test_gen/src/gen_num.rs index c33ecc62df..9239166707 100644 --- a/crates/compiler/test_gen/src/gen_num.rs +++ b/crates/compiler/test_gen/src/gen_num.rs @@ -3999,13 +3999,12 @@ fn infinity_f32() { fn infinity_f64() { assert_evals_to!(r"Num.infinityF64", f64::INFINITY, f64); } - +#[allow(clippy::non_minimal_cfg)] #[test] -#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))] +#[cfg(any(feature = "gen-llvm"))] fn cast_signed_unsigned() { - assert_evals_to!(r"Num.toI16 255u8",255,i16); - assert_evals_to!(r"Num.toU16 127i8",127,u16); - assert_evals_to!(r"Num.toU8 127i8",127,u8); - assert_evals_to!(r"Num.toI8 127u8",127,i8); + assert_evals_to!(r"Num.toI16 255u8", 255, i16); + assert_evals_to!(r"Num.toU16 127i8", 127, u16); + assert_evals_to!(r"Num.toU8 127i8", 127, u8); + assert_evals_to!(r"Num.toI8 127u8", 127, i8); } -