From 20115611402ba8f9fb0c01c853ecb565b6f814d7 Mon Sep 17 00:00:00 2001 From: "Ben L. Titzer" Date: Sat, 25 Jul 2026 22:29:36 -0400 Subject: [PATCH] Externalize the binary encoding unit tests as .bin.wast The bin: unit tests decode hundreds of hand-built binary modules and assert whether each is accepted, but those expectations were only ever checked against Wizard itself. BinParserTester now records every module a test decodes, along with the result the test expects, into test/regress/binary/.bin.wast, so the corpus can be run through the reference interpreter or any other engine; recording is off unless --record-binary is passed. The externalized assertion records the phase the specification should reject a module in, and fill-messages.sh substitutes the message the reference interpreter itself reports wherever the two agree. Of 762 trials, 64 of 79 files agree with the reference outright and 18 trials do not; check.sh attributes them per trial, and test/regress/binary/disagree holds hand-written text sources, encoded by the reference interpreter rather than by Wizard, confirming the two that are real: readElemDecl never type checks a flags=0 element segment against its table, and for flags=4 it derives the expected type from the table itself, so the check can never fail. Three unit tests assert those modules are valid, so their expectations are wrong; not fixed here. The corpus also runs under regress.sh, where seven files are expected failures because they were recorded without the extensions that a regress run enables by default. Co-Authored-By: Claude Opus 5 (1M context) --- test/regress.failures | 7 + test/regress.sh | 2 +- test/regress/binary/bin_bad_sub0.bin.wast | 29 + test/regress/binary/bin_bad_sub1.bin.wast | 29 + test/regress/binary/bin_bad_sub2.bin.wast | 29 + test/regress/binary/bin_bad_sub3.bin.wast | 29 + test/regress/binary/bin_buf_offset.bin.wast | 7 + test/regress/binary/bin_code0.bin.wast | 32 + test/regress/binary/bin_code1.bin.wast | 47 + test/regress/binary/bin_code2.bin.wast | 56 + test/regress/binary/bin_code_missing.bin.wast | 11 + test/regress/binary/bin_count_limits.bin.wast | 149 ++ test/regress/binary/bin_data0.bin.wast | 60 + test/regress/binary/bin_dataN.bin.wast | 294 +++ test/regress/binary/bin_data_count.bin.wast | 40 + test/regress/binary/bin_elements0.bin.wast | 59 + test/regress/binary/bin_elements1.bin.wast | 26 + test/regress/binary/bin_elements2.bin.wast | 23 + test/regress/binary/bin_elements3.bin.wast | 21 + test/regress/binary/bin_elements4.bin.wast | 21 + test/regress/binary/bin_elementsN.bin.wast | 327 +++ test/regress/binary/bin_empty.bin.wast | 65 + test/regress/binary/bin_exports0.bin.wast | 117 + test/regress/binary/bin_exportsN.bin.wast | 179 ++ .../binary/bin_func_max_params.bin.wast | 139 ++ .../binary/bin_func_max_results.bin.wast | 139 ++ .../binary/bin_func_ref_types0.bin.wast | 26 + .../binary/bin_func_ref_types1.bin.wast | 11 + test/regress/binary/bin_funcs0.bin.wast | 59 + test/regress/binary/bin_funcs1.bin.wast | 43 + test/regress/binary/bin_funcs2.bin.wast | 49 + test/regress/binary/bin_funcsN.bin.wast | 99 + test/regress/binary/bin_globals0.bin.wast | 86 + test/regress/binary/bin_globals1.bin.wast | 44 + test/regress/binary/bin_globals2.bin.wast | 29 + test/regress/binary/bin_globalsN.bin.wast | 196 ++ test/regress/binary/bin_hdr_split.bin.wast | 7 + test/regress/binary/bin_imports0.bin.wast | 35 + test/regress/binary/bin_imports1.bin.wast | 39 + test/regress/binary/bin_imports2.bin.wast | 11 + test/regress/binary/bin_imports3.bin.wast | 20 + test/regress/binary/bin_importsN.bin.wast | 252 +++ test/regress/binary/bin_invalid.bin.wast | 1938 +++++++++++++++++ test/regress/binary/bin_magic.bin.wast | 34 + .../binary/bin_max_num_memories.bin.wast | 68 + .../binary/bin_max_num_tables.bin.wast | 69 + test/regress/binary/bin_memoriesN.bin.wast | 52 + test/regress/binary/bin_memory0.bin.wast | 35 + .../regress/binary/bin_memory_limits.bin.wast | 28 + test/regress/binary/bin_recgrp0.bin.wast | 11 + test/regress/binary/bin_recgrp1.bin.wast | 11 + test/regress/binary/bin_recgrp2.bin.wast | 11 + test/regress/binary/bin_recgrp3.bin.wast | 11 + .../regress/binary/bin_repeat_funcs1.bin.wast | 36 + .../regress/binary/bin_repeat_funcs2.bin.wast | 9 + .../binary/bin_repeat_imports1.bin.wast | 35 + .../binary/bin_repeat_imports2.bin.wast | 3 + .../regress/binary/bin_repeat_types1.bin.wast | 32 + .../regress/binary/bin_repeat_types2.bin.wast | 5 + test/regress/binary/bin_sect_custom1.bin.wast | 32 + test/regress/binary/bin_sect_custom2.bin.wast | 10 + .../binary/bin_sect_custom_ovf.bin.wast | 92 + test/regress/binary/bin_sect_dup.bin.wast | 132 ++ test/regress/binary/bin_sect_empty.bin.wast | 52 + test/regress/binary/bin_sect_empty_s.bin.wast | 52 + test/regress/binary/bin_sect_eof.bin.wast | 74 + test/regress/binary/bin_sect_size0.bin.wast | 82 + .../binary/bin_sect_underflow.bin.wast | 82 + test/regress/binary/bin_start0.bin.wast | 42 + test/regress/binary/bin_start1.bin.wast | 42 + test/regress/binary/bin_start2.bin.wast | 20 + test/regress/binary/bin_sub0.bin.wast | 11 + test/regress/binary/bin_sub1.bin.wast | 11 + test/regress/binary/bin_sub2.bin.wast | 11 + test/regress/binary/bin_table_limits.bin.wast | 28 + test/regress/binary/bin_tables0.bin.wast | 38 + test/regress/binary/bin_tablesN.bin.wast | 60 + test/regress/binary/bin_types0.bin.wast | 30 + test/regress/binary/bin_types1.bin.wast | 74 + test/regress/binary/bin_typesN.bin.wast | 196 ++ test/regress/binary/bin_version.bin.wast | 34 + test/regress/binary/check.sh | 90 + test/regress/binary/disagree/README.md | 39 + .../binary/disagree/elem_type_flags0.wast | 8 + .../binary/disagree/elem_type_flags4.wast | 6 + test/regress/binary/disagree/ok.wast | 8 + test/regress/binary/fill-messages.sh | 101 + test/regress/binary/record.sh | 24 + test/unittest.main.v3 | 16 +- test/unittest/BinParserTest.v3 | 35 +- test/unittest/BinRecorder.v3 | 183 ++ 91 files changed, 7033 insertions(+), 13 deletions(-) create mode 100644 test/regress/binary/bin_bad_sub0.bin.wast create mode 100644 test/regress/binary/bin_bad_sub1.bin.wast create mode 100644 test/regress/binary/bin_bad_sub2.bin.wast create mode 100644 test/regress/binary/bin_bad_sub3.bin.wast create mode 100644 test/regress/binary/bin_buf_offset.bin.wast create mode 100644 test/regress/binary/bin_code0.bin.wast create mode 100644 test/regress/binary/bin_code1.bin.wast create mode 100644 test/regress/binary/bin_code2.bin.wast create mode 100644 test/regress/binary/bin_code_missing.bin.wast create mode 100644 test/regress/binary/bin_count_limits.bin.wast create mode 100644 test/regress/binary/bin_data0.bin.wast create mode 100644 test/regress/binary/bin_dataN.bin.wast create mode 100644 test/regress/binary/bin_data_count.bin.wast create mode 100644 test/regress/binary/bin_elements0.bin.wast create mode 100644 test/regress/binary/bin_elements1.bin.wast create mode 100644 test/regress/binary/bin_elements2.bin.wast create mode 100644 test/regress/binary/bin_elements3.bin.wast create mode 100644 test/regress/binary/bin_elements4.bin.wast create mode 100644 test/regress/binary/bin_elementsN.bin.wast create mode 100644 test/regress/binary/bin_empty.bin.wast create mode 100644 test/regress/binary/bin_exports0.bin.wast create mode 100644 test/regress/binary/bin_exportsN.bin.wast create mode 100644 test/regress/binary/bin_func_max_params.bin.wast create mode 100644 test/regress/binary/bin_func_max_results.bin.wast create mode 100644 test/regress/binary/bin_func_ref_types0.bin.wast create mode 100644 test/regress/binary/bin_func_ref_types1.bin.wast create mode 100644 test/regress/binary/bin_funcs0.bin.wast create mode 100644 test/regress/binary/bin_funcs1.bin.wast create mode 100644 test/regress/binary/bin_funcs2.bin.wast create mode 100644 test/regress/binary/bin_funcsN.bin.wast create mode 100644 test/regress/binary/bin_globals0.bin.wast create mode 100644 test/regress/binary/bin_globals1.bin.wast create mode 100644 test/regress/binary/bin_globals2.bin.wast create mode 100644 test/regress/binary/bin_globalsN.bin.wast create mode 100644 test/regress/binary/bin_hdr_split.bin.wast create mode 100644 test/regress/binary/bin_imports0.bin.wast create mode 100644 test/regress/binary/bin_imports1.bin.wast create mode 100644 test/regress/binary/bin_imports2.bin.wast create mode 100644 test/regress/binary/bin_imports3.bin.wast create mode 100644 test/regress/binary/bin_importsN.bin.wast create mode 100644 test/regress/binary/bin_invalid.bin.wast create mode 100644 test/regress/binary/bin_magic.bin.wast create mode 100644 test/regress/binary/bin_max_num_memories.bin.wast create mode 100644 test/regress/binary/bin_max_num_tables.bin.wast create mode 100644 test/regress/binary/bin_memoriesN.bin.wast create mode 100644 test/regress/binary/bin_memory0.bin.wast create mode 100644 test/regress/binary/bin_memory_limits.bin.wast create mode 100644 test/regress/binary/bin_recgrp0.bin.wast create mode 100644 test/regress/binary/bin_recgrp1.bin.wast create mode 100644 test/regress/binary/bin_recgrp2.bin.wast create mode 100644 test/regress/binary/bin_recgrp3.bin.wast create mode 100644 test/regress/binary/bin_repeat_funcs1.bin.wast create mode 100644 test/regress/binary/bin_repeat_funcs2.bin.wast create mode 100644 test/regress/binary/bin_repeat_imports1.bin.wast create mode 100644 test/regress/binary/bin_repeat_imports2.bin.wast create mode 100644 test/regress/binary/bin_repeat_types1.bin.wast create mode 100644 test/regress/binary/bin_repeat_types2.bin.wast create mode 100644 test/regress/binary/bin_sect_custom1.bin.wast create mode 100644 test/regress/binary/bin_sect_custom2.bin.wast create mode 100644 test/regress/binary/bin_sect_custom_ovf.bin.wast create mode 100644 test/regress/binary/bin_sect_dup.bin.wast create mode 100644 test/regress/binary/bin_sect_empty.bin.wast create mode 100644 test/regress/binary/bin_sect_empty_s.bin.wast create mode 100644 test/regress/binary/bin_sect_eof.bin.wast create mode 100644 test/regress/binary/bin_sect_size0.bin.wast create mode 100644 test/regress/binary/bin_sect_underflow.bin.wast create mode 100644 test/regress/binary/bin_start0.bin.wast create mode 100644 test/regress/binary/bin_start1.bin.wast create mode 100644 test/regress/binary/bin_start2.bin.wast create mode 100644 test/regress/binary/bin_sub0.bin.wast create mode 100644 test/regress/binary/bin_sub1.bin.wast create mode 100644 test/regress/binary/bin_sub2.bin.wast create mode 100644 test/regress/binary/bin_table_limits.bin.wast create mode 100644 test/regress/binary/bin_tables0.bin.wast create mode 100644 test/regress/binary/bin_tablesN.bin.wast create mode 100644 test/regress/binary/bin_types0.bin.wast create mode 100644 test/regress/binary/bin_types1.bin.wast create mode 100644 test/regress/binary/bin_typesN.bin.wast create mode 100644 test/regress/binary/bin_version.bin.wast create mode 100755 test/regress/binary/check.sh create mode 100644 test/regress/binary/disagree/README.md create mode 100644 test/regress/binary/disagree/elem_type_flags0.wast create mode 100644 test/regress/binary/disagree/elem_type_flags4.wast create mode 100644 test/regress/binary/disagree/ok.wast create mode 100755 test/regress/binary/fill-messages.sh create mode 100755 test/regress/binary/record.sh create mode 100644 test/unittest/BinRecorder.v3 diff --git a/test/regress.failures b/test/regress.failures index 23a00fec0..b0e5cd9e5 100644 --- a/test/regress.failures +++ b/test/regress.failures @@ -1,2 +1,9 @@ test/regress/ext:threads/atomic_wait32_0.bin.wast test/regress/ext:threads/atomic_wait64_0.bin.wast +test/regress/binary/bin_func_ref_types0.bin.wast +test/regress/binary/bin_globals1.bin.wast +test/regress/binary/bin_globals2.bin.wast +test/regress/binary/bin_recgrp0.bin.wast +test/regress/binary/bin_recgrp1.bin.wast +test/regress/binary/bin_sub0.bin.wast +test/regress/binary/bin_sub2.bin.wast diff --git a/test/regress.sh b/test/regress.sh index 264468baf..3a106b873 100755 --- a/test/regress.sh +++ b/test/regress.sh @@ -20,7 +20,7 @@ TESTS="$@" function run_tests() { if [ "$TESTS" = "" ]; then - for dir in core gen fastcall; do + for dir in core gen fastcall binary; do TESTS=$(ls test/regress/$dir/*.bin.wast) FLAGS= if [ -e test/regress/$dir/flags ]; then diff --git a/test/regress/binary/bin_bad_sub0.bin.wast b/test/regress/binary/bin_bad_sub0.bin.wast new file mode 100644 index 000000000..6c4d89f75 --- /dev/null +++ b/test/regress/binary/bin_bad_sub0.bin.wast @@ -0,0 +1,29 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:bad_sub0[1]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8e\80\80\80\00\02\50" + "\00\60\00\01\7f\50\01\00\60\00\01\7e" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub0[2]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\50" + "\00\5f\00\50\01\00\60\00\01\7c" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub0[3]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8d\80\80\80\00\02\50" + "\00\5e\78\00\50\01\00\60\00\01\7d" + ) + "sub type 1 does not match super type 0" +) + diff --git a/test/regress/binary/bin_bad_sub1.bin.wast b/test/regress/binary/bin_bad_sub1.bin.wast new file mode 100644 index 000000000..bfef6f1b6 --- /dev/null +++ b/test/regress/binary/bin_bad_sub1.bin.wast @@ -0,0 +1,29 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:bad_sub1[1]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\50" + "\00\5f\01\78\00\50\01\00\5f\00" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub1[2]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\50" + "\00\60\00\01\7c\50\01\00\5f\00" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub1[3]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\50" + "\00\60\00\01\7d\50\01\00\5f\00" + ) + "sub type 1 does not match super type 0" +) + diff --git a/test/regress/binary/bin_bad_sub2.bin.wast b/test/regress/binary/bin_bad_sub2.bin.wast new file mode 100644 index 000000000..cffbfdefd --- /dev/null +++ b/test/regress/binary/bin_bad_sub2.bin.wast @@ -0,0 +1,29 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:bad_sub2[1]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\50" + "\00\5e\78\00\50\01\00\5e\77\00" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub2[2]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8b\80\80\80\00\02\50" + "\00\5f\00\50\01\00\5e\78\00" + ) + "sub type 1 does not match super type 0" +) + +;; unittest bin:bad_sub2[3]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8d\80\80\80\00\02\50" + "\00\60\00\01\7d\50\01\00\5e\78\00" + ) + "sub type 1 does not match super type 0" +) + diff --git a/test/regress/binary/bin_bad_sub3.bin.wast b/test/regress/binary/bin_bad_sub3.bin.wast new file mode 100644 index 000000000..d8694ed09 --- /dev/null +++ b/test/regress/binary/bin_bad_sub3.bin.wast @@ -0,0 +1,29 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:bad_sub3[1]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\88\80\80\80\00\02\5f" + "\00\50\01\00\5f\00" + ) + "sub type 1 has final super type 0" +) + +;; unittest bin:bad_sub3[2]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\02\5e" + "\78\00\50\01\00\5e\78\00" + ) + "sub type 1 has final super type 0" +) + +;; unittest bin:bad_sub3[3]: INVALID ILLEGAL_SUPERTYPE [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\02\60" + "\00\01\7f\50\01\00\60\00\01\7f" + ) + "sub type 1 has final super type 0" +) + diff --git a/test/regress/binary/bin_buf_offset.bin.wast b/test/regress/binary/bin_buf_offset.bin.wast new file mode 100644 index 000000000..adebc17f5 --- /dev/null +++ b/test/regress/binary/bin_buf_offset.bin.wast @@ -0,0 +1,7 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:buf_offset[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00" +) + diff --git a/test/regress/binary/bin_code0.bin.wast b/test/regress/binary/bin_code0.bin.wast new file mode 100644 index 000000000..bb57f5661 --- /dev/null +++ b/test/regress/binary/bin_code0.bin.wast @@ -0,0 +1,32 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:code0[1]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\81\80\80\80\00\00" + ) + "function and code section have inconsistent lengths" +) + +;; unittest bin:code0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\84\80\80\80\00\01\02\00\0b" +) + +;; unittest bin:code0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\85\80\80\80\00\01\03\00\01\0b" +) + +;; unittest bin:code0[4]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\83\80\80\80\00\02\00\00" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_code1.bin.wast b/test/regress/binary/bin_code1.bin.wast new file mode 100644 index 000000000..1382ff4bd --- /dev/null +++ b/test/regress/binary/bin_code1.bin.wast @@ -0,0 +1,47 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:code1[1]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\84" + "\80\80\80\00\03\00\00\00\0a\81\80\80\80\00\00" + ) + "function and code section have inconsistent lengths" +) + +;; unittest bin:code1[2]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\84" + "\80\80\80\00\03\00\00\00\0a\82\80\80\80\00\01\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:code1[3]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\84" + "\80\80\80\00\03\00\00\00\0a\83\80\80\80\00\02\00" + "\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:code1[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\84" + "\80\80\80\00\03\00\00\00\0a\8a\80\80\80\00\03\02" + "\00\0b\02\00\0b\02\00\0b" +) + +;; unittest bin:code1[5]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\84" + "\80\80\80\00\03\00\00\00\0a\85\80\80\80\00\04\00" + "\00\00\00" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_code2.bin.wast b/test/regress/binary/bin_code2.bin.wast new file mode 100644 index 000000000..645363d29 --- /dev/null +++ b/test/regress/binary/bin_code2.bin.wast @@ -0,0 +1,56 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:code2[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\84\80\80\80\00\01\02\00\0b" +) + +;; unittest bin:code2[2]: MALFORMED INCOMPLETE_FUNCTION_BODY [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\81\80\80\80\00\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:code2[3]: MALFORMED INCOMPLETE_FUNCTION_BODY [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\83\80\80\80\00\01\02\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:code2[4]: MALFORMED INCOMPLETE_FUNCTION_BODY [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\82\80\80\80\00\01\42" + ) + "length out of bounds" +) + +;; unittest bin:code2[5]: MALFORMED INCOMPLETE_FUNCTION_BODY [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\85\80\80\80\00\01\b0\97\d3" + "\03" + ) + "length out of bounds" +) + +;; unittest bin:code2[6]: MALFORMED INCOMPLETE_FUNCTION_BODY [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\85\80\80\80\00\01\b1\97\d3" + "\03" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_code_missing.bin.wast b/test/regress/binary/bin_code_missing.bin.wast new file mode 100644 index 000000000..891b1c590 --- /dev/null +++ b/test/regress/binary/bin_code_missing.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:code_missing[1]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00" + ) + "function and code section have inconsistent lengths" +) + diff --git a/test/regress/binary/bin_count_limits.bin.wast b/test/regress/binary/bin_count_limits.bin.wast new file mode 100644 index 000000000..9acfe2173 --- /dev/null +++ b/test/regress/binary/bin_count_limits.bin.wast @@ -0,0 +1,149 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:count_limits[1]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\83\80\80\80\00\bf\84" + "\3d" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[2]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\83\80\80\80\00\c0\84" + "\3d" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[3]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\83\80\80\80\00\bf\84" + "\3d" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[4]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\83\80\80\80\00\c0\84" + "\3d" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\83\80\80\80\00\9f\8d" + "\06" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\83\80\80\80\00\a0\8d" + "\06" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\83\80\80\80\00\9f\8d" + "\06" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[8]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\83\80\80\80\00\a0\8d" + "\06" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[9]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\83\80\80\80\00\bf\84" + "\3d" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[10]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\83\80\80\80\00\c0\84" + "\3d" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[11]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\83\80\80\80\00\9f\8d" + "\06" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[12]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\83\80\80\80\00\a0\8d" + "\06" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[13]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\83\80\80\80\00\9f\8d" + "\06" + ) + "length out of bounds" +) + +;; unittest bin:count_limits[14]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\83\80\80\80\00\a0\8d" + "\06" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:count_limits[15]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\81\80\80\80\00\00" +) + +;; unittest bin:count_limits[16]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\81\80\80\80\00\01" + ) + "unexpected end of section or function" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_data0.bin.wast b/test/regress/binary/bin_data0.bin.wast new file mode 100644 index 000000000..ed44b28f0 --- /dev/null +++ b/test/regress/binary/bin_data0.bin.wast @@ -0,0 +1,60 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:data0[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\0b\86\80\80\80\00\01\00" + "\41\00\0b\00" + ) + "unknown memory 0" +) + +;; unittest bin:data0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\86\80" + "\80\80\00\01\00\41\00\0b\00" +) + +;; unittest bin:data0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\88\80" + "\80\80\00\01\00\41\00\0b\02\63\58" +) + +;; unittest bin:data0[4]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\86\80" + "\80\80\00\01\00\42\00\0b\00" + ) + "type mismatch: instruction requires [i32] but stack has [i64]" +) + +;; unittest bin:data0[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\87\80" + "\80\80\00\01\00\41\00\0b\ec\3c" + ) + "length out of bounds" +) + +;; unittest bin:data0[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\8a\80" + "\80\80\00\01\00\41\00\0b\ff\ff\ff\ff\03" + ) + "length out of bounds" +) + +;; unittest bin:data0[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\8a\80" + "\80\80\00\01\00\41\00\0b\80\80\80\80\04" + ) + "length out of bounds" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_dataN.bin.wast b/test/regress/binary/bin_dataN.bin.wast new file mode 100644 index 000000000..317c188cc --- /dev/null +++ b/test/regress/binary/bin_dataN.bin.wast @@ -0,0 +1,294 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:dataN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\01\00" +) + +;; unittest bin:dataN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\09\01" + "\00\41\00\0b\03\61\62\63" +) + +;; unittest bin:dataN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\11\02" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" +) + +;; unittest bin:dataN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b\03\61\62\63" +) + +;; unittest bin:dataN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19" + ) + "length out of bounds" +) + +;; unittest bin:dataN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + ) + "length out of bounds" +) + +;; unittest bin:dataN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41" + ) + "length out of bounds" +) + +;; unittest bin:dataN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:dataN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:dataN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61" + ) + "length out of bounds" +) + +;; unittest bin:dataN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62" + ) + "length out of bounds" +) + +;; unittest bin:dataN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63" + ) + "length out of bounds" +) + +;; unittest bin:dataN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41" + ) + "length out of bounds" +) + +;; unittest bin:dataN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:dataN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:dataN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61" + ) + "length out of bounds" +) + +;; unittest bin:dataN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62" + ) + "length out of bounds" +) + +;; unittest bin:dataN[22]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + ) + "length out of bounds" +) + +;; unittest bin:dataN[23]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[24]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41" + ) + "length out of bounds" +) + +;; unittest bin:dataN[25]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:dataN[26]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:dataN[27]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:dataN[28]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b\03\61" + ) + "length out of bounds" +) + +;; unittest bin:dataN[29]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\19\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b\03\61\62" + ) + "unexpected end of section or function" +) + +;; unittest bin:dataN[30]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\02\00" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:dataN[31]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\0a\01" + "\00\41\00\0b\03\61\62\63\63" + ) + "section size mismatch" +) + +;; unittest bin:dataN[32]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\12\02" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:dataN[33]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\0b\1a\03" + "\00\41\00\0b\03\61\62\63\00\41\00\0b\03\61\62\63" + "\00\41\00\0b\03\61\62\63\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_data_count.bin.wast b/test/regress/binary/bin_data_count.bin.wast new file mode 100644 index 000000000..261522dfa --- /dev/null +++ b/test/regress/binary/bin_data_count.bin.wast @@ -0,0 +1,40 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:data_count[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0c\81\80\80\80\00\00" +) + +;; unittest bin:data_count[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0c\81\80\80\80\00\00\0b" + "\81\80\80\80\00\00" +) + +;; unittest bin:data_count[3]: MALFORMED DATA_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0c\81\80\80\80\00\01" + ) + "data count and data section have inconsistent lengths" +) + +;; unittest bin:data_count[4]: MALFORMED DATA_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0c\81\80\80\80\00\01\0b" + "\81\80\80\80\00\00" + ) + "data count and data section have inconsistent lengths" +) + +;; unittest bin:data_count[5]: MALFORMED DATA_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0c\81\80\80\80\00\01\0b" + "\91\80\80\80\00\02\00\41\00\0b\03\61\62\63\00\41" + "\00\0b\03\61\62\63" + ) + "data count and data section have inconsistent lengths" +) + diff --git a/test/regress/binary/bin_elements0.bin.wast b/test/regress/binary/bin_elements0.bin.wast new file mode 100644 index 000000000..9f68af96d --- /dev/null +++ b/test/regress/binary/bin_elements0.bin.wast @@ -0,0 +1,59 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elements0[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\09\86\80\80\80\00\01\00" + "\41\00\0b\00" + ) + "unknown table 0" +) + +;; unittest bin:elements0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\86" + "\80\80\80\00\01\00\41\00\0b\00" +) + +;; unittest bin:elements0[3]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\86" + "\80\80\80\00\01\00\42\00\0b\00" + ) + "type mismatch: instruction requires [i32] but stack has [i64]" +) + +;; unittest bin:elements0[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\87" + "\80\80\80\00\01\00\41\00\0b\01\00" + ) + "unknown function 0" +) + +;; unittest bin:elements0[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\00\09\87\80" + "\80\80\00\01\00\41\00\0b\01\00" +) + +;; unittest bin:elements0[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\00\09\89\80" + "\80\80\00\01\00\41\00\0b\03\00\00\00" +) + +;; unittest bin:elements0[7]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\00\09\87\80" + "\80\80\00\01\00\41\00\0b\01\01" + ) + "unknown function 1" +) + diff --git a/test/regress/binary/bin_elements1.bin.wast b/test/regress/binary/bin_elements1.bin.wast new file mode 100644 index 000000000..a75718931 --- /dev/null +++ b/test/regress/binary/bin_elements1.bin.wast @@ -0,0 +1,26 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elements1[1]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\6f\00\00\09\86" + "\80\80\80\00\01\00\41\00\0b\00" + ) + "type mismatch: element segment's type (ref func) does not match table's element type (ref null extern)" +) + +;; unittest bin:elements1[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\6f\00\00\09\86" + "\80\80\80\00\01\04\41\00\0b\00" +) + +;; unittest bin:elements1[3]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\6f\00\00\09\89" + "\80\80\80\00\01\04\41\00\0b\01\41\00\0b" + ) + "type mismatch: instruction requires [(ref null func)] but stack has [i32]" +) + diff --git a/test/regress/binary/bin_elements2.bin.wast b/test/regress/binary/bin_elements2.bin.wast new file mode 100644 index 000000000..adc8e1b2c --- /dev/null +++ b/test/regress/binary/bin_elements2.bin.wast @@ -0,0 +1,23 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elements2[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\86" + "\80\80\80\00\01\00\41\00\0b\00" +) + +;; unittest bin:elements2[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\86" + "\80\80\80\00\01\04\41\00\0b\00" +) + +;; unittest bin:elements2[3]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\09\89" + "\80\80\80\00\01\04\41\00\0b\01\41\00\0b" + ) + "type mismatch: instruction requires [(ref null func)] but stack has [i32]" +) + diff --git a/test/regress/binary/bin_elements3.bin.wast b/test/regress/binary/bin_elements3.bin.wast new file mode 100644 index 000000000..03e4892b4 --- /dev/null +++ b/test/regress/binary/bin_elements3.bin.wast @@ -0,0 +1,21 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elements3[1]: VALID [function-references] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\08\02\60\00\00\60\01" + "\7f\00\02\0d\02\01\4d\01\66\00\00\01\4d\01\66\00" + "\01\04\05\01\63\00\00\00\09\87\80\80\80\00\01\00" + "\41\00\0b\01\00" +) + +;; unittest bin:elements3[2]: INVALID TYPE_MISMATCH [function-references] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\08\02\60\00\00\60\01" + "\7f\00\02\0d\02\01\4d\01\66\00\00\01\4d\01\66\00" + "\01\04\05\01\63\00\00\00\09\87\80\80\80\00\01\00" + "\41\00\0b\01\01" + ) + "type mismatch: element segment's type (ref func) does not match table's element type (ref null 0)" +) + diff --git a/test/regress/binary/bin_elements4.bin.wast b/test/regress/binary/bin_elements4.bin.wast new file mode 100644 index 000000000..c4b887b9d --- /dev/null +++ b/test/regress/binary/bin_elements4.bin.wast @@ -0,0 +1,21 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elements4[1]: VALID [function-references] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\08\02\60\00\00\60\01" + "\7f\00\02\0d\02\01\4d\01\66\00\00\01\4d\01\66\00" + "\01\04\05\01\63\00\00\00\09\87\80\80\80\00\01\00" + "\41\00\0b\01\00" +) + +;; unittest bin:elements4[2]: INVALID TYPE_MISMATCH [function-references] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\08\02\60\00\00\60\01" + "\7f\00\02\0d\02\01\4d\01\66\00\00\01\4d\01\66\00" + "\01\04\05\01\63\00\00\00\09\87\80\80\80\00\01\00" + "\41\00\0b\01\01" + ) + "type mismatch: element segment's type (ref func) does not match table's element type (ref null 0)" +) + diff --git a/test/regress/binary/bin_elementsN.bin.wast b/test/regress/binary/bin_elementsN.bin.wast new file mode 100644 index 000000000..102dc913d --- /dev/null +++ b/test/regress/binary/bin_elementsN.bin.wast @@ -0,0 +1,327 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:elementsN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\01\00" +) + +;; unittest bin:elementsN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\09\01" + "\00\41\00\0b\03\00\00\00" +) + +;; unittest bin:elementsN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\11\02" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" +) + +;; unittest bin:elementsN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b\03\00\00\00" +) + +;; unittest bin:elementsN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[22]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[23]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[24]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[25]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[26]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[27]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b\03" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[28]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b\03\00" + ) + "length out of bounds" +) + +;; unittest bin:elementsN[29]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\19\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b\03\00\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:elementsN[30]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\02\00" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:elementsN[31]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\0a\01" + "\00\41\00\0b\03\00\00\00\63" + ) + "section size mismatch" +) + +;; unittest bin:elementsN[32]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\12\02" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:elementsN[33]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\04\04\01\70\00\05\09\1a\03" + "\00\41\00\0b\03\00\00\00\00\41\00\0b\03\00\00\00" + "\00\41\00\0b\03\00\00\00\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_empty.bin.wast b/test/regress/binary/bin_empty.bin.wast new file mode 100644 index 000000000..c7d6ab1ba --- /dev/null +++ b/test/regress/binary/bin_empty.bin.wast @@ -0,0 +1,65 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:empty[1]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[2]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[3]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[4]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[5]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[6]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[7]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:empty[8]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_exports0.bin.wast b/test/regress/binary/bin_exports0.bin.wast new file mode 100644 index 000000000..18b74ce38 --- /dev/null +++ b/test/regress/binary/bin_exports0.bin.wast @@ -0,0 +1,117 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:exports0[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\07\85\80\80\80\00\01\01" + "\66\00\00" + ) + "unknown function 0" +) + +;; unittest bin:exports0[2]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\07\85\80\80\80\00\01\01" + "\74\01\00" + ) + "unknown table 0" +) + +;; unittest bin:exports0[3]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\07\85\80\80\80\00\01\01" + "\6d\02\00" + ) + "unknown memory 0" +) + +;; unittest bin:exports0[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\07\85\80\80\80\00\01\01" + "\67\03\00" + ) + "unknown global 0" +) + +;; unittest bin:exports0[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\07\86\80\80\80\00\01\02\63\64\00\00\0a\04" + "\01\02\00\0b" +) + +;; unittest bin:exports0[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\07\8b\80\80\80\00\02\02\63\64\00\00\02\63" + "\66\00\00\0a\04\01\02\00\0b" +) + +;; unittest bin:exports0[7]: INVALID DUPLICATE_EXPORT [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\07\8b\80\80\80\00\02\02\46\65\00\00\02\46" + "\65\00\00\0a\04\01\02\00\0b" + ) + "" +) + +;; unittest bin:exports0[8]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\07\86\80\80\80\00\01\02\63\64\00\01\0a\04" + "\01\02\00\0b" + ) + "unknown function 1" +) + +;; unittest bin:exports0[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\07\86" + "\80\80\80\00\01\02\66\67\01\00" +) + +;; unittest bin:exports0[10]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00\07\86" + "\80\80\80\00\01\02\66\67\01\01" + ) + "unknown table 1" +) + +;; unittest bin:exports0[11]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\07\87\80" + "\80\80\00\01\03\78\79\7a\02\00" +) + +;; unittest bin:exports0[12]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\01\07\87\80" + "\80\80\00\01\03\78\79\7a\02\01" + ) + "unknown memory 1" +) + +;; unittest bin:exports0[13]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\84\80\80\80\00\01\00\03\00" +) + +;; unittest bin:exports0[14]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\84\80\80\80\00\01\00\03\01" + ) + "unknown global 1" +) + diff --git a/test/regress/binary/bin_exportsN.bin.wast b/test/regress/binary/bin_exportsN.bin.wast new file mode 100644 index 000000000..4f595cbc4 --- /dev/null +++ b/test/regress/binary/bin_exportsN.bin.wast @@ -0,0 +1,179 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:exportsN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\01\00" +) + +;; unittest bin:exportsN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\05\01\01\67\03\00" +) + +;; unittest bin:exportsN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\09\02\01\67\03\00\01\68\03\00" +) + +;; unittest bin:exportsN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03\00\01\69\03\00" +) + +;; unittest bin:exportsN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03\00" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03\00\01" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03\00\01\69" + ) + "length out of bounds" +) + +;; unittest bin:exportsN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0d\03\01\67\03\00\01\68\03\00\01\69\03" + ) + "unexpected end of section or function" +) + +;; unittest bin:exportsN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:exportsN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\06\01\01\67\03\00\63" + ) + "section size mismatch" +) + +;; unittest bin:exportsN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0a\02\01\67\03\00\01\68\03\00\63" + ) + "section size mismatch" +) + +;; unittest bin:exportsN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" + "\07\0e\03\01\67\03\00\01\68\03\00\01\69\03\00\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_func_max_params.bin.wast b/test/regress/binary/bin_func_max_params.bin.wast new file mode 100644 index 000000000..a7baa68d5 --- /dev/null +++ b/test/regress/binary/bin_func_max_params.bin.wast @@ -0,0 +1,139 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:func_max_params[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\ec\87\80\80\00\01\60" + "\e7\07\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\00" +) + +;; unittest bin:func_max_params[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\ed\87\80\80\00\01\60" + "\e8\07\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e" + "\7e\7e\7e\7e\7e\7e\7e\7e\7e\7e\00" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_func_max_results.bin.wast b/test/regress/binary/bin_func_max_results.bin.wast new file mode 100644 index 000000000..dfb321bb3 --- /dev/null +++ b/test/regress/binary/bin_func_max_results.bin.wast @@ -0,0 +1,139 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:func_max_results[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\ec\87\80\80\00\01\60" + "\00\e7\07\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" +) + +;; unittest bin:func_max_results[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\ed\87\80\80\00\01\60" + "\00\e8\07\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" + "\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c\7c" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_func_ref_types0.bin.wast b/test/regress/binary/bin_func_ref_types0.bin.wast new file mode 100644 index 000000000..45265766a --- /dev/null +++ b/test/regress/binary/bin_func_ref_types0.bin.wast @@ -0,0 +1,26 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:func_ref_types0[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" + "\00\00\60\00\01\64\00" + ) + "" +) + +;; unittest bin:func_ref_types0[2]: VALID [function-references] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" + "\00\00\60\01\63\00\00" +) + +;; unittest bin:func_ref_types0[3]: INVALID OOB_INDEX [function-references] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" + "\00\00\60\01\63\02\00" + ) + "unknown type 2" +) + diff --git a/test/regress/binary/bin_func_ref_types1.bin.wast b/test/regress/binary/bin_func_ref_types1.bin.wast new file mode 100644 index 000000000..9f459475b --- /dev/null +++ b/test/regress/binary/bin_func_ref_types1.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:func_ref_types1[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\02\60" + "\00\01\64\01\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_funcs0.bin.wast b/test/regress/binary/bin_funcs0.bin.wast new file mode 100644 index 000000000..728d9d414 --- /dev/null +++ b/test/regress/binary/bin_funcs0.bin.wast @@ -0,0 +1,59 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:funcs0[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\03\82\80\80\80\00\01\00" + ) + "" +) + +;; unittest bin:funcs0[2]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\03\82\80\80\80\00\01\01" + ) + "" +) + +;; unittest bin:funcs0[3]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\03\82\80\80\80\00\01\04" + ) + "" +) + +;; unittest bin:funcs0[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\00\0a\04\01\02\00\0b" +) + +;; unittest bin:funcs0[5]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\01\0a\04\01\02\00\0b" + ) + "unknown type 1" +) + +;; unittest bin:funcs0[6]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\82" + "\80\80\80\00\01\04\0a\04\01\02\00\0b" + ) + "unknown type 4" +) + +;; unittest bin:funcs0[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\81" + "\80\80\80\00\01\0a\04\01\02\00\0b" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_funcs1.bin.wast b/test/regress/binary/bin_funcs1.bin.wast new file mode 100644 index 000000000..cd060abe9 --- /dev/null +++ b/test/regress/binary/bin_funcs1.bin.wast @@ -0,0 +1,43 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:funcs1[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\03\60" + "\00\00\60\00\00\60\00\00\03\82\80\80\80\00\01\00" + "\0a\04\01\02\00\0b" +) + +;; unittest bin:funcs1[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\03\60" + "\00\00\60\00\00\60\00\00\03\83\80\80\80\00\01\81" + "\00\0a\04\01\02\00\0b" +) + +;; unittest bin:funcs1[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\03\60" + "\00\00\60\00\00\60\00\00\03\83\80\80\80\00\01\82" + "\00\0a\04\01\02\00\0b" +) + +;; unittest bin:funcs1[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\03\60" + "\00\00\60\00\00\60\00\00\03\82\80\80\80\00\01\04" + "\0a\04\01\02\00\0b" + ) + "unknown type 4" +) + +;; unittest bin:funcs1[5]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\03\60" + "\00\00\60\00\00\60\00\00\03\82\80\80\80\00\01\05" + "\0a\04\01\02\00\0b" + ) + "unknown type 5" +) + diff --git a/test/regress/binary/bin_funcs2.bin.wast b/test/regress/binary/bin_funcs2.bin.wast new file mode 100644 index 000000000..7b6bb6f6a --- /dev/null +++ b/test/regress/binary/bin_funcs2.bin.wast @@ -0,0 +1,49 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:funcs2[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\03\82\80\80\80\00\01\00\0a" + "\04\01\02\00\0b" +) + +;; unittest bin:funcs2[2]: MALFORMED FUNC_COUNT_MISMATCH [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\03\81\80\80\80\00\00\0a\04" + "\01\02\00\0b" + ) + "function and code section have inconsistent lengths" +) + +;; unittest bin:funcs2[3]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\03\82\80\80\80\00\01\01\0a" + "\04\01\02\00\0b" + ) + "unknown type 1" +) + +;; unittest bin:funcs2[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\03\82\80\80\80\00\01\04\0a" + "\04\01\02\00\0b" + ) + "unknown type 4" +) + +;; unittest bin:funcs2[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\03\81\80\80\80\00\01\0a\04" + "\01\02\00\0b" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_funcsN.bin.wast b/test/regress/binary/bin_funcsN.bin.wast new file mode 100644 index 000000000..17313ef82 --- /dev/null +++ b/test/regress/binary/bin_funcsN.bin.wast @@ -0,0 +1,99 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:funcsN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\01" + "\00\0a\01\00" +) + +;; unittest bin:funcsN[2]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\00\63\0a\01\00" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[3]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\00" + "\0a\01\00" + ) + "length out of bounds" +) + +;; unittest bin:funcsN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\04\01\02\00\0b" +) + +;; unittest bin:funcsN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\03" + "\01\00\63\0a\04\01\02\00\0b" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\01" + "\01\0a\04\01\02\00\0b" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\03" + "\02\00\00\0a\07\02\02\00\0b\02\00\0b" +) + +;; unittest bin:funcsN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\04" + "\02\00\00\63\0a\07\02\02\00\0b\02\00\0b" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[9]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\02\00\0a\07\02\02\00\0b\02\00\0b" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[10]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\04" + "\03\00\00\00\0a\0a\03\02\00\0b\02\00\0b\02\00\0b" +) + +;; unittest bin:funcsN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\05" + "\03\00\00\00\63\0a\0a\03\02\00\0b\02\00\0b\02\00" + "\0b" + ) + "section size mismatch" +) + +;; unittest bin:funcsN[12]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\03" + "\03\00\00\0a\0a\03\02\00\0b\02\00\0b\02\00\0b" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_globals0.bin.wast b/test/regress/binary/bin_globals0.bin.wast new file mode 100644 index 000000000..b6e4c73cc --- /dev/null +++ b/test/regress/binary/bin_globals0.bin.wast @@ -0,0 +1,86 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:globals0[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7f" + "\00\41\01\0b" +) + +;; unittest bin:globals0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7f" + "\01\41\01\0b" +) + +;; unittest bin:globals0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7e" + "\00\42\02\0b" +) + +;; unittest bin:globals0[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\89\80\80\80\00\01\7d" + "\00\43\00\00\00\00\0b" +) + +;; unittest bin:globals0[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\8d\80\80\80\00\01\7c" + "\00\44\00\00\00\00\00\00\00\00\0b" +) + +;; unittest bin:globals0[6]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\84\80\80\80\00\01\2c" + "\00\0b" + ) + "malformed reference type" +) + +;; unittest bin:globals0[7]: MALFORMED INVALID_GLOBAL_FLAGS [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7f" + "\02\41\01\0b" + ) + "malformed mutability" +) + +;; unittest bin:globals0[8]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7d" + "\00\41\01\0b" + ) + "type mismatch: instruction requires [f32] but stack has [i32]" +) + +;; unittest bin:globals0[9]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7c" + "\00\42\02\0b" + ) + "type mismatch: instruction requires [f64] but stack has [i64]" +) + +;; unittest bin:globals0[10]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\89\80\80\80\00\01\7f" + "\00\43\00\00\00\00\0b" + ) + "type mismatch: instruction requires [i32] but stack has [f32]" +) + +;; unittest bin:globals0[11]: INVALID TYPE_MISMATCH [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8d\80\80\80\00\01\7e" + "\00\44\00\00\00\00\00\00\00\00\0b" + ) + "type mismatch: instruction requires [i64] but stack has [f64]" +) + diff --git a/test/regress/binary/bin_globals1.bin.wast b/test/regress/binary/bin_globals1.bin.wast new file mode 100644 index 000000000..a9a5acf4f --- /dev/null +++ b/test/regress/binary/bin_globals1.bin.wast @@ -0,0 +1,44 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:globals1[1]: INVALID INVALID_INIT_EXPR [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7f" + "\00\41\01\0b\7f\00\23\00\0b" + ) + "" +) + +;; unittest bin:globals1[2]: INVALID INVALID_INIT_EXPR [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7e" + "\00\42\01\0b\7f\00\23\00\0b" + ) + "type mismatch: instruction requires [i32] but stack has [i64]" +) + +;; unittest bin:globals1[3]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\86\80\80\80\00\01\7f" + "\00\23\00\0b" + ) + "unknown global 0" +) + +;; unittest bin:globals1[4]: VALID [gc] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7f" + "\00\41\01\0b\7f\00\23\00\0b" +) + +;; unittest bin:globals1[5]: INVALID TYPE_MISMATCH [gc] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7e" + "\00\42\01\0b\7f\00\23\00\0b" + ) + "type mismatch: instruction requires [i32] but stack has [i64]" +) + diff --git a/test/regress/binary/bin_globals2.bin.wast b/test/regress/binary/bin_globals2.bin.wast new file mode 100644 index 000000000..50bc4ac66 --- /dev/null +++ b/test/regress/binary/bin_globals2.bin.wast @@ -0,0 +1,29 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:globals2[1]: INVALID INVALID_INIT_EXPR [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\89\80\80\80\00\01\7d" + "\00\01\00\00\00\00\0b" + ) + "constant expression required" +) + +;; unittest bin:globals2[2]: INVALID INVALID_INIT_EXPR [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7f" + "\00\41\02\0b\7f\00\23\00\0b" + ) + "" +) + +;; unittest bin:globals2[3]: INVALID INVALID_INIT_EXPR [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\06\8b\80\80\80\00\02\7f" + "\01\41\02\0b\7f\00\23\00\0b" + ) + "constant expression required" +) + diff --git a/test/regress/binary/bin_globalsN.bin.wast b/test/regress/binary/bin_globalsN.bin.wast new file mode 100644 index 000000000..b010ca04d --- /dev/null +++ b/test/regress/binary/bin_globalsN.bin.wast @@ -0,0 +1,196 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:globalsN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\01\00" +) + +;; unittest bin:globalsN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\06\01\7f\00\41\00\0b" +) + +;; unittest bin:globalsN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\0b\02\7f\00\41\00\0b" + "\7f\00\41\00\0b" +) + +;; unittest bin:globalsN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f\00\41\00\0b" +) + +;; unittest bin:globalsN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f\00" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f\00\41" + ) + "length out of bounds" +) + +;; unittest bin:globalsN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\10\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f\00\41\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:globalsN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:globalsN[22]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\07\01\7f\00\41\00\0b" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:globalsN[23]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\0c\02\7f\00\41\00\0b" + "\7f\00\41\00\0b\63" + ) + "section size mismatch" +) + +;; unittest bin:globalsN[24]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\11\03\7f\00\41\00\0b" + "\7f\00\41\00\0b\7f\00\41\00\0b\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_hdr_split.bin.wast b/test/regress/binary/bin_hdr_split.bin.wast new file mode 100644 index 000000000..21d1a4b50 --- /dev/null +++ b/test/regress/binary/bin_hdr_split.bin.wast @@ -0,0 +1,7 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:hdr_split[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00" +) + diff --git a/test/regress/binary/bin_imports0.bin.wast b/test/regress/binary/bin_imports0.bin.wast new file mode 100644 index 000000000..488616145 --- /dev/null +++ b/test/regress/binary/bin_imports0.bin.wast @@ -0,0 +1,35 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:imports0[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\87" + "\80\80\80\00\01\01\4d\01\67\00\00" +) + +;; unittest bin:imports0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\89" + "\80\80\80\00\01\01\4e\01\68\01\70\00\00" +) + +;; unittest bin:imports0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\88" + "\80\80\80\00\01\01\4f\01\69\02\00\00" +) + +;; unittest bin:imports0[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\88" + "\80\80\80\00\01\01\50\01\6a\03\7f\00" +) + +;; unittest bin:imports0[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\87" + "\80\80\80\00\01\01\50\01\6a\03\7f" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_imports1.bin.wast b/test/regress/binary/bin_imports1.bin.wast new file mode 100644 index 000000000..76530456d --- /dev/null +++ b/test/regress/binary/bin_imports1.bin.wast @@ -0,0 +1,39 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:imports1[1]: MALFORMED INVALID_IMPORT_KIND [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\86\80\80\80\00\01\01" + "\50\01\6a\05" + ) + "malformed import kind" +) + +;; unittest bin:imports1[2]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\02\87\80\80\80\00\01\01" + "\4d\01\67\00\00" + ) + "unknown type 0" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:imports1[3]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\88\80\80\80\00\01\01" + "\50\01\6a\03\2c\00" + ) + "malformed reference type" +) + +;; unittest bin:imports1[4]: MALFORMED INVALID_GLOBAL_FLAGS [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\88\80\80\80\00\01\01" + "\50\01\6a\03\7f\13" + ) + "malformed mutability" +) + diff --git a/test/regress/binary/bin_imports2.bin.wast b/test/regress/binary/bin_imports2.bin.wast new file mode 100644 index 000000000..280e02dcc --- /dev/null +++ b/test/regress/binary/bin_imports2.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:imports2[1]: MALFORMED INVALID_IMPORT_KIND [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\86\80\80\80\00\01\01" + "\50\01\6a\05" + ) + "malformed import kind" +) + diff --git a/test/regress/binary/bin_imports3.bin.wast b/test/regress/binary/bin_imports3.bin.wast new file mode 100644 index 000000000..ffffa1baf --- /dev/null +++ b/test/regress/binary/bin_imports3.bin.wast @@ -0,0 +1,20 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:imports3[1]: MALFORMED INVALID_UTF8_STRING [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\87" + "\80\80\80\00\01\01\87\01\67\00\00" + ) + "malformed UTF-8 encoding" +) + +;; unittest bin:imports3[2]: MALFORMED INVALID_UTF8_STRING [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\87" + "\80\80\80\00\01\01\57\01\86\00\00" + ) + "malformed UTF-8 encoding" +) + diff --git a/test/regress/binary/bin_importsN.bin.wast b/test/regress/binary/bin_importsN.bin.wast new file mode 100644 index 000000000..abcc48fea --- /dev/null +++ b/test/regress/binary/bin_importsN.bin.wast @@ -0,0 +1,252 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:importsN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\01\00" +) + +;; unittest bin:importsN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\08\01\01\4d\01\67\03" + "\7f\00" +) + +;; unittest bin:importsN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\0f\02\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00" +) + +;; unittest bin:importsN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01\67\03\7f\00" +) + +;; unittest bin:importsN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16" + ) + "length out of bounds" +) + +;; unittest bin:importsN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03" + ) + "length out of bounds" +) + +;; unittest bin:importsN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d" + ) + "length out of bounds" +) + +;; unittest bin:importsN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67" + ) + "length out of bounds" +) + +;; unittest bin:importsN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + ) + "length out of bounds" +) + +;; unittest bin:importsN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f" + ) + "length out of bounds" +) + +;; unittest bin:importsN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00" + ) + "length out of bounds" +) + +;; unittest bin:importsN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d" + ) + "length out of bounds" +) + +;; unittest bin:importsN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67" + ) + "length out of bounds" +) + +;; unittest bin:importsN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03" + ) + "length out of bounds" +) + +;; unittest bin:importsN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f" + ) + "length out of bounds" +) + +;; unittest bin:importsN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00" + ) + "length out of bounds" +) + +;; unittest bin:importsN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[22]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d" + ) + "length out of bounds" +) + +;; unittest bin:importsN[23]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01" + ) + "length out of bounds" +) + +;; unittest bin:importsN[24]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01\67" + ) + "length out of bounds" +) + +;; unittest bin:importsN[25]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01\67\03" + ) + "length out of bounds" +) + +;; unittest bin:importsN[26]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\16\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01\67\03\7f" + ) + "unexpected end of section or function" +) + +;; unittest bin:importsN[27]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:importsN[28]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\09\01\01\4d\01\67\03" + "\7f\00\63" + ) + "section size mismatch" +) + +;; unittest bin:importsN[29]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\10\02\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\63" + ) + "section size mismatch" +) + +;; unittest bin:importsN[30]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\17\03\01\4d\01\67\03" + "\7f\00\01\4d\01\67\03\7f\00\01\4d\01\67\03\7f\00" + "\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_invalid.bin.wast b/test/regress/binary/bin_invalid.bin.wast new file mode 100644 index 000000000..84318768e --- /dev/null +++ b/test/regress/binary/bin_invalid.bin.wast @@ -0,0 +1,1938 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:invalid[1]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0e" + ) + "malformed section id" +) + +;; unittest bin:invalid[2]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0f" + ) + "malformed section id" +) + +;; unittest bin:invalid[3]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\10" + ) + "malformed section id" +) + +;; unittest bin:invalid[4]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\11" + ) + "malformed section id" +) + +;; unittest bin:invalid[5]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\12" + ) + "malformed section id" +) + +;; unittest bin:invalid[6]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\13" + ) + "malformed section id" +) + +;; unittest bin:invalid[7]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\14" + ) + "malformed section id" +) + +;; unittest bin:invalid[8]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\15" + ) + "malformed section id" +) + +;; unittest bin:invalid[9]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\16" + ) + "malformed section id" +) + +;; unittest bin:invalid[10]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\17" + ) + "malformed section id" +) + +;; unittest bin:invalid[11]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\18" + ) + "malformed section id" +) + +;; unittest bin:invalid[12]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\19" + ) + "malformed section id" +) + +;; unittest bin:invalid[13]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1a" + ) + "malformed section id" +) + +;; unittest bin:invalid[14]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1b" + ) + "malformed section id" +) + +;; unittest bin:invalid[15]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1c" + ) + "malformed section id" +) + +;; unittest bin:invalid[16]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1d" + ) + "malformed section id" +) + +;; unittest bin:invalid[17]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1e" + ) + "malformed section id" +) + +;; unittest bin:invalid[18]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\1f" + ) + "malformed section id" +) + +;; unittest bin:invalid[19]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\20" + ) + "malformed section id" +) + +;; unittest bin:invalid[20]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\21" + ) + "malformed section id" +) + +;; unittest bin:invalid[21]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\22" + ) + "malformed section id" +) + +;; unittest bin:invalid[22]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\23" + ) + "malformed section id" +) + +;; unittest bin:invalid[23]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\24" + ) + "malformed section id" +) + +;; unittest bin:invalid[24]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\25" + ) + "malformed section id" +) + +;; unittest bin:invalid[25]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\26" + ) + "malformed section id" +) + +;; unittest bin:invalid[26]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\27" + ) + "malformed section id" +) + +;; unittest bin:invalid[27]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\28" + ) + "malformed section id" +) + +;; unittest bin:invalid[28]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\29" + ) + "malformed section id" +) + +;; unittest bin:invalid[29]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2a" + ) + "malformed section id" +) + +;; unittest bin:invalid[30]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2b" + ) + "malformed section id" +) + +;; unittest bin:invalid[31]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2c" + ) + "malformed section id" +) + +;; unittest bin:invalid[32]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2d" + ) + "malformed section id" +) + +;; unittest bin:invalid[33]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2e" + ) + "malformed section id" +) + +;; unittest bin:invalid[34]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\2f" + ) + "malformed section id" +) + +;; unittest bin:invalid[35]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\30" + ) + "malformed section id" +) + +;; unittest bin:invalid[36]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\31" + ) + "malformed section id" +) + +;; unittest bin:invalid[37]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\32" + ) + "malformed section id" +) + +;; unittest bin:invalid[38]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\33" + ) + "malformed section id" +) + +;; unittest bin:invalid[39]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\34" + ) + "malformed section id" +) + +;; unittest bin:invalid[40]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\35" + ) + "malformed section id" +) + +;; unittest bin:invalid[41]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\36" + ) + "malformed section id" +) + +;; unittest bin:invalid[42]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\37" + ) + "malformed section id" +) + +;; unittest bin:invalid[43]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\38" + ) + "malformed section id" +) + +;; unittest bin:invalid[44]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\39" + ) + "malformed section id" +) + +;; unittest bin:invalid[45]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3a" + ) + "malformed section id" +) + +;; unittest bin:invalid[46]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3b" + ) + "malformed section id" +) + +;; unittest bin:invalid[47]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3c" + ) + "malformed section id" +) + +;; unittest bin:invalid[48]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3d" + ) + "malformed section id" +) + +;; unittest bin:invalid[49]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3e" + ) + "malformed section id" +) + +;; unittest bin:invalid[50]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\3f" + ) + "malformed section id" +) + +;; unittest bin:invalid[51]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\40" + ) + "malformed section id" +) + +;; unittest bin:invalid[52]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\41" + ) + "malformed section id" +) + +;; unittest bin:invalid[53]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\42" + ) + "malformed section id" +) + +;; unittest bin:invalid[54]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\43" + ) + "malformed section id" +) + +;; unittest bin:invalid[55]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\44" + ) + "malformed section id" +) + +;; unittest bin:invalid[56]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\45" + ) + "malformed section id" +) + +;; unittest bin:invalid[57]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\46" + ) + "malformed section id" +) + +;; unittest bin:invalid[58]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\47" + ) + "malformed section id" +) + +;; unittest bin:invalid[59]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\48" + ) + "malformed section id" +) + +;; unittest bin:invalid[60]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\49" + ) + "malformed section id" +) + +;; unittest bin:invalid[61]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4a" + ) + "malformed section id" +) + +;; unittest bin:invalid[62]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4b" + ) + "malformed section id" +) + +;; unittest bin:invalid[63]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4c" + ) + "malformed section id" +) + +;; unittest bin:invalid[64]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4d" + ) + "malformed section id" +) + +;; unittest bin:invalid[65]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4e" + ) + "malformed section id" +) + +;; unittest bin:invalid[66]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\4f" + ) + "malformed section id" +) + +;; unittest bin:invalid[67]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\50" + ) + "malformed section id" +) + +;; unittest bin:invalid[68]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\51" + ) + "malformed section id" +) + +;; unittest bin:invalid[69]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\52" + ) + "malformed section id" +) + +;; unittest bin:invalid[70]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\53" + ) + "malformed section id" +) + +;; unittest bin:invalid[71]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\54" + ) + "malformed section id" +) + +;; unittest bin:invalid[72]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\55" + ) + "malformed section id" +) + +;; unittest bin:invalid[73]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\56" + ) + "malformed section id" +) + +;; unittest bin:invalid[74]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\57" + ) + "malformed section id" +) + +;; unittest bin:invalid[75]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\58" + ) + "malformed section id" +) + +;; unittest bin:invalid[76]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\59" + ) + "malformed section id" +) + +;; unittest bin:invalid[77]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5a" + ) + "malformed section id" +) + +;; unittest bin:invalid[78]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5b" + ) + "malformed section id" +) + +;; unittest bin:invalid[79]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5c" + ) + "malformed section id" +) + +;; unittest bin:invalid[80]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5d" + ) + "malformed section id" +) + +;; unittest bin:invalid[81]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5e" + ) + "malformed section id" +) + +;; unittest bin:invalid[82]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\5f" + ) + "malformed section id" +) + +;; unittest bin:invalid[83]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\60" + ) + "malformed section id" +) + +;; unittest bin:invalid[84]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\61" + ) + "malformed section id" +) + +;; unittest bin:invalid[85]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\62" + ) + "malformed section id" +) + +;; unittest bin:invalid[86]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\63" + ) + "malformed section id" +) + +;; unittest bin:invalid[87]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\64" + ) + "malformed section id" +) + +;; unittest bin:invalid[88]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\65" + ) + "malformed section id" +) + +;; unittest bin:invalid[89]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\66" + ) + "malformed section id" +) + +;; unittest bin:invalid[90]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\67" + ) + "malformed section id" +) + +;; unittest bin:invalid[91]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\68" + ) + "malformed section id" +) + +;; unittest bin:invalid[92]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\69" + ) + "malformed section id" +) + +;; unittest bin:invalid[93]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6a" + ) + "malformed section id" +) + +;; unittest bin:invalid[94]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6b" + ) + "malformed section id" +) + +;; unittest bin:invalid[95]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6c" + ) + "malformed section id" +) + +;; unittest bin:invalid[96]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6d" + ) + "malformed section id" +) + +;; unittest bin:invalid[97]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6e" + ) + "malformed section id" +) + +;; unittest bin:invalid[98]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\6f" + ) + "malformed section id" +) + +;; unittest bin:invalid[99]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\70" + ) + "malformed section id" +) + +;; unittest bin:invalid[100]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\71" + ) + "malformed section id" +) + +;; unittest bin:invalid[101]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\72" + ) + "malformed section id" +) + +;; unittest bin:invalid[102]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\73" + ) + "malformed section id" +) + +;; unittest bin:invalid[103]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\74" + ) + "malformed section id" +) + +;; unittest bin:invalid[104]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\75" + ) + "malformed section id" +) + +;; unittest bin:invalid[105]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\76" + ) + "malformed section id" +) + +;; unittest bin:invalid[106]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\77" + ) + "malformed section id" +) + +;; unittest bin:invalid[107]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\78" + ) + "malformed section id" +) + +;; unittest bin:invalid[108]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\79" + ) + "malformed section id" +) + +;; unittest bin:invalid[109]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7a" + ) + "malformed section id" +) + +;; unittest bin:invalid[110]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7b" + ) + "malformed section id" +) + +;; unittest bin:invalid[111]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7c" + ) + "malformed section id" +) + +;; unittest bin:invalid[112]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7d" + ) + "malformed section id" +) + +;; unittest bin:invalid[113]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7e" + ) + "malformed section id" +) + +;; unittest bin:invalid[114]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\7f" + ) + "malformed section id" +) + +;; unittest bin:invalid[115]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\80" + ) + "malformed section id" +) + +;; unittest bin:invalid[116]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\81" + ) + "malformed section id" +) + +;; unittest bin:invalid[117]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\82" + ) + "malformed section id" +) + +;; unittest bin:invalid[118]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\83" + ) + "malformed section id" +) + +;; unittest bin:invalid[119]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\84" + ) + "malformed section id" +) + +;; unittest bin:invalid[120]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\85" + ) + "malformed section id" +) + +;; unittest bin:invalid[121]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\86" + ) + "malformed section id" +) + +;; unittest bin:invalid[122]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\87" + ) + "malformed section id" +) + +;; unittest bin:invalid[123]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\88" + ) + "malformed section id" +) + +;; unittest bin:invalid[124]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\89" + ) + "malformed section id" +) + +;; unittest bin:invalid[125]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8a" + ) + "malformed section id" +) + +;; unittest bin:invalid[126]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8b" + ) + "malformed section id" +) + +;; unittest bin:invalid[127]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8c" + ) + "malformed section id" +) + +;; unittest bin:invalid[128]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8d" + ) + "malformed section id" +) + +;; unittest bin:invalid[129]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8e" + ) + "malformed section id" +) + +;; unittest bin:invalid[130]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\8f" + ) + "malformed section id" +) + +;; unittest bin:invalid[131]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\90" + ) + "malformed section id" +) + +;; unittest bin:invalid[132]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\91" + ) + "malformed section id" +) + +;; unittest bin:invalid[133]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\92" + ) + "malformed section id" +) + +;; unittest bin:invalid[134]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\93" + ) + "malformed section id" +) + +;; unittest bin:invalid[135]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\94" + ) + "malformed section id" +) + +;; unittest bin:invalid[136]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\95" + ) + "malformed section id" +) + +;; unittest bin:invalid[137]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\96" + ) + "malformed section id" +) + +;; unittest bin:invalid[138]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\97" + ) + "malformed section id" +) + +;; unittest bin:invalid[139]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\98" + ) + "malformed section id" +) + +;; unittest bin:invalid[140]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\99" + ) + "malformed section id" +) + +;; unittest bin:invalid[141]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9a" + ) + "malformed section id" +) + +;; unittest bin:invalid[142]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9b" + ) + "malformed section id" +) + +;; unittest bin:invalid[143]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9c" + ) + "malformed section id" +) + +;; unittest bin:invalid[144]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9d" + ) + "malformed section id" +) + +;; unittest bin:invalid[145]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9e" + ) + "malformed section id" +) + +;; unittest bin:invalid[146]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\9f" + ) + "malformed section id" +) + +;; unittest bin:invalid[147]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a0" + ) + "malformed section id" +) + +;; unittest bin:invalid[148]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a1" + ) + "malformed section id" +) + +;; unittest bin:invalid[149]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a2" + ) + "malformed section id" +) + +;; unittest bin:invalid[150]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a3" + ) + "malformed section id" +) + +;; unittest bin:invalid[151]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a4" + ) + "malformed section id" +) + +;; unittest bin:invalid[152]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a5" + ) + "malformed section id" +) + +;; unittest bin:invalid[153]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a6" + ) + "malformed section id" +) + +;; unittest bin:invalid[154]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a7" + ) + "malformed section id" +) + +;; unittest bin:invalid[155]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a8" + ) + "malformed section id" +) + +;; unittest bin:invalid[156]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\a9" + ) + "malformed section id" +) + +;; unittest bin:invalid[157]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\aa" + ) + "malformed section id" +) + +;; unittest bin:invalid[158]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ab" + ) + "malformed section id" +) + +;; unittest bin:invalid[159]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ac" + ) + "malformed section id" +) + +;; unittest bin:invalid[160]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ad" + ) + "malformed section id" +) + +;; unittest bin:invalid[161]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ae" + ) + "malformed section id" +) + +;; unittest bin:invalid[162]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\af" + ) + "malformed section id" +) + +;; unittest bin:invalid[163]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b0" + ) + "malformed section id" +) + +;; unittest bin:invalid[164]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b1" + ) + "malformed section id" +) + +;; unittest bin:invalid[165]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b2" + ) + "malformed section id" +) + +;; unittest bin:invalid[166]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b3" + ) + "malformed section id" +) + +;; unittest bin:invalid[167]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b4" + ) + "malformed section id" +) + +;; unittest bin:invalid[168]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b5" + ) + "malformed section id" +) + +;; unittest bin:invalid[169]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b6" + ) + "malformed section id" +) + +;; unittest bin:invalid[170]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b7" + ) + "malformed section id" +) + +;; unittest bin:invalid[171]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b8" + ) + "malformed section id" +) + +;; unittest bin:invalid[172]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\b9" + ) + "malformed section id" +) + +;; unittest bin:invalid[173]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ba" + ) + "malformed section id" +) + +;; unittest bin:invalid[174]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\bb" + ) + "malformed section id" +) + +;; unittest bin:invalid[175]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\bc" + ) + "malformed section id" +) + +;; unittest bin:invalid[176]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\bd" + ) + "malformed section id" +) + +;; unittest bin:invalid[177]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\be" + ) + "malformed section id" +) + +;; unittest bin:invalid[178]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\bf" + ) + "malformed section id" +) + +;; unittest bin:invalid[179]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c0" + ) + "malformed section id" +) + +;; unittest bin:invalid[180]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c1" + ) + "malformed section id" +) + +;; unittest bin:invalid[181]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c2" + ) + "malformed section id" +) + +;; unittest bin:invalid[182]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c3" + ) + "malformed section id" +) + +;; unittest bin:invalid[183]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c4" + ) + "malformed section id" +) + +;; unittest bin:invalid[184]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c5" + ) + "malformed section id" +) + +;; unittest bin:invalid[185]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c6" + ) + "malformed section id" +) + +;; unittest bin:invalid[186]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c7" + ) + "malformed section id" +) + +;; unittest bin:invalid[187]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c8" + ) + "malformed section id" +) + +;; unittest bin:invalid[188]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\c9" + ) + "malformed section id" +) + +;; unittest bin:invalid[189]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ca" + ) + "malformed section id" +) + +;; unittest bin:invalid[190]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\cb" + ) + "malformed section id" +) + +;; unittest bin:invalid[191]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\cc" + ) + "malformed section id" +) + +;; unittest bin:invalid[192]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\cd" + ) + "malformed section id" +) + +;; unittest bin:invalid[193]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ce" + ) + "malformed section id" +) + +;; unittest bin:invalid[194]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\cf" + ) + "malformed section id" +) + +;; unittest bin:invalid[195]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d0" + ) + "malformed section id" +) + +;; unittest bin:invalid[196]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d1" + ) + "malformed section id" +) + +;; unittest bin:invalid[197]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d2" + ) + "malformed section id" +) + +;; unittest bin:invalid[198]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d3" + ) + "malformed section id" +) + +;; unittest bin:invalid[199]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d4" + ) + "malformed section id" +) + +;; unittest bin:invalid[200]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d5" + ) + "malformed section id" +) + +;; unittest bin:invalid[201]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d6" + ) + "malformed section id" +) + +;; unittest bin:invalid[202]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d7" + ) + "malformed section id" +) + +;; unittest bin:invalid[203]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d8" + ) + "malformed section id" +) + +;; unittest bin:invalid[204]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\d9" + ) + "malformed section id" +) + +;; unittest bin:invalid[205]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\da" + ) + "malformed section id" +) + +;; unittest bin:invalid[206]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\db" + ) + "malformed section id" +) + +;; unittest bin:invalid[207]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\dc" + ) + "malformed section id" +) + +;; unittest bin:invalid[208]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\dd" + ) + "malformed section id" +) + +;; unittest bin:invalid[209]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\de" + ) + "malformed section id" +) + +;; unittest bin:invalid[210]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\df" + ) + "malformed section id" +) + +;; unittest bin:invalid[211]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e0" + ) + "malformed section id" +) + +;; unittest bin:invalid[212]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e1" + ) + "malformed section id" +) + +;; unittest bin:invalid[213]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e2" + ) + "malformed section id" +) + +;; unittest bin:invalid[214]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e3" + ) + "malformed section id" +) + +;; unittest bin:invalid[215]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e4" + ) + "malformed section id" +) + +;; unittest bin:invalid[216]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e5" + ) + "malformed section id" +) + +;; unittest bin:invalid[217]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e6" + ) + "malformed section id" +) + +;; unittest bin:invalid[218]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e7" + ) + "malformed section id" +) + +;; unittest bin:invalid[219]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e8" + ) + "malformed section id" +) + +;; unittest bin:invalid[220]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\e9" + ) + "malformed section id" +) + +;; unittest bin:invalid[221]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ea" + ) + "malformed section id" +) + +;; unittest bin:invalid[222]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\eb" + ) + "malformed section id" +) + +;; unittest bin:invalid[223]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ec" + ) + "malformed section id" +) + +;; unittest bin:invalid[224]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ed" + ) + "malformed section id" +) + +;; unittest bin:invalid[225]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ee" + ) + "malformed section id" +) + +;; unittest bin:invalid[226]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ef" + ) + "malformed section id" +) + +;; unittest bin:invalid[227]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f0" + ) + "malformed section id" +) + +;; unittest bin:invalid[228]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f1" + ) + "malformed section id" +) + +;; unittest bin:invalid[229]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f2" + ) + "malformed section id" +) + +;; unittest bin:invalid[230]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f3" + ) + "malformed section id" +) + +;; unittest bin:invalid[231]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f4" + ) + "malformed section id" +) + +;; unittest bin:invalid[232]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f5" + ) + "malformed section id" +) + +;; unittest bin:invalid[233]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f6" + ) + "malformed section id" +) + +;; unittest bin:invalid[234]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f7" + ) + "malformed section id" +) + +;; unittest bin:invalid[235]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f8" + ) + "malformed section id" +) + +;; unittest bin:invalid[236]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\f9" + ) + "malformed section id" +) + +;; unittest bin:invalid[237]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\fa" + ) + "malformed section id" +) + +;; unittest bin:invalid[238]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\fb" + ) + "malformed section id" +) + +;; unittest bin:invalid[239]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\fc" + ) + "malformed section id" +) + +;; unittest bin:invalid[240]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\fd" + ) + "malformed section id" +) + +;; unittest bin:invalid[241]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\fe" + ) + "malformed section id" +) + +;; unittest bin:invalid[242]: MALFORMED INVALID_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\ff" + ) + "malformed section id" +) + diff --git a/test/regress/binary/bin_magic.bin.wast b/test/regress/binary/bin_magic.bin.wast new file mode 100644 index 000000000..b8a1eea09 --- /dev/null +++ b/test/regress/binary/bin_magic.bin.wast @@ -0,0 +1,34 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:magic[1]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\ff\61\73\6d\01\00\00\00" + ) + "magic header not detected" +) + +;; unittest bin:magic[2]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\ff\73\6d\01\00\00\00" + ) + "magic header not detected" +) + +;; unittest bin:magic[3]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\ff\6d\01\00\00\00" + ) + "magic header not detected" +) + +;; unittest bin:magic[4]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\ff\01\00\00\00" + ) + "magic header not detected" +) + diff --git a/test/regress/binary/bin_max_num_memories.bin.wast b/test/regress/binary/bin_max_num_memories.bin.wast new file mode 100644 index 000000000..9f91b1f87 --- /dev/null +++ b/test/regress/binary/bin_max_num_memories.bin.wast @@ -0,0 +1,68 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:max_num_memories[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\88\80\80\80\00\01\01" + "\4d\01\6d\02\00\00" +) + +;; unittest bin:max_num_memories[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\84\80\80\80\00\01\01" + "\03\04" +) + +;; unittest bin:max_num_memories[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\81\80\80\80\00\00\05" + "\84\80\80\80\00\01\01\03\04" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:max_num_memories[4]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\9d\80\80\80\00\04\01" + "\4d\01\6d\02\00\00\01\4d\01\6d\02\00\00\01\4d\01" + "\6d\02\00\00\01\4d\01\6d\02\00\00" +) + +;; unittest bin:max_num_memories[5]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\8d\80\80\80\00\04\01" + "\03\04\01\03\04\01\03\04\01\03\04" +) + +;; unittest bin:max_num_memories[6]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\03\01" + "\4d\01\6d\02\00\00\01\4d\01\6d\02\00\00\01\4d\01" + "\6d\02\00\00\05\84\80\80\80\00\01\01\03\04" +) + +;; unittest bin:max_num_memories[7]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\a4\80\80\80\00\05\01" + "\4d\01\6d\02\00\00\01\4d\01\6d\02\00\00\01\4d\01" + "\6d\02\00\00\01\4d\01\6d\02\00\00\01\4d\01\6d\02" + "\00\00" +) + +;; unittest bin:max_num_memories[8]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\90\80\80\80\00\05\01" + "\03\04\01\03\04\01\03\04\01\03\04\01\03\04" +) + +;; unittest bin:max_num_memories[9]: VALID [multi-memory] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\9d\80\80\80\00\04\01" + "\4d\01\6d\02\00\00\01\4d\01\6d\02\00\00\01\4d\01" + "\6d\02\00\00\01\4d\01\6d\02\00\00\05\84\80\80\80" + "\00\01\01\03\04" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_max_num_tables.bin.wast b/test/regress/binary/bin_max_num_tables.bin.wast new file mode 100644 index 000000000..8964070b5 --- /dev/null +++ b/test/regress/binary/bin_max_num_tables.bin.wast @@ -0,0 +1,69 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:max_num_tables[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\89\80\80\80\00\01\01" + "\4d\01\6d\01\70\00\00" +) + +;; unittest bin:max_num_tables[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\84\80\80\80\00\01\70" + "\00\00" +) + +;; unittest bin:max_num_tables[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\81\80\80\80\00\00\04" + "\84\80\80\80\00\01\70\00\00" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; unittest bin:max_num_tables[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\a1\80\80\80\00\04\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00" +) + +;; unittest bin:max_num_tables[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\8d\80\80\80\00\04\70" + "\00\00\70\00\00\70\00\00\70\00\00" +) + +;; unittest bin:max_num_tables[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\99\80\80\80\00\03\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\01" + "\4d\01\6d\01\70\00\00\04\84\80\80\80\00\01\70\00" + "\00" +) + +;; unittest bin:max_num_tables[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\a9\80\80\80\00\05\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\01" + "\4d\01\6d\01\70\00\00" +) + +;; unittest bin:max_num_tables[8]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\90\80\80\80\00\05\70" + "\00\00\70\00\00\70\00\00\70\00\00\70\00\00" +) + +;; unittest bin:max_num_tables[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\a1\80\80\80\00\04\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\01" + "\4d\01\6d\01\70\00\00\01\4d\01\6d\01\70\00\00\04" + "\84\80\80\80\00\01\70\00\00" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_memoriesN.bin.wast b/test/regress/binary/bin_memoriesN.bin.wast new file mode 100644 index 000000000..7940cc4e6 --- /dev/null +++ b/test/regress/binary/bin_memoriesN.bin.wast @@ -0,0 +1,52 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:memoriesN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\01\00" +) + +;; unittest bin:memoriesN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\03\01\00\00" +) + +;; unittest bin:memoriesN[3]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03" + ) + "length out of bounds" +) + +;; unittest bin:memoriesN[4]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01" + ) + "length out of bounds" +) + +;; unittest bin:memoriesN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\03\01\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:memoriesN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:memoriesN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\04\01\00\00\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_memory0.bin.wast b/test/regress/binary/bin_memory0.bin.wast new file mode 100644 index 000000000..60277fc15 --- /dev/null +++ b/test/regress/binary/bin_memory0.bin.wast @@ -0,0 +1,35 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:memory0[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\83\80\80\80\00\01\00" + "\00" +) + +;; unittest bin:memory0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\83\80\80\80\00\01\00" + "\01" +) + +;; unittest bin:memory0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\83\80\80\80\00\01\00" + "\05" +) + +;; unittest bin:memory0[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\84\80\80\80\00\01\01" + "\02\05" +) + +;; unittest bin:memory0[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\83\80\80\80\00\01\01" + "\00" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_memory_limits.bin.wast b/test/regress/binary/bin_memory_limits.bin.wast new file mode 100644 index 000000000..f16552943 --- /dev/null +++ b/test/regress/binary/bin_memory_limits.bin.wast @@ -0,0 +1,28 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:memory_limits[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\85\80\80\80\00\01\00" + "\ff\ff\03" +) + +;; unittest bin:memory_limits[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\86\80\80\80\00\01\01" + "\00\ff\ff\03" +) + +;; unittest bin:memory_limits[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\85\80\80\80\00\01\00" + "\80\80\04" +) + +;; unittest bin:memory_limits[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\86\80\80\80\00\01\01" + "\00\80\80\04" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_recgrp0.bin.wast b/test/regress/binary/bin_recgrp0.bin.wast new file mode 100644 index 000000000..454a7c4a7 --- /dev/null +++ b/test/regress/binary/bin_recgrp0.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:recgrp0[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\87\80\80\80\00\01\4e" + "\01\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_recgrp1.bin.wast b/test/regress/binary/bin_recgrp1.bin.wast new file mode 100644 index 000000000..7e398b9e3 --- /dev/null +++ b/test/regress/binary/bin_recgrp1.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:recgrp1[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\01\4e" + "\02\60\00\01\64\01\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_recgrp2.bin.wast b/test/regress/binary/bin_recgrp2.bin.wast new file mode 100644 index 000000000..4f478fc14 --- /dev/null +++ b/test/regress/binary/bin_recgrp2.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:recgrp2[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\8c\80\80\80\00\01\4e" + "\02\60\00\01\64\02\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_recgrp3.bin.wast b/test/regress/binary/bin_recgrp3.bin.wast new file mode 100644 index 000000000..db25f7d7c --- /dev/null +++ b/test/regress/binary/bin_recgrp3.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:recgrp3[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\01\4e" + "\02\4e\00\60\00\01\7f" + ) + "malformed definition type" +) + diff --git a/test/regress/binary/bin_repeat_funcs1.bin.wast b/test/regress/binary/bin_repeat_funcs1.bin.wast new file mode 100644 index 000000000..76aa3fc2c --- /dev/null +++ b/test/regress/binary/bin_repeat_funcs1.bin.wast @@ -0,0 +1,36 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:repeat_funcs1[1]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\04\01\02\00\0b\03\02\01\00\0a\04\01\02" + "\00\0b" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_funcs1[2]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\04\01\02\00\0b\03\02\01\00\0a\04\01\02" + "\00\0b\03\02\01\00\0a\04\01\02\00\0b" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_funcs1[3]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\0a\04\01\02\00\0b\03\02\01\00\0a\04\01\02" + "\00\0b\03\02\01\00\0a\04\01\02\00\0b\03\02\01\00" + "\0a\04\01\02\00\0b" + ) + "unexpected content after last section" +) + +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_repeat_funcs2.bin.wast b/test/regress/binary/bin_repeat_funcs2.bin.wast new file mode 100644 index 000000000..9c08bd732 --- /dev/null +++ b/test/regress/binary/bin_repeat_funcs2.bin.wast @@ -0,0 +1,9 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_repeat_imports1.bin.wast b/test/regress/binary/bin_repeat_imports1.bin.wast new file mode 100644 index 000000000..ad5bfcbc4 --- /dev/null +++ b/test/regress/binary/bin_repeat_imports1.bin.wast @@ -0,0 +1,35 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:repeat_imports1[1]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\02\07\01\01\4d\01\66\00\00" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_imports1[2]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\02\07\01\01\4d\01\66\00\00" + "\02\07\01\01\4d\01\66\00\00" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_imports1[3]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\02\07\01\01\4d\01\66\00\00" + "\02\07\01\01\4d\01\66\00\00\02\07\01\01\4d\01\66" + "\00\00" + ) + "unexpected content after last section" +) + +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_repeat_imports2.bin.wast b/test/regress/binary/bin_repeat_imports2.bin.wast new file mode 100644 index 000000000..a929f4773 --- /dev/null +++ b/test/regress/binary/bin_repeat_imports2.bin.wast @@ -0,0 +1,3 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_repeat_types1.bin.wast b/test/regress/binary/bin_repeat_types1.bin.wast new file mode 100644 index 000000000..4832947b8 --- /dev/null +++ b/test/regress/binary/bin_repeat_types1.bin.wast @@ -0,0 +1,32 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:repeat_types1[1]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\01\04" + "\01\60\00\00" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_types1[2]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\01\04" + "\01\60\00\00\01\04\01\60\00\00" + ) + "unexpected content after last section" +) + +;; unittest bin:repeat_types1[3]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\01\04" + "\01\60\00\00\01\04\01\60\00\00\01\04\01\60\00\00" + ) + "unexpected content after last section" +) + +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_repeat_types2.bin.wast b/test/regress/binary/bin_repeat_types2.bin.wast new file mode 100644 index 000000000..24b315f38 --- /dev/null +++ b/test/regress/binary/bin_repeat_types2.bin.wast @@ -0,0 +1,5 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections +;; skipped: needs the non-standard extension(s) repeat-sections diff --git a/test/regress/binary/bin_sect_custom1.bin.wast b/test/regress/binary/bin_sect_custom1.bin.wast new file mode 100644 index 000000000..fe17f14ba --- /dev/null +++ b/test/regress/binary/bin_sect_custom1.bin.wast @@ -0,0 +1,32 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_custom1[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\00\0b\0a\6d\79\5f\73\65" + "\63\74\69\6f\6e" +) + +;; unittest bin:sect_custom1[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\00\0c\0a\6d\79\5f\73\65" + "\63\74\69\6f\6e\4d" +) + +;; unittest bin:sect_custom1[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\00\0d\0a\6d\79\5f\73\65" + "\63\74\69\6f\6e\4d\4d" +) + +;; unittest bin:sect_custom1[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\00\0e\0a\6d\79\5f\73\65" + "\63\74\69\6f\6e\4d\4d\4d" +) + +;; unittest bin:sect_custom1[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\00\0f\0a\6d\79\5f\73\65" + "\63\74\69\6f\6e\4d\4d\4d\4d" +) + diff --git a/test/regress/binary/bin_sect_custom2.bin.wast b/test/regress/binary/bin_sect_custom2.bin.wast new file mode 100644 index 000000000..28e190a31 --- /dev/null +++ b/test/regress/binary/bin_sect_custom2.bin.wast @@ -0,0 +1,10 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_custom2[1]: MALFORMED INVALID_UTF8_STRING [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\02\01\99" + ) + "malformed UTF-8 encoding" +) + diff --git a/test/regress/binary/bin_sect_custom_ovf.bin.wast b/test/regress/binary/bin_sect_custom_ovf.bin.wast new file mode 100644 index 000000000..151d876e4 --- /dev/null +++ b/test/regress/binary/bin_sect_custom_ovf.bin.wast @@ -0,0 +1,92 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_custom_ovf[1]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\09\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[2]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\08\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[3]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\07\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[4]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\06\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\05\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\04\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\03\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[8]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\02\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[9]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\01\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_custom_ovf[10]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\00\00\09\78\5f\73\65\63" + "\74\69\6f\6e" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_sect_dup.bin.wast b/test/regress/binary/bin_sect_dup.bin.wast new file mode 100644 index 000000000..10ff05a6c --- /dev/null +++ b/test/regress/binary/bin_sect_dup.bin.wast @@ -0,0 +1,132 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_dup[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:sect_dup[2]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\01\00\01\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\01\00" +) + +;; unittest bin:sect_dup[4]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\01\00\02\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\03\01\00" +) + +;; unittest bin:sect_dup[6]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\01\00\03\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\01\00" +) + +;; unittest bin:sect_dup[8]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\01\00\04\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\01\00" +) + +;; unittest bin:sect_dup[10]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\01\00\05\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[11]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\01\00" +) + +;; unittest bin:sect_dup[12]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\01\00\06\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[13]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\07\01\00" +) + +;; unittest bin:sect_dup[14]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\01\00\07\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[15]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\09\01\00" +) + +;; unittest bin:sect_dup[16]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\09\01\00\09\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[17]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0a\01\00" +) + +;; unittest bin:sect_dup[18]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0a\01\00\0a\01\00" + ) + "unexpected content after last section" +) + +;; unittest bin:sect_dup[19]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0b\01\00" +) + +;; unittest bin:sect_dup[20]: MALFORMED DUPLICATE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\01\00\0b\01\00" + ) + "unexpected content after last section" +) + diff --git a/test/regress/binary/bin_sect_empty.bin.wast b/test/regress/binary/bin_sect_empty.bin.wast new file mode 100644 index 000000000..2dc387cb2 --- /dev/null +++ b/test/regress/binary/bin_sect_empty.bin.wast @@ -0,0 +1,52 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_empty[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:sect_empty[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\01\00" +) + +;; unittest bin:sect_empty[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\03\01\00" +) + +;; unittest bin:sect_empty[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\01\00" +) + +;; unittest bin:sect_empty[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\01\00" +) + +;; unittest bin:sect_empty[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\01\00" +) + +;; unittest bin:sect_empty[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\07\01\00" +) + +;; unittest bin:sect_empty[8]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\09\01\00" +) + +;; unittest bin:sect_empty[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0a\01\00" +) + +;; unittest bin:sect_empty[10]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0b\01\00" +) + diff --git a/test/regress/binary/bin_sect_empty_s.bin.wast b/test/regress/binary/bin_sect_empty_s.bin.wast new file mode 100644 index 000000000..4ac658188 --- /dev/null +++ b/test/regress/binary/bin_sect_empty_s.bin.wast @@ -0,0 +1,52 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_empty_s[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:sect_empty_s[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\02\01\00" +) + +;; unittest bin:sect_empty_s[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\03\01\00" +) + +;; unittest bin:sect_empty_s[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\01\00" +) + +;; unittest bin:sect_empty_s[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\05\01\00" +) + +;; unittest bin:sect_empty_s[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\06\01\00" +) + +;; unittest bin:sect_empty_s[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\07\01\00" +) + +;; unittest bin:sect_empty_s[8]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\09\01\00" +) + +;; unittest bin:sect_empty_s[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0a\01\00" +) + +;; unittest bin:sect_empty_s[10]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\0b\01\00" +) + diff --git a/test/regress/binary/bin_sect_eof.bin.wast b/test/regress/binary/bin_sect_eof.bin.wast new file mode 100644 index 000000000..1467fbe86 --- /dev/null +++ b/test/regress/binary/bin_sect_eof.bin.wast @@ -0,0 +1,74 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_eof[1]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[2]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[3]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[4]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[8]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\09\01\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:sect_eof[9]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\01\01" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_sect_size0.bin.wast b/test/regress/binary/bin_sect_size0.bin.wast new file mode 100644 index 000000000..cd83a013e --- /dev/null +++ b/test/regress/binary/bin_sect_size0.bin.wast @@ -0,0 +1,82 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_size0[1]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[2]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[3]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[4]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[6]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[7]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[8]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\09\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[9]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0a\00\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_size0[10]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\00\00" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_sect_underflow.bin.wast b/test/regress/binary/bin_sect_underflow.bin.wast new file mode 100644 index 000000000..53996a181 --- /dev/null +++ b/test/regress/binary/bin_sect_underflow.bin.wast @@ -0,0 +1,82 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sect_underflow[1]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[2]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\02\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[3]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\03\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[4]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\05\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\06\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\07\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\09\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0a\02\00" + ) + "section size mismatch" +) + +;; unittest bin:sect_underflow[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\0b\02\00" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_start0.bin.wast b/test/regress/binary/bin_start0.bin.wast new file mode 100644 index 000000000..49352dd16 --- /dev/null +++ b/test/regress/binary/bin_start0.bin.wast @@ -0,0 +1,42 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:start0[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\08\81\80\80\80\00\00" + ) + "unknown function 0" +) + +;; unittest bin:start0[2]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\08\81\80\80\80\00\01" + ) + "unknown function 1" +) + +;; unittest bin:start0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\08\81\80\80\80\00\00\0a\04\01\02\00\0b" +) + +;; unittest bin:start0[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\08\81\80\80\80\00\01\0a\04\01\02\00\0b" + ) + "unknown function 1" +) + +;; unittest bin:start0[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\03\02" + "\01\00\08\82\80\80\80\00\00\00\0a\04\01\02\00\0b" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_start1.bin.wast b/test/regress/binary/bin_start1.bin.wast new file mode 100644 index 000000000..94fd0e7b9 --- /dev/null +++ b/test/regress/binary/bin_start1.bin.wast @@ -0,0 +1,42 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:start1[1]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\08\81\80\80\80\00\00" + ) + "unknown function 0" +) + +;; unittest bin:start1[2]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\08\81\80\80\80\00\01" + ) + "unknown function 1" +) + +;; unittest bin:start1[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\08\81\80\80\80\00\00" +) + +;; unittest bin:start1[4]: INVALID OOB_INDEX [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\08\81\80\80\80\00\01" + ) + "unknown function 1" +) + +;; unittest bin:start1[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00\02\07" + "\01\01\4d\01\66\00\00\08\82\80\80\80\00\00\00" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_start2.bin.wast b/test/regress/binary/bin_start2.bin.wast new file mode 100644 index 000000000..f55eb53cf --- /dev/null +++ b/test/regress/binary/bin_start2.bin.wast @@ -0,0 +1,20 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:start2[1]: INVALID ILLEGAL_TYPE [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\05\01\60\01\7f\00\03" + "\02\01\00\08\01\00" + ) + "" +) + +;; unittest bin:start2[2]: INVALID ILLEGAL_TYPE [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\01\05\01\60\00\01\7f\03" + "\02\01\00\08\01\00" + ) + "" +) + diff --git a/test/regress/binary/bin_sub0.bin.wast b/test/regress/binary/bin_sub0.bin.wast new file mode 100644 index 000000000..b4e15d08c --- /dev/null +++ b/test/regress/binary/bin_sub0.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sub0[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\87\80\80\80\00\01\50" + "\00\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_sub1.bin.wast b/test/regress/binary/bin_sub1.bin.wast new file mode 100644 index 000000000..47b9cbe19 --- /dev/null +++ b/test/regress/binary/bin_sub1.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sub1[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\01\50" + "\00\50\00\60\00\01\7f" + ) + "malformed definition type" +) + diff --git a/test/regress/binary/bin_sub2.bin.wast b/test/regress/binary/bin_sub2.bin.wast new file mode 100644 index 000000000..1a4cd6055 --- /dev/null +++ b/test/regress/binary/bin_sub2.bin.wast @@ -0,0 +1,11 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:sub2[1]: MALFORMED INVALID_TYPE [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\8e\80\80\80\00\02\50" + "\00\60\00\01\7f\50\01\00\60\00\01\7f" + ) + "" +) + diff --git a/test/regress/binary/bin_table_limits.bin.wast b/test/regress/binary/bin_table_limits.bin.wast new file mode 100644 index 000000000..cae80b3ed --- /dev/null +++ b/test/regress/binary/bin_table_limits.bin.wast @@ -0,0 +1,28 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:table_limits[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\87\80\80\80\00\01\70" + "\00\ff\ac\e2\04" +) + +;; unittest bin:table_limits[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\88\80\80\80\00\01\70" + "\01\00\ff\ac\e2\04" +) + +;; unittest bin:table_limits[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\87\80\80\80\00\01\70" + "\00\80\ad\e2\04" +) + +;; unittest bin:table_limits[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\88\80\80\80\00\01\70" + "\01\00\80\ad\e2\04" +) + +;; skipped: EXCEEDED_LIMIT is an engine-specific limit +;; skipped: EXCEEDED_LIMIT is an engine-specific limit diff --git a/test/regress/binary/bin_tables0.bin.wast b/test/regress/binary/bin_tables0.bin.wast new file mode 100644 index 000000000..325c7f5d1 --- /dev/null +++ b/test/regress/binary/bin_tables0.bin.wast @@ -0,0 +1,38 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:tables0[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\84\80\80\80\00\01\70" + "\00\00" +) + +;; unittest bin:tables0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\84\80\80\80\00\01\70" + "\00\02" +) + +;; unittest bin:tables0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\85\80\80\80\00\01\70" + "\01\02\03" +) + +;; unittest bin:tables0[4]: INVALID ILLEGAL_TYPE [none] +(assert_invalid + (module binary + "\00\61\73\6d\01\00\00\00\04\84\80\80\80\00\01\7f" + "\00\00" + ) + "" +) + +;; unittest bin:tables0[5]: MALFORMED OVERFLOW_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\84\80\80\80\00\01\70" + "\01\02" + ) + "unexpected end of section or function" +) + diff --git a/test/regress/binary/bin_tablesN.bin.wast b/test/regress/binary/bin_tablesN.bin.wast new file mode 100644 index 000000000..920a70837 --- /dev/null +++ b/test/regress/binary/bin_tablesN.bin.wast @@ -0,0 +1,60 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:tablesN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\01\00" +) + +;; unittest bin:tablesN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00\00" +) + +;; unittest bin:tablesN[3]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\04" + ) + "length out of bounds" +) + +;; unittest bin:tablesN[4]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01" + ) + "length out of bounds" +) + +;; unittest bin:tablesN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70" + ) + "length out of bounds" +) + +;; unittest bin:tablesN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\04\01\70\00" + ) + "unexpected end of section or function" +) + +;; unittest bin:tablesN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:tablesN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\04\05\01\70\00\00\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_types0.bin.wast b/test/regress/binary/bin_types0.bin.wast new file mode 100644 index 000000000..f5a0c71a8 --- /dev/null +++ b/test/regress/binary/bin_types0.bin.wast @@ -0,0 +1,30 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:types0[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:types0[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00" +) + +;; unittest bin:types0[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\07\02\60\00\00\60\00" + "\00" +) + +;; unittest bin:types0[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0a\03\60\00\00\60\00" + "\00\60\00\00" +) + +;; unittest bin:types0[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0d\04\60\00\00\60\00" + "\00\60\00\00\60\00\00" +) + diff --git a/test/regress/binary/bin_types1.bin.wast b/test/regress/binary/bin_types1.bin.wast new file mode 100644 index 000000000..f21e43115 --- /dev/null +++ b/test/regress/binary/bin_types1.bin.wast @@ -0,0 +1,74 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:types1[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:types1[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\04\01\60\00\00" +) + +;; unittest bin:types1[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\05\01\60\00\01\7d" +) + +;; unittest bin:types1[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\05\01\60\01\7f\00" +) + +;; unittest bin:types1[5]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\06\01\60\01\7f\01\7d" +) + +;; unittest bin:types1[6]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\06\01\60\02\7f\7f\00" +) + +;; unittest bin:types1[7]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\07\01\60\02\7f\7f\01" + "\7d" +) + +;; unittest bin:types1[8]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\07\02\60\00\00\60\00" + "\00" +) + +;; unittest bin:types1[9]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\09\02\60\00\01\7d\60" + "\00\01\7d" +) + +;; unittest bin:types1[10]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\09\02\60\01\7f\00\60" + "\01\7f\00" +) + +;; unittest bin:types1[11]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0b\02\60\01\7f\01\7d" + "\60\01\7f\01\7d" +) + +;; unittest bin:types1[12]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0b\02\60\02\7f\7f\00" + "\60\02\7f\7f\00" +) + +;; unittest bin:types1[13]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0d\02\60\02\7f\7f\01" + "\7d\60\02\7f\7f\01\7d" +) + diff --git a/test/regress/binary/bin_typesN.bin.wast b/test/regress/binary/bin_typesN.bin.wast new file mode 100644 index 000000000..47abddba6 --- /dev/null +++ b/test/regress/binary/bin_typesN.bin.wast @@ -0,0 +1,196 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:typesN[1]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\01\00" +) + +;; unittest bin:typesN[2]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\06\01\60\01\7f\01\7f" +) + +;; unittest bin:typesN[3]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\0b\02\60\01\7f\01\7f" + "\60\01\7f\01\7f" +) + +;; unittest bin:typesN[4]: VALID [none] +(module definition binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60\01\7f\01\7f" +) + +;; unittest bin:typesN[5]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10" + ) + "length out of bounds" +) + +;; unittest bin:typesN[6]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03" + ) + "length out of bounds" +) + +;; unittest bin:typesN[7]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60" + ) + "length out of bounds" +) + +;; unittest bin:typesN[8]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01" + ) + "length out of bounds" +) + +;; unittest bin:typesN[9]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f" + ) + "length out of bounds" +) + +;; unittest bin:typesN[10]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01" + ) + "length out of bounds" +) + +;; unittest bin:typesN[11]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + ) + "length out of bounds" +) + +;; unittest bin:typesN[12]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60" + ) + "length out of bounds" +) + +;; unittest bin:typesN[13]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01" + ) + "length out of bounds" +) + +;; unittest bin:typesN[14]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f" + ) + "length out of bounds" +) + +;; unittest bin:typesN[15]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01" + ) + "length out of bounds" +) + +;; unittest bin:typesN[16]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f" + ) + "length out of bounds" +) + +;; unittest bin:typesN[17]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60" + ) + "length out of bounds" +) + +;; unittest bin:typesN[18]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60\01" + ) + "length out of bounds" +) + +;; unittest bin:typesN[19]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60\01\7f" + ) + "length out of bounds" +) + +;; unittest bin:typesN[20]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\10\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60\01\7f\01" + ) + "unexpected end of section or function" +) + +;; unittest bin:typesN[21]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\02\00\63" + ) + "section size mismatch" +) + +;; unittest bin:typesN[22]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\07\01\60\01\7f\01\7f" + "\63" + ) + "section size mismatch" +) + +;; unittest bin:typesN[23]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\0c\02\60\01\7f\01\7f" + "\60\01\7f\01\7f\63" + ) + "section size mismatch" +) + +;; unittest bin:typesN[24]: MALFORMED INCOMPLETE_SECTION [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\00\01\11\03\60\01\7f\01\7f" + "\60\01\7f\01\7f\60\01\7f\01\7f\63" + ) + "section size mismatch" +) + diff --git a/test/regress/binary/bin_version.bin.wast b/test/regress/binary/bin_version.bin.wast new file mode 100644 index 000000000..5998824e2 --- /dev/null +++ b/test/regress/binary/bin_version.bin.wast @@ -0,0 +1,34 @@ +;; generated by test/regress/binary/record.sh; do not edit + +;; unittest bin:version[1]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\ff\00\00\00" + ) + "unknown binary version" +) + +;; unittest bin:version[2]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\ff\00\00" + ) + "unknown binary version" +) + +;; unittest bin:version[3]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\ff\00" + ) + "unknown binary version" +) + +;; unittest bin:version[4]: MALFORMED INVALID_HEADER [none] +(assert_malformed + (module binary + "\00\61\73\6d\01\00\00\ff" + ) + "unknown binary version" +) + diff --git a/test/regress/binary/check.sh b/test/regress/binary/check.sh new file mode 100755 index 000000000..3a425c48d --- /dev/null +++ b/test/regress/binary/check.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# Runs the externalized binary tests in this directory through the reference interpreter and +# reports where it disagrees with Wizard. +# +# Each file corresponds to one Wizard unit test and asserts, for every module that test +# decoded, only whether the specification should reject it while decoding +# (assert_malformed) or while validating (assert_invalid). Expected messages are left empty +# so that only the phase is compared; see test/unittest/BinRecorder.v3. +# +# The reference interpreter stops at the first failing assertion in a file, so any file that +# disagrees is re-run one trial at a time to attribute the disagreement and to find the rest. + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do + HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$HERE/$SOURCE" +done +HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + +WIZENG_LOC=$(cd $HERE/../../../ && pwd) +SPEC_LOC=${SPEC_LOC:=$WIZENG_LOC/wasm-spec/repos/spec} +SPEC_INT=${SPEC_INT:=$SPEC_LOC/interpreter/wasm} + +if [ ! -x "$SPEC_INT" ]; then + echo "WebAssembly reference interpreter not found: $SPEC_INT" + echo "Set SPEC_INT to point at it." + exit 1 +fi + +TESTS="$@" +if [ "$TESTS" = "" ]; then + TESTS=$(ls $HERE/*.bin.wast 2>/dev/null) +fi +if [ "$TESTS" = "" ]; then + echo "No tests found; run $HERE/record.sh first." + exit 1 +fi + +TMP=$(mktemp -d) +trap "rm -rf $TMP" EXIT + +REPORT=$TMP/report +: > $REPORT +FILES_OK=0 +FILES_BAD=0 + +for t in $TESTS; do + if $SPEC_INT $t > /dev/null 2>&1; then + FILES_OK=$((FILES_OK + 1)) + continue + fi + FILES_BAD=$((FILES_BAD + 1)) + base=$(basename $t .bin.wast) + + # Split into one file per trial. The recorder writes a ";; unittest [n]: + # " comment above each module, which both delimits the trials and labels them. + rm -f $TMP/split.* + awk -v dir="$TMP" ' + /^;; .*\[[0-9]+\]: / { n++; f = sprintf("%s/split.%04d.bin.wast", dir, n) } + n > 0 { print > f } + ' $t + + echo "== $base" + for s in $(ls $TMP/split.* 2>/dev/null); do + out=$($SPEC_INT $s 2>&1) + [ $? = 0 ] && continue + label=$(head -1 $s | sed 's/^;; unittest //') + # "[n]: []" + wizard=$(echo "$label" | sed -e 's/^[^ ]* //' -e 's/ \[.*//') + reason=$(echo "$out" | tail -1 | sed -e 's/.*: //') + echo " $label" + echo " reference: $reason" + echo "$wizard | $reason" >> $REPORT + done +done + +echo +echo "files: $FILES_OK agreed, $FILES_BAD disagreed" +if [ $FILES_BAD = 0 ]; then exit 0; fi + +echo +echo "Disagreeing trials, by what Wizard concluded and what the reference said." +echo "A whole class sharing one Wizard error code usually means the phase mapping in" +echo "BinRecorder.phaseOf is wrong for that code, not that the engines truly differ:" +sort $REPORT | uniq -c | sort -rn | sed 's/^/ /' +echo +echo " total disagreeing trials: $(wc -l < $REPORT | tr -d ' ')" +exit 1 diff --git a/test/regress/binary/disagree/README.md b/test/regress/binary/disagree/README.md new file mode 100644 index 000000000..9a1b959b5 --- /dev/null +++ b/test/regress/binary/disagree/README.md @@ -0,0 +1,39 @@ +# Confirmed disagreements + +Hand-written text sources for the differences that `check.sh` found between Wizard and the +reference interpreter, kept here as independent evidence. The recorded `.bin.wast` corpus is +encoded by Wizard's own test helpers, so a difference there could in principle be an artifact +of that encoding; these sources are written by hand in the text format and validated by the +reference interpreter, which does its own encoding. Each one below reproduces a difference +that Wizard does not detect at all. + +Run them with: + + wasm-spec/repos/spec/interpreter/wasm test/regress/binary/disagree/*.wast + +They are expected to be *rejected*, so this directory is not wired into `test/regress.sh`. +`ok.wast` is a control that must be accepted, to show that the rejection is caused by the +element type and nothing else. + +## elem_type_flags0.wast, elem_type_flags4.wast + +The specification gives an element segment a single type and requires that type to be a +subtype of the table's element type. Wizard does not perform that check for two of the +segment encodings: + + - flags=0 (active, table 0, function indices). The segment's type is `funcref`. + `BinParser.readElemDecl` case 0 never calls `checkElemsType`; it type checks each + function individually instead, which accepts a `funcref` segment into a table of typed + function references even though `funcref` is not a subtype of `(ref null $t)`. + Recorded as `bin:elements3[1]` and `bin:elements4[1]`, which the unit tests assert are + valid. (Those two unit tests are byte-for-byte identical to each other.) + + - flags=4 (active, table 0, expressions). The segment's type is implicitly `funcref`. + Case 4 does call `checkElemsType`, but derives the expected type from the table itself: + + var elemtype = if(t.0 != null, ValueType.Ref(true, t.0.elemtype.heap), ValueTypes.FUNCREF); + checkElemsType(pt, t.0, elemtype); + + so it compares the table's element type against itself and can never fail. Case 6, the + same encoding with an explicit type, does it correctly with `checkElemsType(pt, table, vt)`. + Recorded as `bin:elements1[2]`, which the unit test asserts is valid. diff --git a/test/regress/binary/disagree/elem_type_flags0.wast b/test/regress/binary/disagree/elem_type_flags0.wast new file mode 100644 index 000000000..ee3d629d2 --- /dev/null +++ b/test/regress/binary/disagree/elem_type_flags0.wast @@ -0,0 +1,8 @@ +;; flags=0 elem (ref func) vs table of (ref null 0): Wizard accepts, reference rejects. +;; See bin:elements3, bin:elements4; ok.wast is the same module with a funcref table. +(module + (type $t (func)) + (import "M" "f" (func $f (type $t))) + (table 0 (ref null $t)) + (elem (i32.const 0) func $f) +) diff --git a/test/regress/binary/disagree/elem_type_flags4.wast b/test/regress/binary/disagree/elem_type_flags4.wast new file mode 100644 index 000000000..fbfce62e5 --- /dev/null +++ b/test/regress/binary/disagree/elem_type_flags4.wast @@ -0,0 +1,6 @@ +;; flags=4 elem (ref null func) vs externref table: Wizard accepts, reference rejects. +;; See bin:elements1. +(module + (table 0 externref) + (elem (i32.const 0) funcref) +) diff --git a/test/regress/binary/disagree/ok.wast b/test/regress/binary/disagree/ok.wast new file mode 100644 index 000000000..62cfd6f67 --- /dev/null +++ b/test/regress/binary/disagree/ok.wast @@ -0,0 +1,8 @@ +;; Control for elem_type_flags0.wast: funcref table instead, which the reference validates. +;; (Only validation matters here; the link failure on the unresolved import is expected.) +(module + (type $t (func)) + (import "M" "f" (func $f (type $t))) + (table 0 funcref) + (elem (i32.const 0) func $f) +) diff --git a/test/regress/binary/fill-messages.sh b/test/regress/binary/fill-messages.sh new file mode 100755 index 000000000..4d4e862f8 --- /dev/null +++ b/test/regress/binary/fill-messages.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash + +# Fills in the expected failure messages of the recorded .bin.wast files. +# +# The recorder writes an empty expected message, because Wizard's error codes are not the +# specification's message texts. Wherever Wizard and the reference interpreter agree that a +# module should be rejected, and agree on the phase, this replaces the empty message with the +# one the reference interpreter actually produces, which is what the hand-written spec tests +# carry. Trials where the two disagree keep an empty message; check.sh reports those. +# +# The message is discovered by asserting a sentinel that cannot match, which makes the +# reference interpreter print the message it expected to see instead. + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do + HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$HERE/$SOURCE" +done +HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + +WIZENG_LOC=$(cd $HERE/../../../ && pwd) +SPEC_LOC=${SPEC_LOC:=$WIZENG_LOC/wasm-spec/repos/spec} +SPEC_INT=${SPEC_INT:=$SPEC_LOC/interpreter/wasm} + +if [ ! -x "$SPEC_INT" ]; then + echo "WebAssembly reference interpreter not found: $SPEC_INT" + exit 1 +fi + +TESTS="$@" +if [ "$TESTS" = "" ]; then + TESTS=$(ls $HERE/*.bin.wast 2>/dev/null) +fi + +TMP=$(mktemp -d) +trap "rm -rf $TMP" EXIT + +SENTINEL='@@no-such-message@@' +FILLED=0 +LEFT=0 + +for t in $TESTS; do + rm -f $TMP/t.* + awk -v dir="$TMP" ' + /^;; .*\[[0-9]+\]: / { n++; f = sprintf("%s/t.%04d.bin.wast", dir, n) } + n > 0 { print > f } + ' $t + + : > $TMP/msgs + for s in $(ls $TMP/t.*.bin.wast 2>/dev/null); do + if ! grep -q '(assert_' $s; then + echo "" >> $TMP/msgs # a valid module has no message + continue + fi + # The message is the last line of the trial that is a bare indented string; replace + # whatever is there so that this is idempotent on already-filled files. + awk -v sentinel="$SENTINEL" ' + { line[NR] = $0; if ($0 ~ /^ "/) last = NR } + END { for (i = 1; i <= NR; i++) print (i == last) ? " \"" sentinel "\"" : line[i] } + ' $s > $TMP/probe.bin.wast + out=$($SPEC_INT $TMP/probe.bin.wast 2>&1) + # "Result: """ appears only when the module was rejected in the expected + # phase but with a different message, which is exactly the case we want. + msg=$(echo "$out" | grep '^Result: ' | head -1 | sed -e 's/^Result: "//' -e 's/"$//') + # A message containing a quote or backslash would not survive being written back + # into a string literal; leave those empty rather than emit something malformed. + case "$msg" in + *\"*|*\\*) msg="" ;; + esac + echo "$msg" >> $TMP/msgs + done + + # Substitute the discovered message into the last string line of each trial. + awk -v msgfile="$TMP/msgs" ' + BEGIN { i = 0; while ((getline line < msgfile) > 0) msgs[++i] = line } + /^;; .*\[[0-9]+\]: / { + if (n > 0) flush() + n++; c = 0; last = 0 + } + { if (n == 0) { print; next } # header, before the first trial + buf[++c] = $0; if ($0 ~ /^ "/) last = c } + END { if (n > 0) flush() } + function flush( i) { + for (i = 1; i <= c; i++) { + if (i == last && last > 0 && msgs[n] != "") print " \"" msgs[n] "\"" + else print buf[i] + } + c = 0 + } + ' $t > $TMP/out && mv $TMP/out $t + + f=$(grep -c . $TMP/msgs) + l=$(( $(grep -c '(assert_' $t) - f )) + FILLED=$((FILLED + f)) + LEFT=$((LEFT + l)) + echo " $(basename $t): $f filled, $l left empty" +done + +echo +echo "filled $FILLED message(s); $LEFT left empty (Wizard and the reference disagree there)" diff --git a/test/regress/binary/record.sh b/test/regress/binary/record.sh new file mode 100755 index 000000000..e3a0e53c7 --- /dev/null +++ b/test/regress/binary/record.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Regenerates the .bin.wast files in this directory from the binary-encoding unit tests. +# Each unit test that decodes binary modules produces one file here, containing every +# distinct module it decoded and the result it expected. See test/unittest/BinRecorder.v3. + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do + HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$HERE/$SOURCE" +done +HERE="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + +. $HERE/../../common.sh binary-record + +make_binary unittest || exit $? + +cd $WIZENG_LOC + +rm -f $HERE/*.bin.wast + +# The recorder only knows about the binary parser tests; other tests are irrelevant here. +exec $BINARY --record-binary=$HERE "$@" 'bin:*' diff --git a/test/unittest.main.v3 b/test/unittest.main.v3 index 818d8f07c..8b666ca97 100644 --- a/test/unittest.main.v3 +++ b/test/unittest.main.v3 @@ -10,12 +10,26 @@ def X = [ () ]; +def RECORD_BINARY = "--record-binary"; +def DEFAULT_RECORD_DIR = "test/regress/binary"; + // Main entrypoint for running unit tests. def main(args: Array) -> int { var err = ErrorGen.new("unittest"); for (i < args.length) { + var arg = args[i]; + // Externalize the modules decoded by the binary tests; see BinRecorder.v3. + if (arg != null && Strings.startsWith(arg, RECORD_BINARY)) { + if (arg.length == RECORD_BINARY.length) BinRecorder.dir = DEFAULT_RECORD_DIR; + else if (arg[RECORD_BINARY.length] == '=') BinRecorder.dir = Arrays.range(arg, RECORD_BINARY.length + 1, arg.length); + else continue; // not this option after all; let TraceOptions have it + args[i] = null; + continue; + } err.abs(u64.!(i)); if (TraceOptions.parse(args[i], err)) args[i] = null; } - return UnitTests.run(args); + var result = UnitTests.run(args); + BinRecorder.flush(); // write out the last test recorded + return result; } diff --git a/test/unittest/BinParserTest.v3 b/test/unittest/BinParserTest.v3 index 442bbced5..4f0819cbd 100644 --- a/test/unittest/BinParserTest.v3 +++ b/test/unittest/BinParserTest.v3 @@ -118,6 +118,7 @@ class BinParserTester(t: Tester) { var limits = Limits.new(); var test_split: bool = false; var validate_code = false; + def trial = Vector.new(); // bytes pushed into the parser under construction def valid(raw: Array) -> Module { return validN(raw, 0, raw.length); } @@ -131,8 +132,8 @@ class BinParserTester(t: Tester) { var last: Module; for (i < length) { var m = mp(); - m.push(raw, pos, i); - m.push(raw, pos + i, length - i); + push(m, raw, pos, i); + push(m, raw, pos + i, length - i); last = assert_valid(m); if (last == null) return null; } @@ -140,7 +141,7 @@ class BinParserTester(t: Tester) { } // Test only a complete module. var m = mp(); - m.push(raw, pos, length); + push(m, raw, pos, length); return assert_valid(m); } def invalid(expected: WasmError, raw: Array) { @@ -156,18 +157,19 @@ class BinParserTester(t: Tester) { // Test split modules at every offset. for (i < length) { var m = mp(); - m.push(raw, pos, i); - m.push(raw, pos + i, length - i); + push(m, raw, pos, i); + push(m, raw, pos + i, length - i); if (!assert_invalid(expected, m)) return; } return; } // Test only a complete module. var m = mp(); - m.push(raw, pos, length); + push(m, raw, pos, length); assert_invalid(expected, m); } def assert_invalid(expected: WasmError, m: BinParser) -> bool { + BinRecorder.record(t.name, trial.copy(), expected, extensions); var module = m.finish(); var e = m.err; if (e.error()) { @@ -182,6 +184,7 @@ class BinParserTester(t: Tester) { return false; } def assert_valid(m: BinParser) -> Module { + BinRecorder.record(t.name, trial.copy(), WasmError.NONE, extensions); var module = m.finish(); var e = m.err; if (e.error()) { @@ -203,7 +206,17 @@ class BinParserTester(t: Tester) { if (!expected.isAssignableSig(got)) return t.fail2("expected sig %q, got %q", expected.render, got.render); if (!got.isAssignableSig(expected)) return t.fail2("expected sig %q, got %q", expected.render, got.render); } + // Pushes bytes into {m}, recording them as part of the current trial. Every path that + // feeds a parser must go through here, or the recorded trial will be incomplete. + def pushAll(m: BinParser, r: (Array, int, int)) { + push(m, r.0, r.1, r.2); + } + def push(m: BinParser, raw: Array, pos: int, length: int) { + if (BinRecorder.enabled()) trial.puta(Ranges.dup(raw[pos ... pos + length])); + m.push(raw, pos, length); + } def mp() -> BinParser { + trial.resize(0); var err = ErrorGen.new("test"); var r = BinParser.new(extensions, limits, err, "test"); r.validate_code = validate_code; @@ -272,7 +285,7 @@ def test_buf_offset(t: BinParserTester) { for (i < (len * 2) + 1) { ArrayUtil.copyInto(buffer, i, VALID_HEADER, 0, len); var m = t.mp(); - m.push(buffer, i, len); + t.push(m, buffer, i, len); t.assert_valid(m); } } @@ -958,7 +971,7 @@ def testCountedSectionK(t: BinParserTester, max: int, sect: BpSection, // Test truncated module by up to {max} entries. for (cut = last; cut < raw.length; cut++) { var m = t.mp(); - m.push(raw, 0, cut); + t.push(m, raw, 0, cut); t.assert_invalid(WasmError.INCOMPLETE_SECTION, m); } @@ -973,7 +986,7 @@ def testCountedSectionK(t: BinParserTester, max: int, sect: BpSection, b.put(99); // extraneous byte b.endSection(); var m = t.mp(); - m.push(b.storage()); + t.pushAll(m, b.storage()); t.assert_invalid(WasmError.INCOMPLETE_SECTION, m); } } @@ -1029,7 +1042,7 @@ def test_funcsN(t: BinParserTester) { b.endSection(); // validate var m = t.mp(); - m.push(b.storage()); + t.pushAll(m, b.storage()); t.assert_invalid(WasmError.INCOMPLETE_SECTION, m); // overflow case @@ -1047,7 +1060,7 @@ def test_funcsN(t: BinParserTester) { b.endSection(); // validate m = t.mp(); - m.push(b.storage()); + t.pushAll(m, b.storage()); t.assert_invalid(WasmError.OVERFLOW_SECTION, m); } } diff --git a/test/unittest/BinRecorder.v3 b/test/unittest/BinRecorder.v3 new file mode 100644 index 000000000..351e021d4 --- /dev/null +++ b/test/unittest/BinRecorder.v3 @@ -0,0 +1,183 @@ +// Copyright 2026 Wizard authors. All rights reserved. +// See LICENSE for details of Apache 2.0 license. + +// Records every binary module that the binary-encoding unit tests decode, together with the +// result the test expects, and writes them out as .bin.wast files, one per unit test. The +// point is to externalize the internal tests: the same modules and expectations can then be +// run through the reference interpreter, or any other engine, to check that Wizard agrees +// with them. Enabled with --record-binary[=] on the unittest binary. +// +// The specification splits module rejection into two phases, decoding and validation, and +// the reference interpreter distinguishes them: assert_malformed accepts only a decoding +// error and assert_invalid only a validation error. Wizard's {WasmError} codes do not carry +// the phase, so {phaseOf} maps them, best effort. A wrong entry there shows up as a whole +// class of disagreements for one error code, which is easy to spot and fix in one place; +// see test/regress/binary/check.sh, which groups its report by error code. +enum RecordedPhase { + VALID, // the module is accepted + MALFORMED, // rejected while decoding + INVALID, // rejected while validating + ENGINE // rejected by an engine-specific limit; not externalizable +} + +def NONE_SET: Extension.set; +def NONSTANDARD = Extension.REPEAT_SECTIONS | Extension.LEGACY_EH | Extension.WIZENG; + +component BinRecorder { + var dir: string; // output directory, or null when recording is off + + private var name: string; // unit test currently being recorded + private var buf = StringBuilder.new(); + private var trials: int; // trials recorded for the current test + private var skipped: int; // engine-specific trials dropped + private var prev: Array; // previous trial, to suppress duplicates + + def enabled() -> bool { + return dir != null; + } + // Record one trial of {test} over {bytes}. {expected} is the error the test requires, + // or {WasmError.NONE} if the module is expected to decode. + def record(test: string, bytes: Array, expected: WasmError, extensions: Extension.set) { + if (dir == null) return; + if (name == null || !Strings.equal(name, test)) { + flush(); + name = test; + trials = 0; + skipped = 0; + prev = null; + header(); + } + // A test that splits a module at every offset re-runs the same bytes many times. + if (prev != null && Arrays.equal(prev, bytes)) return; + prev = bytes; + + // Extensions the specification does not define; a module needing one of these cannot + // be expected to decode anywhere else. + var nonstandard = extensions & NONSTANDARD; + var phase = if(nonstandard != NONE_SET, RecordedPhase.ENGINE, phaseOf(expected)); + if (phase == RecordedPhase.ENGINE) { + // The reference interpreter has no such limit, so it would decode this module + // happily. Note it rather than emitting a test that is guaranteed to disagree. + skipped++; + if (nonstandard != NONE_SET) { + buf.put1(";; skipped: needs the non-standard extension(s) %s", + renderExtensions(nonstandard)).ln(); + } else { + buf.put1(";; skipped: %s is an engine-specific limit", expected.name).ln(); + } + return; + } + trials++; + buf.put3(";; unittest %s[%d]: %s", test, trials, phase.name); + if (expected != WasmError.NONE) buf.put1(" %s", expected.name); + buf.put1(" [%s]", renderExtensions(extensions)).ln(); + + var indent = if(phase == RecordedPhase.VALID, "", " "); + match (phase) { + // A plain (module binary ...) is instantiated, which the binary tests never do: + // they stop after decoding. Use the "definition" form, which decodes and + // validates without linking, so that a module with unresolved imports is not + // reported as a difference. + VALID => ; + MALFORMED => buf.puts("(assert_malformed").ln(); + INVALID => buf.puts("(assert_invalid").ln(); + ENGINE => ; + } + putModule(indent, bytes, phase == RecordedPhase.VALID); + if (phase != RecordedPhase.VALID) { + // The expected message is left empty, which the reference interpreter treats as + // matching any message. Wizard's error codes are not the specification's message + // texts, so asserting on them would report a difference for every single trial. + // What is worth cross-checking is the phase, which the assertion above encodes; + // the code is in the comment for triage. + buf.puts(" \"\"").ln(); + buf.puts(")").ln(); + } + buf.ln(); + } + // Write out the file for the test being recorded, if any. + def flush() { + if (name == null) return; + var path = Strings.format2("%s/%s.bin.wast", dir, fileName(name)); + var fd = System.fileOpen(path, false); + if (fd < 0) { + Trace.OUT.put1("could not write %s (does the directory exist?)", path).ln(); + } else { + buf.out(System.fileWriteK(fd, _, _, _)); + System.fileClose(fd); + Trace.OUT.put3("recorded %s (%d trials, %d skipped)", path, trials, skipped).ln(); + } + buf.reset(); + name = null; + } + private def header() { + buf.puts(";; generated by test/regress/binary/record.sh; do not edit").ln(); + buf.ln(); + } + private def putModule(indent: string, bytes: Array, definition: bool) { + buf.puts(indent).puts(if(definition, "(module definition binary", "(module binary")).ln(); + for (i = 0; i < bytes.length; i = i + 16) { + buf.puts(indent).puts(" \""); + for (j = i; j < bytes.length && j < i + 16; j++) { + var b = bytes[j]; + buf.putc('\\'); + buf.putc(Chars.hexMap_l[b >> 4]); + buf.putc(Chars.hexMap_l[b & 0xF]); + } + buf.puts("\"").ln(); + } + buf.puts(indent).puts(")").ln(); + } + // Turns a unit test name like "bin:sect_dup" into a file name. + private def fileName(test: string) -> string { + var r = Arrays.dup(test); + for (i < r.length) if (r[i] == ':') r[i] = '_'; + return r; + } + private def renderExtensions(extensions: Extension.set) -> string { + var b = StringBuilder.new(); + for (e in extensions) { + if (b.length > 0) b.sp(); + b.puts(e.short_name); + } + if (b.length == 0) b.puts("none"); + return b.toString(); + } + // Which phase of the specification rejects a module for {code}. Best effort; see the + // comment at the top of this file. + def phaseOf(code: WasmError) -> RecordedPhase { + match (code) { + NONE => return RecordedPhase.VALID; + + // Limits that the specification does not impose; the engine chose them. + EXCEEDED_LIMIT => return RecordedPhase.ENGINE; + + // Rejected only after the module has been decoded. + OOB_INDEX, + DUPLICATE_EXPORT, + INVALID_INIT_EXPR, + ILLEGAL_TYPE, + ILLEGAL_SUPERTYPE, + INVALID_TAG_SIGNATURE, + ILLEGAL_BLOCK_TYPE, + ILLEGAL_SELECT_COUNT, + ILLEGAL_ASSIGNMENT, + ILLEGAL_FUNCREF, + ILLEGAL_CAST, + TYPE_MISMATCH, + MISMATCHED_ELSE, + MISMATCHED_CATCH, + MISMATCHED_DELEGATE, + UNTERMINATED_BODY, + OOB_LABEL, + ILLEGAL_ALIGNMENT, + ILLEGAL_LANE, + MISSING_DATA_COUNT, + UNINIT_LOCAL, + RETHROW_NOT_IN_CATCH => return RecordedPhase.INVALID; + + // Everything else is a decoding error. + _ => return RecordedPhase.MALFORMED; + } + } +}