mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
commit
5e8faf64be
5 changed files with 282 additions and 28 deletions
|
@ -1114,18 +1114,35 @@ fn gen_mul_dec() {
|
|||
i128
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn gen_mul_i64() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
2 * 4 * 6
|
||||
"#
|
||||
),
|
||||
48,
|
||||
i64
|
||||
);
|
||||
fn gen_signed_mul_quadword_and_lower() {
|
||||
assert_evals_to!("2i64 * 4 * 6", 48, i64);
|
||||
assert_evals_to!("2i32 * 4 * 6", 48, i32);
|
||||
assert_evals_to!("2i16 * 4 * 6", 48, i16);
|
||||
assert_evals_to!("2i8 * 4 * 6", 48, i8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn gen_unsigned_mul_quadword_and_lower() {
|
||||
assert_evals_to!("2u64 * 4 * 6", 48, u64);
|
||||
assert_evals_to!("2u32 * 4 * 6", 48, u32);
|
||||
assert_evals_to!("2u16 * 4 * 6", 48, u16);
|
||||
assert_evals_to!("2u8 * 4 * 6", 48, u8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn gen_mul_f64() {
|
||||
assert_evals_to!("2f64 * 4 * 6", 48.0, f64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn gen_mul_f32() {
|
||||
assert_evals_to!("2f32 * 4 * 6", 48.0, f32);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue