mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixed int128 div/mod. Fix WASM memory init priority.
This commit is contained in:
21
test/unit/regression/int128.c3
Normal file
21
test/unit/regression/int128.c3
Normal file
@@ -0,0 +1,21 @@
|
||||
module int128_test;
|
||||
|
||||
fn void check(uint128 a, uint128 b)
|
||||
{
|
||||
uint128 div = a / b;
|
||||
uint128 mod = a % b;
|
||||
assert(div * b + mod == a);
|
||||
}
|
||||
|
||||
fn void test_big() @test
|
||||
{
|
||||
uint128 a = 12345678901234567890012u128;
|
||||
uint128 b = 1234567890123456789001u128;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
check(a + i, b + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user