a proper fix for llvm wasm checked arithmetic

This commit is contained in:
Folkert 2023-09-15 14:53:00 +02:00
parent fd7a7ba1e6
commit e850f94d05
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 95 additions and 22 deletions

View file

@ -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() {