mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-16 16:55:00 +00:00
Merge pull request #3870 from roc-lang/dev-backend-div
add int/float division to the dev backend
This commit is contained in:
commit
51d5aa789a
10 changed files with 384 additions and 40 deletions
|
@ -735,17 +735,15 @@ fn gen_wrap_add_nums() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn gen_div_f64() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
48 / 2
|
||||
"#
|
||||
),
|
||||
24.0,
|
||||
f64
|
||||
);
|
||||
assert_evals_to!("48 / 2", 24.0, f64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn gen_div_f32() {
|
||||
assert_evals_to!("48f32 / 2", 24.0, f32);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -1146,17 +1144,15 @@ fn gen_mul_f32() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn gen_div_i64() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
1000 // 10
|
||||
"#
|
||||
),
|
||||
100,
|
||||
i64
|
||||
);
|
||||
assert_evals_to!("1000i64 // 10", 100, i64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn gen_div_u64() {
|
||||
assert_evals_to!("1000u64 // 10", 100, u64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue