Code review
Added a test, simplified another and added a lot of TODO's.
This commit is contained in:
parent
521171540b
commit
5d9ef0e276
17
TODO.md
17
TODO.md
@ -10,3 +10,20 @@
|
||||
- Storing u8 in memory still claims 32 bits (since that's what you need in local variables). However, using load8_u / loadu_s we can optimize this.
|
||||
- Implement a FizzBuzz example
|
||||
- Also, check the codes for FIXME and TODO
|
||||
- Allocation is done using pointers for members, is this desired?
|
||||
|
||||
- Merge in type classes
|
||||
|
||||
- test_bitwise_or_inv_type
|
||||
- test_bytes_index_out_of_bounds vs static trap(?)
|
||||
- test_num.py is probably best as part of the generator?
|
||||
- Find pytest.mark.skip
|
||||
- There's a weird resolve_as reference in calculate_alloc_size
|
||||
- Either there should be more of them or less
|
||||
- At first glance, looks like failure in the typing system
|
||||
- Related to the FIXME in phasm_type3?
|
||||
- WEBASSEMBLY_BUILTIN_FLOAT_OPS and WEBASSEMBLY_BUILTIN_BYTES_OPS are special cased
|
||||
- Should be part of a prelude
|
||||
- Casting is not implemented except u32 which is special cased
|
||||
- Parser is putting stuff in ModuleDataBlock
|
||||
- Compiler should probably do that
|
||||
|
||||
@ -20,7 +20,7 @@ def testEntry() -> {type_}:
|
||||
|
||||
@pytest.mark.integration_test
|
||||
@pytest.mark.parametrize('type_', TYPE_LIST)
|
||||
def test_division_zero_let_it_crash_float(type_):
|
||||
def test_division_float_follow_ieee_so_inf_pos(type_):
|
||||
code_py = f"""
|
||||
@exported
|
||||
def testEntry() -> {type_}:
|
||||
@ -31,3 +31,17 @@ def testEntry() -> {type_}:
|
||||
# https://www.w3.org/TR/wasm-core-1/#-hrefop-fdivmathrmfdiv_n-z_1-z_2
|
||||
result = Suite(code_py).run_code()
|
||||
assert float('+inf') == result.returned_value
|
||||
|
||||
@pytest.mark.integration_test
|
||||
@pytest.mark.parametrize('type_', TYPE_LIST)
|
||||
def test_division_float_follow_ieee_so_inf_neg(type_):
|
||||
code_py = f"""
|
||||
@exported
|
||||
def testEntry() -> {type_}:
|
||||
return -10.0 / 0.0
|
||||
"""
|
||||
|
||||
# WebAssembly dictates that float division follows the IEEE rules
|
||||
# https://www.w3.org/TR/wasm-core-1/#-hrefop-fdivmathrmfdiv_n-z_1-z_2
|
||||
result = Suite(code_py).run_code()
|
||||
assert float('-inf') == result.returned_value
|
||||
|
||||
@ -74,11 +74,9 @@ CONSTANT: (u32, u8, u8, ) = (24, 4000, 1, )
|
||||
@pytest.mark.integration_test
|
||||
def test_tuple_must_use_literal_for_indexing():
|
||||
code_py = """
|
||||
CONSTANT: u32 = 0
|
||||
|
||||
@exported
|
||||
def testEntry(x: (u8, u32, u64)) -> u64:
|
||||
return x[CONSTANT]
|
||||
def testEntry(x: (u8, u32, u64), y: u8) -> u64:
|
||||
return x[y]
|
||||
"""
|
||||
|
||||
with pytest.raises(Type3Exception, match='Must index with literal'):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user