create cvtsx2_help

This commit is contained in:
satotake 2021-12-05 15:40:00 +00:00 committed by GitHub
parent f7f36fb3c3
commit 5003223465
2 changed files with 68 additions and 9 deletions

View file

@ -1308,6 +1308,45 @@ fn num_to_float() {
assert_evals_to!("Num.toFloat 9", 9.0, f64);
}
#[test]
#[cfg(any(feature = "gen-dev"))]
fn num_to_float_f64_to_f32() {
assert_evals_to!(
indoc!(
r#"
f64 : F64
f64 = 9.0
f32 : F32
f32 = Num.toFloat f64
f32
"#
),
9.0,
f32
);
}
// #[test]
// #[cfg(any(feature = "gen-dev"))]
// fn num_to_float_f32_to_f64() {
// assert_evals_to!(
// indoc!(
// r#"
// f32 : F32
// f32 = 9.0
// f64 : F64
// f64 = Num.toFloat f32
// f64
// "#
// ),
// 9.0,
// f64
// );
// }
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn float_to_float() {