diff --git a/test/unittests/validation_test.cpp b/test/unittests/validation_test.cpp index 1da2232ab2..93505f56ea 100644 --- a/test/unittests/validation_test.cpp +++ b/test/unittests/validation_test.cpp @@ -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