Skip to content

Commit

Permalink
add uni test
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jun 2, 2020
1 parent 63ea7b0 commit 4a0edcb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unittests/validation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ TEST(validation, memory_size_no_memory)
parse(wasm), validation_error, "memory instructions require imported or defined memory");
}

TEST(validation, load_store_invalid_alignment)
{
// TODO: add odd alignment
/* wat2wasm --no-check
(memory 1)
(func (param i32)
get_local 0
i32.const 0
i32.store align=8
)
*/
const auto wasm =
from_hex("0061736d0100000001050160017f000302010005030100010a0b010900200041003603000b");
EXPECT_THROW_MESSAGE(parse(wasm), validation_error, "alignment cannot exceed operand size");
}

TEST(validation, br_invalid_label_index)
{
/* wat2wasm --no-check
Expand Down

0 comments on commit 4a0edcb

Please sign in to comment.