mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
a proper fix for llvm wasm checked arithmetic
This commit is contained in:
parent
fd7a7ba1e6
commit
e850f94d05
4 changed files with 95 additions and 22 deletions
|
@ -3995,6 +3995,23 @@ fn mul_checked_u128() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn add_checked_u128() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
x : Result U128 [ Overflow ]
|
||||
x = Num.addChecked 5u128 2u128
|
||||
|
||||
x
|
||||
"#
|
||||
),
|
||||
RocResult::ok(5u128 + 2u128),
|
||||
RocResult<u128, ()>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn num_min() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue