From b259dfbe82a59100747adf1e492f0ca16b4f2859 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Apr 2026 07:26:54 -0700 Subject: [PATCH 1/2] Update spec test suite submodule * Add support for `assert_{invalid,malformed}_custom` directives * Shuffle around how `@custom` is printed to improve round-trip-ability * Disallow multiple `@metadata.branch_hint` annotations on one instruction. * Skip a custom-page-sizes test for now until the test upstream is updated. * Adjust the `name` section emitted during text-to-binary to happen after user-specified `@custom` sections to make round-tripping work. --- ci/generate-spec-tests.rs | 5 + crates/json-from-wast/src/build.rs | 26 + crates/json-from-wast/src/lib.rs | 16 + crates/wasmprinter/src/lib.rs | 71 +- crates/wast/src/core/binary.rs | 2 +- crates/wast/src/core/expr.rs | 14 +- crates/wast/src/lib.rs | 2 + crates/wast/src/wast.rs | 30 + src/bin/wasm-tools/wast.rs | 29 + .../branch-hinting/branch-hinting-simple.wast | 30 +- tests/cli/folding/branch-hinting-simple.wast | 11 - tests/cli/spec/custom/branch_hint.wast | 6 + tests/cli/spec/custom/custom_annot.wast | 6 + tests/cli/spec/custom/name_annot.wast | 6 + ...om-page-sizes-invalid.wast => binary.wast} | 3 +- .../branch-hinting-simple.wast.json | 18 +- .../{6.print => 8.print} | 2 + .../branch-hinting-simple.wast/6.print | 1 + .../branch-hinting-simple.wast/6.print-folded | 1 + .../testsuite/array_init_elem.wast.json | 283 +++++- .../testsuite/array_init_elem.wast/23.print | 33 + .../testsuite/array_init_elem.wast/3.print | 70 +- .../testsuite/array_init_elem.wast/34.print | 32 + .../testsuite/array_new_elem.wast.json | 21 + .../testsuite/array_new_elem.wast/22.print | 24 + .../testsuite/custom/branch_hint.wast.json | 32 + .../testsuite/custom/branch_hint.wast/0.print | 85 ++ .../testsuite/custom/branch_hint.wast/3.print | 12 + .../testsuite/custom/custom_annot.wast.json | 123 +++ .../custom/custom_annot.wast/0.print | 16 + .../custom/custom_annot.wast/1.print | 3 + .../custom/custom_annot.wast/2.print | 3 + .../testsuite/custom/name_annot.wast.json | 51 + .../testsuite/custom/name_annot.wast/0.print | 1 + .../testsuite/custom/name_annot.wast/1.print | 1 + .../testsuite/custom/name_annot.wast/5.print | 5 + .../testsuite/custom/name_annot.wast/6.print | 5 + tests/snapshots/testsuite/loop.wast.json | 253 ++--- tests/snapshots/testsuite/loop.wast/0.print | 17 + .../custom-page-sizes/binary.wast.json | 876 ++++++++++++++++++ .../custom-page-sizes/binary.wast/0.print | 1 + .../custom-page-sizes/binary.wast/1.print | 1 + .../custom-page-sizes/binary.wast/100.print | 12 + .../custom-page-sizes/binary.wast/102.print | 5 + .../custom-page-sizes/binary.wast/2.print | 1 + .../custom-page-sizes/binary.wast/3.print | 1 + .../custom-page-sizes/binary.wast/45.print | 6 + .../custom-page-sizes/binary.wast/50.print | 1 + .../custom-page-sizes/binary.wast/51.print | 1 + .../custom-page-sizes/binary.wast/55.print | 1 + .../custom-page-sizes/binary.wast/60.print | 7 + .../custom-page-sizes/binary.wast/61.print | 7 + .../custom-page-sizes/binary.wast/62.print | 1 + .../custom-page-sizes/binary.wast/65.print | 3 + .../custom-page-sizes/binary.wast/74.print | 1 + .../custom-page-sizes/binary.wast/79.print | 1 + .../custom-page-sizes/binary.wast/85.print | 1 + .../custom-page-sizes/binary.wast/88.print | 5 + .../custom-page-sizes/binary.wast/91.print | 5 + .../custom-page-sizes/binary.wast/95.print | 3 + .../custom-page-sizes-invalid.wast.json | 165 ---- .../custom-page-sizes-invalid.wast/19.print | 6 - .../custom-page-sizes-invalid.wast/21.print | 3 - .../custom-page-sizes-invalid.wast/22.print | 3 - .../custom-page-sizes/memory_max.wast.json | 26 +- .../custom-page-sizes/memory_max.wast/3.print | 4 +- .../custom-page-sizes/memory_max.wast/4.print | 5 + .../custom-page-sizes/memory_max.wast/5.print | 3 + .../memory_max_i64.wast.json | 28 +- .../memory_max_i64.wast/2.print | 2 +- .../memory_max_i64.wast/3.print | 4 +- .../memory_max_i64.wast/4.print | 5 + .../memory_max_i64.wast/5.print | 3 + .../testsuite/relaxed_madd_nmadd.wast.json | 28 +- tests/snapshots/testsuite/simd_lane.wast.json | 16 +- .../snapshots/testsuite/table_init.wast.json | 21 + .../testsuite/table_init.wast/780.print | 22 + tests/snapshots/testsuite/try_table.wast.json | 36 + .../testsuite/try_table.wast/64.print | 26 + .../testsuite/type-subtyping.wast.json | 404 ++++---- .../testsuite/type-subtyping.wast/100.print | 11 + .../{110.print => 122.print} | 0 .../{17.print => 29.print} | 0 .../testsuite/type-subtyping.wast/30.print | 33 - .../testsuite/type-subtyping.wast/34.print | 26 - .../testsuite/type-subtyping.wast/36.print | 26 - .../{25.print => 37.print} | 0 .../testsuite/type-subtyping.wast/38.print | 26 - .../testsuite/type-subtyping.wast/40.print | 22 - .../testsuite/type-subtyping.wast/42.print | 55 +- .../testsuite/type-subtyping.wast/44.print | 30 - .../testsuite/type-subtyping.wast/46.print | 50 +- .../testsuite/type-subtyping.wast/48.print | 28 +- .../testsuite/type-subtyping.wast/50.print | 28 +- .../testsuite/type-subtyping.wast/52.print | 27 +- .../testsuite/type-subtyping.wast/54.print | 35 +- .../testsuite/type-subtyping.wast/55.print | 10 - .../testsuite/type-subtyping.wast/56.print | 28 +- .../testsuite/type-subtyping.wast/58.print | 50 +- .../testsuite/type-subtyping.wast/60.print | 19 +- .../testsuite/type-subtyping.wast/62.print | 22 +- .../testsuite/type-subtyping.wast/64.print | 20 +- .../testsuite/type-subtyping.wast/65.print | 16 - .../testsuite/type-subtyping.wast/66.print | 15 + .../testsuite/type-subtyping.wast/67.print | 13 +- .../testsuite/type-subtyping.wast/68.print | 14 +- .../{57.print => 69.print} | 0 .../testsuite/type-subtyping.wast/70.print | 15 +- .../testsuite/type-subtyping.wast/71.print | 16 - .../{61.print => 72.print} | 2 +- .../testsuite/type-subtyping.wast/73.print | 16 +- .../testsuite/type-subtyping.wast/74.print | 20 +- .../testsuite/type-subtyping.wast/76.print | 17 +- .../testsuite/type-subtyping.wast/77.print | 20 +- .../testsuite/type-subtyping.wast/79.print | 17 +- .../testsuite/type-subtyping.wast/80.print | 26 +- .../testsuite/type-subtyping.wast/82.print | 25 +- .../testsuite/type-subtyping.wast/83.print | 16 +- .../testsuite/type-subtyping.wast/85.print | 14 +- .../testsuite/type-subtyping.wast/86.print | 20 +- .../testsuite/type-subtyping.wast/88.print | 19 +- .../testsuite/type-subtyping.wast/89.print | 18 + .../testsuite/type-subtyping.wast/91.print | 14 + .../testsuite/type-subtyping.wast/92.print | 26 + .../testsuite/type-subtyping.wast/94.print | 26 + .../testsuite/type-subtyping.wast/95.print | 12 + .../testsuite/type-subtyping.wast/97.print | 7 + .../testsuite/type-subtyping.wast/98.print | 16 + tests/testsuite | 2 +- 129 files changed, 2980 insertions(+), 1087 deletions(-) create mode 100644 tests/cli/spec/custom/branch_hint.wast create mode 100644 tests/cli/spec/custom/custom_annot.wast create mode 100644 tests/cli/spec/custom/name_annot.wast rename tests/cli/spec/proposals/custom-page-sizes/{custom-page-sizes-invalid.wast => binary.wast} (62%) rename tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/{6.print => 8.print} (70%) create mode 100644 tests/snapshots/testsuite/array_init_elem.wast/23.print create mode 100644 tests/snapshots/testsuite/array_init_elem.wast/34.print create mode 100644 tests/snapshots/testsuite/array_new_elem.wast/22.print create mode 100644 tests/snapshots/testsuite/custom/branch_hint.wast.json create mode 100644 tests/snapshots/testsuite/custom/branch_hint.wast/0.print create mode 100644 tests/snapshots/testsuite/custom/branch_hint.wast/3.print create mode 100644 tests/snapshots/testsuite/custom/custom_annot.wast.json create mode 100644 tests/snapshots/testsuite/custom/custom_annot.wast/0.print create mode 100644 tests/snapshots/testsuite/custom/custom_annot.wast/1.print create mode 100644 tests/snapshots/testsuite/custom/custom_annot.wast/2.print create mode 100644 tests/snapshots/testsuite/custom/name_annot.wast.json create mode 100644 tests/snapshots/testsuite/custom/name_annot.wast/0.print create mode 100644 tests/snapshots/testsuite/custom/name_annot.wast/1.print create mode 100644 tests/snapshots/testsuite/custom/name_annot.wast/5.print create mode 100644 tests/snapshots/testsuite/custom/name_annot.wast/6.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast.json create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/0.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/1.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/100.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/102.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/2.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/3.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/45.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/50.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/51.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/55.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/60.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/61.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/62.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/65.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/74.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/79.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/85.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/88.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/91.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/95.print delete mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast.json delete mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/19.print delete mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/21.print delete mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/22.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/4.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/5.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/4.print create mode 100644 tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/5.print create mode 100644 tests/snapshots/testsuite/table_init.wast/780.print create mode 100644 tests/snapshots/testsuite/try_table.wast/64.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/100.print rename tests/snapshots/testsuite/type-subtyping.wast/{110.print => 122.print} (100%) rename tests/snapshots/testsuite/type-subtyping.wast/{17.print => 29.print} (100%) delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/30.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/34.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/36.print rename tests/snapshots/testsuite/type-subtyping.wast/{25.print => 37.print} (100%) delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/38.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/40.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/44.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/55.print delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/65.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/66.print rename tests/snapshots/testsuite/type-subtyping.wast/{57.print => 69.print} (100%) delete mode 100644 tests/snapshots/testsuite/type-subtyping.wast/71.print rename tests/snapshots/testsuite/type-subtyping.wast/{61.print => 72.print} (60%) create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/89.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/91.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/92.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/94.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/95.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/97.print create mode 100644 tests/snapshots/testsuite/type-subtyping.wast/98.print diff --git a/ci/generate-spec-tests.rs b/ci/generate-spec-tests.rs index e50788cfcb..d882586e56 100644 --- a/ci/generate-spec-tests.rs +++ b/ci/generate-spec-tests.rs @@ -40,6 +40,11 @@ fn copy_test(src: &Path, dst: &Path) { return; } + // FIXME(WebAssembly/custom-page-sizes#58) + if src.ends_with("proposals/custom-page-sizes/custom-page-sizes-invalid.wast") { + return; + } + let directive = match dst.file_name().and_then(|s| s.to_str()) { // Disable tests by doing something like: // Some("exact-func-import.wast") => "FAIL", diff --git a/crates/json-from-wast/src/build.rs b/crates/json-from-wast/src/build.rs index 01242575e3..1e635710b5 100644 --- a/crates/json-from-wast/src/build.rs +++ b/crates/json-from-wast/src/build.rs @@ -103,6 +103,19 @@ impl<'a> JsonBuilder<'a, '_> { file, } } + WastDirective::AssertMalformedCustom { + span: _, + module, + message, + } => { + let line = self.lineno(module.span()); + let (_name, file) = self.emit_file(module, true)?; + crate::Command::AssertMalformedCustom { + line, + text: message.into(), + file, + } + } WastDirective::AssertInvalid { span: _, module, @@ -116,6 +129,19 @@ impl<'a> JsonBuilder<'a, '_> { file, } } + WastDirective::AssertInvalidCustom { + span: _, + module, + message, + } => { + let line = self.lineno(module.span()); + let (_name, file) = self.emit_file(module, false)?; + crate::Command::AssertInvalidCustom { + line, + text: message.into(), + file, + } + } WastDirective::Register { span: _, module, diff --git a/crates/json-from-wast/src/lib.rs b/crates/json-from-wast/src/lib.rs index 9f743aafe4..9f2fe11e5e 100644 --- a/crates/json-from-wast/src/lib.rs +++ b/crates/json-from-wast/src/lib.rs @@ -97,6 +97,13 @@ pub enum Command<'a> { #[serde(borrow)] text: Cow<'a, str>, }, + AssertMalformedCustom { + line: u32, + #[serde(borrow, flatten)] + file: WasmFile<'a>, + #[serde(borrow)] + text: Cow<'a, str>, + }, AssertInvalid { line: u32, #[serde(borrow, flatten)] @@ -104,6 +111,13 @@ pub enum Command<'a> { #[serde(borrow)] text: Cow<'a, str>, }, + AssertInvalidCustom { + line: u32, + #[serde(borrow, flatten)] + file: WasmFile<'a>, + #[serde(borrow)] + text: Cow<'a, str>, + }, Register { line: u32, #[serde(borrow, skip_serializing_if = "Option::is_none")] @@ -197,7 +211,9 @@ impl Command<'_> { | ModuleDefinition { line, .. } | ModuleInstance { line, .. } | AssertMalformed { line, .. } + | AssertMalformedCustom { line, .. } | AssertInvalid { line, .. } + | AssertInvalidCustom { line, .. } | Register { line, .. } | AssertUnlinkable { line, .. } | AssertUninstantiable { line, .. } diff --git a/crates/wasmprinter/src/lib.rs b/crates/wasmprinter/src/lib.rs index 0ba5fab624..aad088436b 100644 --- a/crates/wasmprinter/src/lib.rs +++ b/crates/wasmprinter/src/lib.rs @@ -165,14 +165,7 @@ struct State { core: CoreState, #[cfg(feature = "component-model")] component: ComponentState, - custom_section_place: Option<(&'static str, usize)>, - // `custom_section_place` stores the text representation of the location where - // a custom section should be serialized in the binary format. - // The tuple elements are a str (e.g. "after elem") and the line number - // where the custom section place was set. `update_custom_section_place` won't - // update the custom section place unless the line number changes; this prevents - // printing a place "after xxx" where the xxx section doesn't appear in the text format - // (e.g. because it was present but empty in the binary format). + custom_section_place: Option<&'static str>, } impl State { @@ -485,8 +478,7 @@ impl Printer<'_, '_> { match encoding { Encoding::Module => { states.push(State::new(Encoding::Module)); - states.last_mut().unwrap().custom_section_place = - Some(("before first", self.line)); + states.last_mut().unwrap().custom_section_place = Some("before first"); if states.len() > 1 { self.start_group("core module")?; } else { @@ -546,7 +538,6 @@ impl Printer<'_, '_> { self.result .print_custom_section(c.name(), c.data_offset(), c.data())?; if printed { - self.update_custom_section_line(&mut states); continue; } @@ -589,16 +580,19 @@ impl Printer<'_, '_> { } } assert!(self.nesting == start); - self.update_custom_section_line(&mut states); } Payload::TypeSection(s) => { + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after type"); + } self.print_types(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after type"); } Payload::ImportSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after import"); + } self.print_imports(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after import"); } Payload::FunctionSection(reader) => { Self::ensure_module(&states)?; @@ -609,35 +603,47 @@ impl Printer<'_, '_> { MAX_WASM_FUNCTIONS ); } + if reader.count() > 0 { + self.update_custom_section_place(&mut states, "after func"); + } for ty in reader { states.last_mut().unwrap().core.func_to_type.push(Some(ty?)) } - self.update_custom_section_place(&mut states, "after func"); } Payload::TableSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after table"); + } self.print_tables(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after table"); } Payload::MemorySection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after memory"); + } self.print_memories(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after memory"); } Payload::TagSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after tag"); + } self.print_tags(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after tag"); } Payload::GlobalSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after global"); + } self.print_globals(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after global"); } Payload::ExportSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after export"); + } self.print_exports(states.last().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after export"); } Payload::StartSection { func, range } => { Self::ensure_module(&states)?; @@ -649,8 +655,10 @@ impl Printer<'_, '_> { } Payload::ElementSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after elem"); + } self.print_elems(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after elem"); } Payload::CodeSectionStart { .. } => { Self::ensure_module(&states)?; @@ -669,8 +677,10 @@ impl Printer<'_, '_> { } Payload::DataSection(s) => { Self::ensure_module(&states)?; + if s.count() > 0 { + self.update_custom_section_place(&mut states, "after data"); + } self.print_data(states.last_mut().unwrap(), s)?; - self.update_custom_section_place(&mut states, "after data"); } #[cfg(feature = "component-model")] @@ -774,19 +784,8 @@ impl Printer<'_, '_> { fn update_custom_section_place(&self, states: &mut Vec, place: &'static str) { if let Some(last) = states.last_mut() { - if let Some((prev, prev_line)) = &mut last.custom_section_place { - if *prev_line != self.line { - *prev = place; - *prev_line = self.line; - } - } - } - } - - fn update_custom_section_line(&self, states: &mut Vec) { - if let Some(last) = states.last_mut() { - if let Some((_, prev_line)) = &mut last.custom_section_place { - *prev_line = self.line; + if let Some(prev) = &mut last.custom_section_place { + *prev = place; } } } @@ -1997,7 +1996,7 @@ impl Printer<'_, '_> { self.newline(section.range().start)?; self.start_group("@custom ")?; self.print_str(section.name())?; - if let Some((place, _)) = state.custom_section_place { + if let Some(place) = state.custom_section_place { write!(self.result, " ({place})")?; } self.result.write_str(" ")?; diff --git a/crates/wast/src/core/binary.rs b/crates/wast/src/core/binary.rs index 903cee486a..adcb786804 100644 --- a/crates/wast/src/core/binary.rs +++ b/crates/wast/src/core/binary.rs @@ -188,10 +188,10 @@ pub(crate) fn encode( e.typed_section(&data); + e.custom_sections(AfterLast); if !names.is_empty() { e.wasm.section(&names.to_name_section()); } - e.custom_sections(AfterLast); if let Some(dwarf) = &mut dwarf { dwarf.emit(&mut e); } diff --git a/crates/wast/src/core/expr.rs b/crates/wast/src/core/expr.rs index 9a52c850f0..45216daa7a 100644 --- a/crates/wast/src/core/expr.rs +++ b/crates/wast/src/core/expr.rs @@ -383,10 +383,16 @@ impl<'a> ExpressionParser<'a> { _ => return Err(parser.error("invalid value for branch hint")), }; - self.branch_hints.push(BranchHint { - instr_index: self.raw_instrs.len(), - value, - }); + let instr_index = self.raw_instrs.len(); + if let Some(prev) = self.branch_hints.last() { + if prev.instr_index == instr_index { + return Err( + parser.error("@metadata.code.branch_hint annotation: duplicate annotation") + ); + } + } + + self.branch_hints.push(BranchHint { instr_index, value }); Ok(()) } diff --git a/crates/wast/src/lib.rs b/crates/wast/src/lib.rs index fae6ccc1ba..be157314f4 100644 --- a/crates/wast/src/lib.rs +++ b/crates/wast/src/lib.rs @@ -396,7 +396,9 @@ pub mod kw { custom_keyword!(assert_exception); custom_keyword!(assert_exhaustion); custom_keyword!(assert_invalid); + custom_keyword!(assert_invalid_custom); custom_keyword!(assert_malformed); + custom_keyword!(assert_malformed_custom); custom_keyword!(assert_return); custom_keyword!(assert_trap); custom_keyword!(assert_unlinkable); diff --git a/crates/wast/src/wast.rs b/crates/wast/src/wast.rs index 81c48990e0..1f4e14dd38 100644 --- a/crates/wast/src/wast.rs +++ b/crates/wast/src/wast.rs @@ -94,6 +94,13 @@ pub enum WastDirective<'a> { message: &'a str, }, + /// Asserts the module has an invalid custom section. + AssertInvalidCustom { + span: Span, + module: QuoteWat<'a>, + message: &'a str, + }, + /// Registers the `module` instance with the given `name` to be available /// for importing in future module instances. Register { @@ -149,6 +156,13 @@ pub enum WastDirective<'a> { /// Waits for the specified thread to exit. Wait { span: Span, thread: Id<'a> }, + + /// Asserts that a custom section of `module` is malformed. + AssertMalformedCustom { + span: Span, + module: QuoteWat<'a>, + message: &'a str, + }, } impl WastDirective<'_> { @@ -163,12 +177,14 @@ impl WastDirective<'_> { | WastDirective::ModuleDefinition(QuoteWat::QuoteComponent(span, _)) => *span, WastDirective::ModuleInstance { span, .. } | WastDirective::AssertMalformed { span, .. } + | WastDirective::AssertMalformedCustom { span, .. } | WastDirective::Register { span, .. } | WastDirective::AssertTrap { span, .. } | WastDirective::AssertReturn { span, .. } | WastDirective::AssertExhaustion { span, .. } | WastDirective::AssertUnlinkable { span, .. } | WastDirective::AssertInvalid { span, .. } + | WastDirective::AssertInvalidCustom { span, .. } | WastDirective::AssertException { span, .. } | WastDirective::AssertSuspension { span, .. } | WastDirective::Wait { span, .. } => *span, @@ -190,6 +206,13 @@ impl<'a> Parse<'a> for WastDirective<'a> { module: parser.parens(|p| p.parse())?, message: parser.parse()?, }) + } else if l.peek::()? { + let span = parser.parse::()?.0; + Ok(WastDirective::AssertMalformedCustom { + span, + module: parser.parens(|p| p.parse())?, + message: parser.parse()?, + }) } else if l.peek::()? { let span = parser.parse::()?.0; Ok(WastDirective::AssertInvalid { @@ -197,6 +220,13 @@ impl<'a> Parse<'a> for WastDirective<'a> { module: parser.parens(|p| p.parse())?, message: parser.parse()?, }) + } else if l.peek::()? { + let span = parser.parse::()?.0; + Ok(WastDirective::AssertInvalidCustom { + span, + module: parser.parens(|p| p.parse())?, + message: parser.parse()?, + }) } else if l.peek::()? { let span = parser.parse::()?.0; Ok(WastDirective::Register { diff --git a/src/bin/wasm-tools/wast.rs b/src/bin/wasm-tools/wast.rs index a712137b15..a4fc836cd0 100644 --- a/src/bin/wasm-tools/wast.rs +++ b/src/bin/wasm-tools/wast.rs @@ -267,6 +267,20 @@ impl Opts { bail!("encoded and parsed successfully but should have failed with: {message:?}",) } + WastDirective::AssertMalformedCustom { + span, + mut module, + message, + } => match module.encode() { + Ok(_) => { + bail!( + "expected module to have a malformed custom section but parsed successfully" + ) + } + Err(e) => { + self.assert_error_matches(test, &e.to_string(), message)?; + } + }, WastDirective::AssertInvalid { mut module, message, @@ -297,6 +311,21 @@ impl Opts { } } + WastDirective::AssertInvalidCustom { + mut module, + message, + span: _, + } => { + let binary_wasm = module.encode()?; + let mut test_path = test.to_path_buf(); + test_path.push(idx.to_string()); + self.test_wasm(&test_path, &binary_wasm, true)?; + + // NB: validity of custom sections is deferred to runtimes for + // now so this doesn't actually test anything about the custom + // section. + } + WastDirective::Thread(thread) => { for (i, directive) in thread.directives.into_iter().enumerate() { self.test_wast_directive(test, directive, idx * 1000 + i)?; diff --git a/tests/cli/branch-hinting/branch-hinting-simple.wast b/tests/cli/branch-hinting/branch-hinting-simple.wast index 9bbac9eb31..ddde59302c 100644 --- a/tests/cli/branch-hinting/branch-hinting-simple.wast +++ b/tests/cli/branch-hinting/branch-hinting-simple.wast @@ -1,4 +1,4 @@ -;; RUN: wast --assert default --snapshot tests/snapshots % +;; RUN: wast --assert default,no-test-folded --snapshot tests/snapshots % (module (func $main (result i32) @@ -70,28 +70,36 @@ (module quote "(func (@metadata.code.branch_hint \"a\"))") "invalid value for branch hint") -;; make sure this at least doesn't crash. Should perhaps be an error? +(assert_malformed + (module quote + "(func" + "(@metadata.code.branch_hint \"\\00\")" + "(@metadata.code.branch_hint \"\\01\")" + ")" + ) + "duplicate annotation") +(assert_malformed + (module quote + "(func" + "(@metadata.code.branch_hint \"\\00\")" + "(@metadata.code.branch_hint \"\\00\")" + "i32.const 0" + ")" + ) + "duplicate annotation") + (module (func (@metadata.code.branch_hint "\00")) (func - (@metadata.code.branch_hint "\00") (@metadata.code.branch_hint "\01") ) (func - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") (@metadata.code.branch_hint "\00") i32.const 0 (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") if (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") end (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") ) ) diff --git a/tests/cli/folding/branch-hinting-simple.wast b/tests/cli/folding/branch-hinting-simple.wast index e564064194..985a0ff0ec 100644 --- a/tests/cli/folding/branch-hinting-simple.wast +++ b/tests/cli/folding/branch-hinting-simple.wast @@ -74,24 +74,13 @@ (module (func (@metadata.code.branch_hint "\00")) (func - (@metadata.code.branch_hint "\00") (@metadata.code.branch_hint "\01") ) (func - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") (@metadata.code.branch_hint "\00") i32.const 0 (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") if - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") end - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") - (@metadata.code.branch_hint "\00") ) ) diff --git a/tests/cli/spec/custom/branch_hint.wast b/tests/cli/spec/custom/branch_hint.wast new file mode 100644 index 0000000000..0f1f6382f1 --- /dev/null +++ b/tests/cli/spec/custom/branch_hint.wast @@ -0,0 +1,6 @@ +;; RUN: wast \ +;; --assert default \ +;; --snapshot tests/snapshots \ +;; --ignore-error-messages \ +;; --features=wasm3 \ +;; tests/testsuite/custom/branch_hint.wast diff --git a/tests/cli/spec/custom/custom_annot.wast b/tests/cli/spec/custom/custom_annot.wast new file mode 100644 index 0000000000..5b7fec3fe8 --- /dev/null +++ b/tests/cli/spec/custom/custom_annot.wast @@ -0,0 +1,6 @@ +;; RUN: wast \ +;; --assert default \ +;; --snapshot tests/snapshots \ +;; --ignore-error-messages \ +;; --features=wasm3 \ +;; tests/testsuite/custom/custom_annot.wast diff --git a/tests/cli/spec/custom/name_annot.wast b/tests/cli/spec/custom/name_annot.wast new file mode 100644 index 0000000000..bbe6e3afb4 --- /dev/null +++ b/tests/cli/spec/custom/name_annot.wast @@ -0,0 +1,6 @@ +;; RUN: wast \ +;; --assert default \ +;; --snapshot tests/snapshots \ +;; --ignore-error-messages \ +;; --features=wasm3 \ +;; tests/testsuite/custom/name_annot.wast diff --git a/tests/cli/spec/proposals/custom-page-sizes/custom-page-sizes-invalid.wast b/tests/cli/spec/proposals/custom-page-sizes/binary.wast similarity index 62% rename from tests/cli/spec/proposals/custom-page-sizes/custom-page-sizes-invalid.wast rename to tests/cli/spec/proposals/custom-page-sizes/binary.wast index 2664cd5fac..395d15d42c 100644 --- a/tests/cli/spec/proposals/custom-page-sizes/custom-page-sizes-invalid.wast +++ b/tests/cli/spec/proposals/custom-page-sizes/binary.wast @@ -1,6 +1,7 @@ ;; RUN: wast \ ;; --assert default \ +;; --assert permissive \ ;; --snapshot tests/snapshots \ ;; --ignore-error-messages \ ;; --features=wasm3,custom-page-sizes \ -;; tests/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast +;; tests/testsuite/proposals/custom-page-sizes/binary.wast diff --git a/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast.json b/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast.json index c6248bc304..b1e2e9a138 100644 --- a/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast.json +++ b/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast.json @@ -41,9 +41,23 @@ "text": "invalid value for branch hint" }, { - "type": "module", + "type": "assert_malformed", "line": 74, - "filename": "branch-hinting-simple.6.wasm", + "filename": "branch-hinting-simple.6.wat", + "module_type": "text", + "text": "duplicate annotation" + }, + { + "type": "assert_malformed", + "line": 82, + "filename": "branch-hinting-simple.7.wat", + "module_type": "text", + "text": "duplicate annotation" + }, + { + "type": "module", + "line": 91, + "filename": "branch-hinting-simple.8.wasm", "module_type": "binary" } ] diff --git a/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/6.print b/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/8.print similarity index 70% rename from tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/6.print rename to tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/8.print index 6f748dbd11..ae5da9323b 100644 --- a/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/6.print +++ b/tests/snapshots/cli/branch-hinting/branch-hinting-simple.wast/8.print @@ -5,7 +5,9 @@ (func (;2;) (type 0) (@metadata.code.branch_hint "\00") i32.const 0 + (@metadata.code.branch_hint "\00") if ;; label = @1 + (@metadata.code.branch_hint "\00") end ) ) diff --git a/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print b/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print index 6f748dbd11..72e9c757e7 100644 --- a/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print +++ b/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print @@ -5,6 +5,7 @@ (func (;2;) (type 0) (@metadata.code.branch_hint "\00") i32.const 0 + (@metadata.code.branch_hint "\00") if ;; label = @1 end ) diff --git a/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print-folded b/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print-folded index a910aac983..d7448a71b2 100644 --- a/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print-folded +++ b/tests/snapshots/cli/folding/branch-hinting-simple.wast/6.print-folded @@ -6,6 +6,7 @@ (if ;; label = @1 (i32.const 0 (@metadata.code.branch_hint "\00")) + (@metadata.code.branch_hint "\00") (then)) ) ) diff --git a/tests/snapshots/testsuite/array_init_elem.wast.json b/tests/snapshots/testsuite/array_init_elem.wast.json index 04d091f3ea..2731db1b1f 100644 --- a/tests/snapshots/testsuite/array_init_elem.wast.json +++ b/tests/snapshots/testsuite/array_init_elem.wast.json @@ -30,7 +30,7 @@ }, { "type": "assert_trap", - "line": 78, + "line": 85, "action": { "type": "invoke", "field": "array_init_elem-null", @@ -40,7 +40,7 @@ }, { "type": "assert_trap", - "line": 81, + "line": 88, "action": { "type": "invoke", "field": "array_init_elem", @@ -63,7 +63,7 @@ }, { "type": "assert_trap", - "line": 82, + "line": 89, "action": { "type": "invoke", "field": "array_init_elem", @@ -86,7 +86,7 @@ }, { "type": "assert_trap", - "line": 85, + "line": 92, "action": { "type": "invoke", "field": "array_init_elem", @@ -109,7 +109,7 @@ }, { "type": "assert_trap", - "line": 86, + "line": 93, "action": { "type": "invoke", "field": "array_init_elem", @@ -132,7 +132,7 @@ }, { "type": "assert_return", - "line": 89, + "line": 96, "action": { "type": "invoke", "field": "array_init_elem", @@ -155,7 +155,7 @@ }, { "type": "assert_return", - "line": 90, + "line": 97, "action": { "type": "invoke", "field": "array_init_elem", @@ -178,7 +178,7 @@ }, { "type": "assert_trap", - "line": 93, + "line": 100, "action": { "type": "invoke", "field": "array_call_nth", @@ -193,7 +193,7 @@ }, { "type": "assert_trap", - "line": 94, + "line": 101, "action": { "type": "invoke", "field": "array_call_nth", @@ -208,7 +208,7 @@ }, { "type": "assert_trap", - "line": 95, + "line": 102, "action": { "type": "invoke", "field": "array_call_nth", @@ -223,7 +223,7 @@ }, { "type": "assert_trap", - "line": 96, + "line": 103, "action": { "type": "invoke", "field": "array_call_nth", @@ -238,7 +238,7 @@ }, { "type": "assert_return", - "line": 99, + "line": 106, "action": { "type": "invoke", "field": "array_init_elem", @@ -261,7 +261,7 @@ }, { "type": "assert_trap", - "line": 100, + "line": 107, "action": { "type": "invoke", "field": "array_call_nth", @@ -276,7 +276,7 @@ }, { "type": "assert_return", - "line": 101, + "line": 108, "action": { "type": "invoke", "field": "array_call_nth", @@ -287,11 +287,16 @@ } ] }, - "expected": [] + "expected": [ + { + "type": "i32", + "value": "3" + } + ] }, { "type": "assert_return", - "line": 102, + "line": 109, "action": { "type": "invoke", "field": "array_call_nth", @@ -302,11 +307,16 @@ } ] }, - "expected": [] + "expected": [ + { + "type": "i32", + "value": "4" + } + ] }, { "type": "assert_trap", - "line": 103, + "line": 110, "action": { "type": "invoke", "field": "array_call_nth", @@ -321,7 +331,7 @@ }, { "type": "assert_return", - "line": 106, + "line": 113, "action": { "type": "invoke", "field": "drop_segs", @@ -331,7 +341,7 @@ }, { "type": "assert_return", - "line": 107, + "line": 114, "action": { "type": "invoke", "field": "array_init_elem", @@ -354,7 +364,7 @@ }, { "type": "assert_trap", - "line": 108, + "line": 115, "action": { "type": "invoke", "field": "array_init_elem", @@ -374,6 +384,237 @@ ] }, "text": "out of bounds table access" + }, + { + "type": "module", + "line": 117, + "filename": "array_init_elem.4.wasm", + "module_type": "binary" + }, + { + "type": "assert_trap", + "line": 144, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "0" + } + ] + }, + "text": "null array reference" + }, + { + "type": "assert_trap", + "line": 145, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "1" + } + ] + }, + "text": "null array reference" + }, + { + "type": "assert_return", + "line": 148, + "action": { + "type": "invoke", + "field": "array_init_elem", + "args": [ + { + "type": "i32", + "value": "0" + }, + { + "type": "i32", + "value": "0" + }, + { + "type": "i32", + "value": "2" + } + ] + }, + "expected": [] + }, + { + "type": "assert_return", + "line": 149, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "0" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] + }, + { + "type": "assert_return", + "line": 150, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "1" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "2" + } + ] + }, + { + "type": "assert_return", + "line": 151, + "action": { + "type": "invoke", + "field": "array_eq_elems", + "args": [ + { + "type": "i32", + "value": "0" + }, + { + "type": "i32", + "value": "1" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "0" + } + ] + }, + { + "type": "assert_return", + "line": 154, + "action": { + "type": "invoke", + "field": "array_init_elem", + "args": [ + { + "type": "i32", + "value": "1" + }, + { + "type": "i32", + "value": "0" + }, + { + "type": "i32", + "value": "1" + } + ] + }, + "expected": [] + }, + { + "type": "assert_return", + "line": 155, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "0" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] + }, + { + "type": "assert_return", + "line": 156, + "action": { + "type": "invoke", + "field": "array_len_nth", + "args": [ + { + "type": "i32", + "value": "1" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] + }, + { + "type": "assert_return", + "line": 157, + "action": { + "type": "invoke", + "field": "array_eq_elems", + "args": [ + { + "type": "i32", + "value": "0" + }, + { + "type": "i32", + "value": "1" + } + ] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] + }, + { + "type": "module", + "line": 160, + "filename": "array_init_elem.5.wasm", + "module_type": "binary" + }, + { + "type": "assert_return", + "line": 178, + "action": { + "type": "invoke", + "field": "run", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] } ] } \ No newline at end of file diff --git a/tests/snapshots/testsuite/array_init_elem.wast/23.print b/tests/snapshots/testsuite/array_init_elem.wast/23.print new file mode 100644 index 0000000000..297b8d2135 --- /dev/null +++ b/tests/snapshots/testsuite/array_init_elem.wast/23.print @@ -0,0 +1,33 @@ +(module + (type $arrref_mut (;0;) (array (mut arrayref))) + (type (;1;) (func (param i32 i32 i32))) + (type (;2;) (func (param i32) (result i32))) + (type (;3;) (func (param i32 i32) (result i32))) + (global $g_arrref_mut (;0;) (ref $arrref_mut) i32.const 2 array.new_default $arrref_mut) + (export "array_init_elem" (func 0)) + (export "array_len_nth" (func 1)) + (export "array_eq_elems" (func 2)) + (elem $e1 (;0;) arrayref (item i32.const 1 array.new_default $arrref_mut) (item i32.const 2 array.new_default $arrref_mut)) + (func (;0;) (type 1) (param $1 i32) (param $2 i32) (param $3 i32) + global.get $g_arrref_mut + local.get $1 + local.get $2 + local.get $3 + array.init_elem $arrref_mut $e1 + ) + (func (;1;) (type 2) (param $n i32) (result i32) + global.get $g_arrref_mut + local.get $n + array.get $arrref_mut + array.len + ) + (func (;2;) (type 3) (param $i i32) (param $j i32) (result i32) + global.get $g_arrref_mut + local.get $i + array.get $arrref_mut + global.get $g_arrref_mut + local.get $j + array.get $arrref_mut + ref.eq + ) +) diff --git a/tests/snapshots/testsuite/array_init_elem.wast/3.print b/tests/snapshots/testsuite/array_init_elem.wast/3.print index 38bf0f2e68..0b7e7f03c4 100644 --- a/tests/snapshots/testsuite/array_init_elem.wast/3.print +++ b/tests/snapshots/testsuite/array_init_elem.wast/3.print @@ -1,42 +1,76 @@ (module - (type $t_f (;0;) (func)) - (type $arrref (;1;) (array (ref $t_f))) - (type $arrref_mut (;2;) (array (mut funcref))) - (type (;3;) (func (param i32))) + (type $arrref_mut (;0;) (array (mut funcref))) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32) (result i32))) + (type (;3;) (func)) (type (;4;) (func (param i32 i32 i32))) (table $t (;0;) 1 funcref) - (global $g_arrref (;0;) (ref $arrref) ref.func $dummy i32.const 12 array.new $arrref) - (global $g_arrref_mut (;1;) (ref $arrref_mut) i32.const 12 array.new_default $arrref_mut) - (export "array_call_nth" (func 1)) - (export "array_init_elem-null" (func 2)) - (export "array_init_elem" (func 3)) - (export "drop_segs" (func 4)) - (elem $e1 (;0;) func $dummy $dummy $dummy $dummy $dummy $dummy $dummy $dummy $dummy $dummy $dummy $dummy) - (func $dummy (;0;) (type $t_f)) - (func (;1;) (type 3) (param $1 i32) + (global $g_arrref_mut (;0;) (ref $arrref_mut) i32.const 12 array.new_default $arrref_mut) + (export "array_call_nth" (func 12)) + (export "array_init_elem-null" (func 13)) + (export "array_init_elem" (func 14)) + (export "drop_segs" (func 15)) + (elem $e1 (;0;) func $zero $one $two $three $four $five $six $seven $eight $nine $ten $eleven) + (func $zero (;0;) (type 1) (result i32) + i32.const 0 + ) + (func $one (;1;) (type 1) (result i32) + i32.const 1 + ) + (func $two (;2;) (type 1) (result i32) + i32.const 2 + ) + (func $three (;3;) (type 1) (result i32) + i32.const 3 + ) + (func $four (;4;) (type 1) (result i32) + i32.const 4 + ) + (func $five (;5;) (type 1) (result i32) + i32.const 5 + ) + (func $six (;6;) (type 1) (result i32) + i32.const 6 + ) + (func $seven (;7;) (type 1) (result i32) + i32.const 7 + ) + (func $eight (;8;) (type 1) (result i32) + i32.const 8 + ) + (func $nine (;9;) (type 1) (result i32) + i32.const 9 + ) + (func $ten (;10;) (type 1) (result i32) + i32.const 10 + ) + (func $eleven (;11;) (type 1) (result i32) + i32.const 11 + ) + (func (;12;) (type 2) (param $n i32) (result i32) i32.const 0 global.get $g_arrref_mut - local.get $1 + local.get $n array.get $arrref_mut table.set $t i32.const 0 - call_indirect (type $t_f) + call_indirect (type 1) ) - (func (;2;) (type $t_f) + (func (;13;) (type 3) ref.null $arrref_mut i32.const 0 i32.const 0 i32.const 0 array.init_elem $arrref_mut $e1 ) - (func (;3;) (type 4) (param $1 i32) (param $2 i32) (param $3 i32) + (func (;14;) (type 4) (param $1 i32) (param $2 i32) (param $3 i32) global.get $g_arrref_mut local.get $1 local.get $2 local.get $3 array.init_elem $arrref_mut $e1 ) - (func (;4;) (type $t_f) + (func (;15;) (type 3) elem.drop $e1 ) ) diff --git a/tests/snapshots/testsuite/array_init_elem.wast/34.print b/tests/snapshots/testsuite/array_init_elem.wast/34.print new file mode 100644 index 0000000000..a6337cd054 --- /dev/null +++ b/tests/snapshots/testsuite/array_init_elem.wast/34.print @@ -0,0 +1,32 @@ +(module + (type $arr (;0;) (array (mut arrayref))) + (type (;1;) (func (result i32))) + (export "run" (func 0)) + (elem $elem (;0;) arrayref (item i32.const 0 array.new_default $arr)) + (func (;0;) (type 1) (result i32) + (local $a (ref null $arr)) (local $b (ref null $arr)) + i32.const 1 + array.new_default $arr + local.set $a + local.get $a + i32.const 0 + i32.const 0 + i32.const 1 + array.init_elem $arr $elem + i32.const 1 + array.new_default $arr + local.set $b + local.get $b + i32.const 0 + i32.const 0 + i32.const 1 + array.init_elem $arr $elem + local.get $a + i32.const 0 + array.get $arr + local.get $b + i32.const 0 + array.get $arr + ref.eq + ) +) diff --git a/tests/snapshots/testsuite/array_new_elem.wast.json b/tests/snapshots/testsuite/array_new_elem.wast.json index 76e7e5a2e9..6c3b10cb91 100644 --- a/tests/snapshots/testsuite/array_new_elem.wast.json +++ b/tests/snapshots/testsuite/array_new_elem.wast.json @@ -398,6 +398,27 @@ "value": "204" } ] + }, + { + "type": "module", + "line": 106, + "filename": "array_new_elem.4.wasm", + "module_type": "binary" + }, + { + "type": "assert_return", + "line": 121, + "action": { + "type": "invoke", + "field": "run", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] } ] } \ No newline at end of file diff --git a/tests/snapshots/testsuite/array_new_elem.wast/22.print b/tests/snapshots/testsuite/array_new_elem.wast/22.print new file mode 100644 index 0000000000..4676e01323 --- /dev/null +++ b/tests/snapshots/testsuite/array_new_elem.wast/22.print @@ -0,0 +1,24 @@ +(module + (type $arr (;0;) (array (mut arrayref))) + (type (;1;) (func (result i32))) + (export "run" (func 0)) + (elem $elem (;0;) arrayref (item i32.const 0 array.new_default $arr)) + (func (;0;) (type 1) (result i32) + (local $a (ref null $arr)) (local $b (ref null $arr)) + i32.const 0 + i32.const 1 + array.new_elem $arr $elem + local.set $a + i32.const 0 + i32.const 1 + array.new_elem $arr $elem + local.set $b + local.get $a + i32.const 0 + array.get $arr + local.get $b + i32.const 0 + array.get $arr + ref.eq + ) +) diff --git a/tests/snapshots/testsuite/custom/branch_hint.wast.json b/tests/snapshots/testsuite/custom/branch_hint.wast.json new file mode 100644 index 0000000000..f9d66689db --- /dev/null +++ b/tests/snapshots/testsuite/custom/branch_hint.wast.json @@ -0,0 +1,32 @@ +{ + "source_filename": "tests/testsuite/custom/branch_hint.wast", + "commands": [ + { + "type": "module", + "line": 1, + "filename": "branch_hint.0.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed_custom", + "line": 51, + "filename": "branch_hint.1.wat", + "module_type": "text", + "text": "@metadata.code.branch_hint annotation: duplicate annotation" + }, + { + "type": "assert_malformed_custom", + "line": 68, + "filename": "branch_hint.2.wat", + "module_type": "text", + "text": "@metadata.code.branch_hint annotation: not in a function" + }, + { + "type": "assert_invalid_custom", + "line": 86, + "filename": "branch_hint.3.wasm", + "module_type": "binary", + "text": "@metadata.code.branch_hint annotation: invalid target" + } + ] +} \ No newline at end of file diff --git a/tests/snapshots/testsuite/custom/branch_hint.wast/0.print b/tests/snapshots/testsuite/custom/branch_hint.wast/0.print new file mode 100644 index 0000000000..d23531f0f0 --- /dev/null +++ b/tests/snapshots/testsuite/custom/branch_hint.wast/0.print @@ -0,0 +1,85 @@ +(module + (type (;0;) (func (param i32))) + (type (;1;) (func)) + (type (;2;) (func (param i32 i32) (result i32))) + (memory (;0;) 1 1) + (export "nested" (func 3)) + (func $dummy (;0;) (type 1)) + (func $test1 (;1;) (type 0) (param i32) + (local i32) + local.get 1 + local.get 0 + i32.eq + (@metadata.code.branch_hint "\00") + if ;; label = @1 + return + end + return + ) + (func $test2 (;2;) (type 0) (param i32) + (local i32) + local.get 1 + local.get 0 + i32.eq + (@metadata.code.branch_hint "\01") + if ;; label = @1 + return + end + return + ) + (func (;3;) (type 2) (param i32 i32) (result i32) + (@metadata.code.branch_hint "\00") + local.get 0 + if (result i32) ;; label = @1 + local.get 1 + if ;; label = @2 + call $dummy + block ;; label = @3 + end + nop + end + local.get 1 + if ;; label = @2 + else + call $dummy + block ;; label = @3 + end + nop + end + (@metadata.code.branch_hint "\01") + local.get 1 + if (result i32) ;; label = @2 + call $dummy + i32.const 9 + else + call $dummy + i32.const 10 + end + else + local.get 1 + if ;; label = @2 + call $dummy + block ;; label = @3 + end + nop + end + (@metadata.code.branch_hint "\00") + local.get 1 + if ;; label = @2 + else + call $dummy + block ;; label = @3 + end + nop + end + local.get 1 + if (result i32) ;; label = @2 + call $dummy + i32.const 10 + else + call $dummy + i32.const 11 + end + end + ) +) diff --git a/tests/snapshots/testsuite/custom/branch_hint.wast/3.print b/tests/snapshots/testsuite/custom/branch_hint.wast/3.print new file mode 100644 index 0000000000..f729cb0cfa --- /dev/null +++ b/tests/snapshots/testsuite/custom/branch_hint.wast/3.print @@ -0,0 +1,12 @@ +(module + (type (;0;) (func (param i32))) + (memory (;0;) 1 1) + (func $test (;0;) (type 0) (param i32) + (local i32) + local.get 1 + local.get 0 + (@metadata.code.branch_hint "\01") + i32.eq + return + ) +) diff --git a/tests/snapshots/testsuite/custom/custom_annot.wast.json b/tests/snapshots/testsuite/custom/custom_annot.wast.json new file mode 100644 index 0000000000..b4057aaf2a --- /dev/null +++ b/tests/snapshots/testsuite/custom/custom_annot.wast.json @@ -0,0 +1,123 @@ +{ + "source_filename": "tests/testsuite/custom/custom_annot.wast", + "commands": [ + { + "type": "module", + "line": 1, + "filename": "custom_annot.0.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 19, + "filename": "custom_annot.1.wat", + "module_type": "text", + "binary_filename": "custom_annot.1.wasm" + }, + { + "type": "module", + "line": 20, + "filename": "custom_annot.2.wat", + "module_type": "text", + "binary_filename": "custom_annot.2.wasm" + }, + { + "type": "assert_malformed_custom", + "line": 26, + "filename": "custom_annot.3.wat", + "module_type": "text", + "text": "@custom annotation: missing section name" + }, + { + "type": "assert_malformed_custom", + "line": 31, + "filename": "custom_annot.4.wat", + "module_type": "text", + "text": "@custom annotation: missing section name" + }, + { + "type": "assert_malformed_custom", + "line": 36, + "filename": "custom_annot.5.wat", + "module_type": "text", + "text": "@custom annotation: missing section name" + }, + { + "type": "assert_malformed_custom", + "line": 41, + "filename": "custom_annot.6.wat", + "module_type": "text", + "text": "@custom annotation: malformed UTF-8 encoding" + }, + { + "type": "assert_malformed_custom", + "line": 49, + "filename": "custom_annot.7.wat", + "module_type": "text", + "text": "@custom annotation: unexpected token" + }, + { + "type": "assert_malformed_custom", + "line": 54, + "filename": "custom_annot.8.wat", + "module_type": "text", + "text": "@custom annotation: unexpected token" + }, + { + "type": "assert_malformed_custom", + "line": 59, + "filename": "custom_annot.9.wat", + "module_type": "text", + "text": "@custom annotation: malformed section kind" + }, + { + "type": "assert_malformed_custom", + "line": 64, + "filename": "custom_annot.10.wat", + "module_type": "text", + "text": "@custom annotation: malformed placement" + }, + { + "type": "assert_malformed_custom", + "line": 69, + "filename": "custom_annot.11.wat", + "module_type": "text", + "text": "@custom annotation: malformed placement" + }, + { + "type": "assert_malformed_custom", + "line": 74, + "filename": "custom_annot.12.wat", + "module_type": "text", + "text": "@custom annotation: malformed section kind" + }, + { + "type": "assert_malformed_custom", + "line": 82, + "filename": "custom_annot.13.wat", + "module_type": "text", + "text": "misplaced @custom annotation" + }, + { + "type": "assert_malformed_custom", + "line": 87, + "filename": "custom_annot.14.wat", + "module_type": "text", + "text": "misplaced @custom annotation" + }, + { + "type": "assert_malformed_custom", + "line": 92, + "filename": "custom_annot.15.wat", + "module_type": "text", + "text": "misplaced @custom annotation" + }, + { + "type": "assert_malformed_custom", + "line": 97, + "filename": "custom_annot.16.wat", + "module_type": "text", + "text": "misplaced @custom annotation" + } + ] +} \ No newline at end of file diff --git a/tests/snapshots/testsuite/custom/custom_annot.wast/0.print b/tests/snapshots/testsuite/custom/custom_annot.wast/0.print new file mode 100644 index 0000000000..ba7affa3a7 --- /dev/null +++ b/tests/snapshots/testsuite/custom/custom_annot.wast/0.print @@ -0,0 +1,16 @@ +(module + (type $t (;0;) (func)) + (@custom "my-section2" (after func) "more-contents-bytes2") + (@custom "my-section2" (after func) "more-contents-bytes3") + (@custom "my-section2" (after func) "more-contents-bytes1") + (@custom "my-section2" (after func) "more-contents-bytes4") + (global $g (;0;) i32 i32.const 0) + (func (;0;) (type $t)) + (@custom "my-section1" (after code) "contents-bytes1") + (@custom "my-section2" (after code) "more-contents-bytes0") + (@custom "my-section1" (after code) "contents-bytes2") + (@custom "my-section2" (after code) "more-contents-bytes5") + (@custom "my-section3" (after code) "") + (@custom "my-section4" (after code) "123") + (@custom "" (after code) "") +) diff --git a/tests/snapshots/testsuite/custom/custom_annot.wast/1.print b/tests/snapshots/testsuite/custom/custom_annot.wast/1.print new file mode 100644 index 0000000000..6b32165bca --- /dev/null +++ b/tests/snapshots/testsuite/custom/custom_annot.wast/1.print @@ -0,0 +1,3 @@ +(module + (@custom "bla" (before first) "") +) diff --git a/tests/snapshots/testsuite/custom/custom_annot.wast/2.print b/tests/snapshots/testsuite/custom/custom_annot.wast/2.print new file mode 100644 index 0000000000..6b32165bca --- /dev/null +++ b/tests/snapshots/testsuite/custom/custom_annot.wast/2.print @@ -0,0 +1,3 @@ +(module + (@custom "bla" (before first) "") +) diff --git a/tests/snapshots/testsuite/custom/name_annot.wast.json b/tests/snapshots/testsuite/custom/name_annot.wast.json new file mode 100644 index 0000000000..f7931f84be --- /dev/null +++ b/tests/snapshots/testsuite/custom/name_annot.wast.json @@ -0,0 +1,51 @@ +{ + "source_filename": "tests/testsuite/custom/name_annot.wast", + "commands": [ + { + "type": "module", + "line": 3, + "filename": "name_annot.0.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 5, + "name": "moduel", + "filename": "name_annot.1.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed_custom", + "line": 8, + "filename": "name_annot.2.wat", + "module_type": "text", + "text": "@name annotation: multiple module" + }, + { + "type": "assert_malformed_custom", + "line": 13, + "filename": "name_annot.3.wat", + "module_type": "text", + "text": "misplaced @name annotation" + }, + { + "type": "assert_malformed_custom", + "line": 18, + "filename": "name_annot.4.wat", + "module_type": "text", + "text": "misplaced @name annotation" + }, + { + "type": "module", + "line": 25, + "filename": "name_annot.5.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 34, + "filename": "name_annot.6.wasm", + "module_type": "binary" + } + ] +} \ No newline at end of file diff --git a/tests/snapshots/testsuite/custom/name_annot.wast/0.print b/tests/snapshots/testsuite/custom/name_annot.wast/0.print new file mode 100644 index 0000000000..a7bd1b00d1 --- /dev/null +++ b/tests/snapshots/testsuite/custom/name_annot.wast/0.print @@ -0,0 +1 @@ +(module $"Mod\u{fc}l") diff --git a/tests/snapshots/testsuite/custom/name_annot.wast/1.print b/tests/snapshots/testsuite/custom/name_annot.wast/1.print new file mode 100644 index 0000000000..a7bd1b00d1 --- /dev/null +++ b/tests/snapshots/testsuite/custom/name_annot.wast/1.print @@ -0,0 +1 @@ +(module $"Mod\u{fc}l") diff --git a/tests/snapshots/testsuite/custom/name_annot.wast/5.print b/tests/snapshots/testsuite/custom/name_annot.wast/5.print new file mode 100644 index 0000000000..a201461ad8 --- /dev/null +++ b/tests/snapshots/testsuite/custom/name_annot.wast/5.print @@ -0,0 +1,5 @@ +(module + (type $t (;0;) (func)) + (func $"\u{3bb}" (;0;) (type $t)) + (func $"#func1 \u{3bb}" (@name "\u{3bb}") (;1;) (type $t)) +) diff --git a/tests/snapshots/testsuite/custom/name_annot.wast/6.print b/tests/snapshots/testsuite/custom/name_annot.wast/6.print new file mode 100644 index 0000000000..3d83aea1f1 --- /dev/null +++ b/tests/snapshots/testsuite/custom/name_annot.wast/6.print @@ -0,0 +1,5 @@ +(module + (type $t (;0;) (func)) + (tag $"\u{3b8}" (;0;) (type $t)) + (tag $"#tag1 \u{3b8}" (@name "\u{3b8}") (;1;) (type $t)) +) diff --git a/tests/snapshots/testsuite/loop.wast.json b/tests/snapshots/testsuite/loop.wast.json index 1a1d7ca4c3..7eacdd0719 100644 --- a/tests/snapshots/testsuite/loop.wast.json +++ b/tests/snapshots/testsuite/loop.wast.json @@ -9,7 +9,7 @@ }, { "type": "assert_return", - "line": 430, + "line": 441, "action": { "type": "invoke", "field": "empty", @@ -19,7 +19,7 @@ }, { "type": "assert_return", - "line": 431, + "line": 442, "action": { "type": "invoke", "field": "singular", @@ -34,7 +34,7 @@ }, { "type": "assert_return", - "line": 432, + "line": 443, "action": { "type": "invoke", "field": "multi", @@ -49,7 +49,7 @@ }, { "type": "assert_return", - "line": 433, + "line": 444, "action": { "type": "invoke", "field": "nested", @@ -64,7 +64,7 @@ }, { "type": "assert_return", - "line": 434, + "line": 445, "action": { "type": "invoke", "field": "deep", @@ -79,7 +79,7 @@ }, { "type": "assert_return", - "line": 436, + "line": 447, "action": { "type": "invoke", "field": "as-select-first", @@ -94,7 +94,7 @@ }, { "type": "assert_return", - "line": 437, + "line": 448, "action": { "type": "invoke", "field": "as-select-mid", @@ -109,7 +109,7 @@ }, { "type": "assert_return", - "line": 438, + "line": 449, "action": { "type": "invoke", "field": "as-select-last", @@ -124,7 +124,7 @@ }, { "type": "assert_return", - "line": 440, + "line": 451, "action": { "type": "invoke", "field": "as-if-condition", @@ -134,7 +134,7 @@ }, { "type": "assert_return", - "line": 441, + "line": 452, "action": { "type": "invoke", "field": "as-if-then", @@ -149,7 +149,7 @@ }, { "type": "assert_return", - "line": 442, + "line": 453, "action": { "type": "invoke", "field": "as-if-else", @@ -164,7 +164,7 @@ }, { "type": "assert_return", - "line": 444, + "line": 455, "action": { "type": "invoke", "field": "as-br_if-first", @@ -179,7 +179,7 @@ }, { "type": "assert_return", - "line": 445, + "line": 456, "action": { "type": "invoke", "field": "as-br_if-last", @@ -194,7 +194,7 @@ }, { "type": "assert_return", - "line": 447, + "line": 458, "action": { "type": "invoke", "field": "as-br_table-first", @@ -209,7 +209,7 @@ }, { "type": "assert_return", - "line": 448, + "line": 459, "action": { "type": "invoke", "field": "as-br_table-last", @@ -224,7 +224,7 @@ }, { "type": "assert_return", - "line": 450, + "line": 461, "action": { "type": "invoke", "field": "as-call_indirect-first", @@ -239,7 +239,7 @@ }, { "type": "assert_return", - "line": 451, + "line": 462, "action": { "type": "invoke", "field": "as-call_indirect-mid", @@ -254,7 +254,7 @@ }, { "type": "assert_return", - "line": 452, + "line": 463, "action": { "type": "invoke", "field": "as-call_indirect-last", @@ -269,7 +269,7 @@ }, { "type": "assert_return", - "line": 454, + "line": 465, "action": { "type": "invoke", "field": "as-store-first", @@ -279,7 +279,7 @@ }, { "type": "assert_return", - "line": 455, + "line": 466, "action": { "type": "invoke", "field": "as-store-last", @@ -289,7 +289,7 @@ }, { "type": "assert_return", - "line": 457, + "line": 468, "action": { "type": "invoke", "field": "as-memory.grow-value", @@ -304,7 +304,7 @@ }, { "type": "assert_return", - "line": 458, + "line": 469, "action": { "type": "invoke", "field": "as-call-value", @@ -319,7 +319,7 @@ }, { "type": "assert_return", - "line": 459, + "line": 470, "action": { "type": "invoke", "field": "as-return-value", @@ -334,7 +334,7 @@ }, { "type": "assert_return", - "line": 460, + "line": 471, "action": { "type": "invoke", "field": "as-drop-operand", @@ -344,7 +344,7 @@ }, { "type": "assert_return", - "line": 461, + "line": 472, "action": { "type": "invoke", "field": "as-br-value", @@ -359,7 +359,7 @@ }, { "type": "assert_return", - "line": 462, + "line": 473, "action": { "type": "invoke", "field": "as-local.set-value", @@ -374,7 +374,7 @@ }, { "type": "assert_return", - "line": 463, + "line": 474, "action": { "type": "invoke", "field": "as-local.tee-value", @@ -389,7 +389,7 @@ }, { "type": "assert_return", - "line": 464, + "line": 475, "action": { "type": "invoke", "field": "as-global.set-value", @@ -404,7 +404,7 @@ }, { "type": "assert_return", - "line": 465, + "line": 476, "action": { "type": "invoke", "field": "as-load-operand", @@ -419,7 +419,7 @@ }, { "type": "assert_return", - "line": 467, + "line": 478, "action": { "type": "invoke", "field": "as-unary-operand", @@ -434,7 +434,7 @@ }, { "type": "assert_return", - "line": 468, + "line": 479, "action": { "type": "invoke", "field": "as-binary-operand", @@ -449,7 +449,7 @@ }, { "type": "assert_return", - "line": 469, + "line": 480, "action": { "type": "invoke", "field": "as-test-operand", @@ -464,7 +464,7 @@ }, { "type": "assert_return", - "line": 470, + "line": 481, "action": { "type": "invoke", "field": "as-compare-operand", @@ -479,7 +479,7 @@ }, { "type": "assert_return", - "line": 471, + "line": 482, "action": { "type": "invoke", "field": "as-binary-operands", @@ -494,7 +494,7 @@ }, { "type": "assert_return", - "line": 472, + "line": 483, "action": { "type": "invoke", "field": "as-compare-operands", @@ -509,7 +509,7 @@ }, { "type": "assert_return", - "line": 473, + "line": 484, "action": { "type": "invoke", "field": "as-mixed-operands", @@ -524,7 +524,7 @@ }, { "type": "assert_return", - "line": 475, + "line": 486, "action": { "type": "invoke", "field": "break-bare", @@ -539,7 +539,7 @@ }, { "type": "assert_return", - "line": 476, + "line": 487, "action": { "type": "invoke", "field": "break-value", @@ -554,7 +554,7 @@ }, { "type": "assert_return", - "line": 477, + "line": 488, "action": { "type": "invoke", "field": "break-multi-value", @@ -577,7 +577,7 @@ }, { "type": "assert_return", - "line": 480, + "line": 491, "action": { "type": "invoke", "field": "break-repeated", @@ -592,7 +592,7 @@ }, { "type": "assert_return", - "line": 481, + "line": 492, "action": { "type": "invoke", "field": "break-inner", @@ -607,7 +607,7 @@ }, { "type": "assert_return", - "line": 483, + "line": 494, "action": { "type": "invoke", "field": "param", @@ -622,7 +622,7 @@ }, { "type": "assert_return", - "line": 484, + "line": 495, "action": { "type": "invoke", "field": "params", @@ -637,7 +637,7 @@ }, { "type": "assert_return", - "line": 485, + "line": 496, "action": { "type": "invoke", "field": "params-id", @@ -652,7 +652,7 @@ }, { "type": "assert_return", - "line": 486, + "line": 497, "action": { "type": "invoke", "field": "param-break", @@ -667,7 +667,7 @@ }, { "type": "assert_return", - "line": 487, + "line": 498, "action": { "type": "invoke", "field": "params-break", @@ -682,7 +682,7 @@ }, { "type": "assert_return", - "line": 488, + "line": 499, "action": { "type": "invoke", "field": "params-id-break", @@ -697,7 +697,7 @@ }, { "type": "assert_return", - "line": 490, + "line": 501, "action": { "type": "invoke", "field": "effects", @@ -712,7 +712,7 @@ }, { "type": "assert_return", - "line": 492, + "line": 503, "action": { "type": "invoke", "field": "while", @@ -732,7 +732,7 @@ }, { "type": "assert_return", - "line": 493, + "line": 504, "action": { "type": "invoke", "field": "while", @@ -752,7 +752,7 @@ }, { "type": "assert_return", - "line": 494, + "line": 505, "action": { "type": "invoke", "field": "while", @@ -772,7 +772,7 @@ }, { "type": "assert_return", - "line": 495, + "line": 506, "action": { "type": "invoke", "field": "while", @@ -792,7 +792,7 @@ }, { "type": "assert_return", - "line": 496, + "line": 507, "action": { "type": "invoke", "field": "while", @@ -812,7 +812,7 @@ }, { "type": "assert_return", - "line": 497, + "line": 508, "action": { "type": "invoke", "field": "while", @@ -832,7 +832,7 @@ }, { "type": "assert_return", - "line": 499, + "line": 510, "action": { "type": "invoke", "field": "for", @@ -852,7 +852,7 @@ }, { "type": "assert_return", - "line": 500, + "line": 511, "action": { "type": "invoke", "field": "for", @@ -872,7 +872,7 @@ }, { "type": "assert_return", - "line": 501, + "line": 512, "action": { "type": "invoke", "field": "for", @@ -892,7 +892,7 @@ }, { "type": "assert_return", - "line": 502, + "line": 513, "action": { "type": "invoke", "field": "for", @@ -912,7 +912,7 @@ }, { "type": "assert_return", - "line": 503, + "line": 514, "action": { "type": "invoke", "field": "for", @@ -932,7 +932,7 @@ }, { "type": "assert_return", - "line": 504, + "line": 515, "action": { "type": "invoke", "field": "for", @@ -952,7 +952,7 @@ }, { "type": "assert_return", - "line": 506, + "line": 517, "action": { "type": "invoke", "field": "nesting", @@ -976,7 +976,7 @@ }, { "type": "assert_return", - "line": 507, + "line": 518, "action": { "type": "invoke", "field": "nesting", @@ -1000,7 +1000,7 @@ }, { "type": "assert_return", - "line": 508, + "line": 519, "action": { "type": "invoke", "field": "nesting", @@ -1024,7 +1024,7 @@ }, { "type": "assert_return", - "line": 509, + "line": 520, "action": { "type": "invoke", "field": "nesting", @@ -1048,7 +1048,7 @@ }, { "type": "assert_return", - "line": 510, + "line": 521, "action": { "type": "invoke", "field": "nesting", @@ -1072,7 +1072,7 @@ }, { "type": "assert_return", - "line": 511, + "line": 522, "action": { "type": "invoke", "field": "nesting", @@ -1096,7 +1096,7 @@ }, { "type": "assert_return", - "line": 512, + "line": 523, "action": { "type": "invoke", "field": "nesting", @@ -1120,7 +1120,7 @@ }, { "type": "assert_return", - "line": 513, + "line": 524, "action": { "type": "invoke", "field": "nesting", @@ -1144,7 +1144,7 @@ }, { "type": "assert_return", - "line": 514, + "line": 525, "action": { "type": "invoke", "field": "nesting", @@ -1168,7 +1168,7 @@ }, { "type": "assert_return", - "line": 515, + "line": 526, "action": { "type": "invoke", "field": "nesting", @@ -1192,7 +1192,7 @@ }, { "type": "assert_return", - "line": 516, + "line": 527, "action": { "type": "invoke", "field": "nesting", @@ -1216,7 +1216,7 @@ }, { "type": "assert_return", - "line": 517, + "line": 528, "action": { "type": "invoke", "field": "nesting", @@ -1240,7 +1240,7 @@ }, { "type": "assert_return", - "line": 518, + "line": 529, "action": { "type": "invoke", "field": "nesting", @@ -1264,7 +1264,7 @@ }, { "type": "assert_return", - "line": 519, + "line": 530, "action": { "type": "invoke", "field": "nesting", @@ -1288,7 +1288,7 @@ }, { "type": "assert_return", - "line": 520, + "line": 531, "action": { "type": "invoke", "field": "nesting", @@ -1312,7 +1312,7 @@ }, { "type": "assert_return", - "line": 521, + "line": 532, "action": { "type": "invoke", "field": "nesting", @@ -1336,7 +1336,7 @@ }, { "type": "assert_return", - "line": 523, + "line": 534, "action": { "type": "invoke", "field": "type-use", @@ -1344,296 +1344,311 @@ }, "expected": [] }, + { + "type": "assert_return", + "line": 536, + "action": { + "type": "invoke", + "field": "br-implicit-drop", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] + }, { "type": "assert_malformed", - "line": 526, + "line": 539, "filename": "loop.1.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 533, + "line": 546, "filename": "loop.2.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 540, + "line": 553, "filename": "loop.3.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 547, + "line": 560, "filename": "loop.4.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 554, + "line": 567, "filename": "loop.5.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 561, + "line": 574, "filename": "loop.6.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 568, + "line": 581, "filename": "loop.7.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 572, + "line": 585, "filename": "loop.8.wat", "module_type": "text", "text": "inline function type" }, { "type": "assert_malformed", - "line": 579, + "line": 592, "filename": "loop.9.wat", "module_type": "text", "text": "inline function type" }, { "type": "assert_malformed", - "line": 586, + "line": 599, "filename": "loop.10.wat", "module_type": "text", "text": "inline function type" }, { "type": "assert_malformed", - "line": 593, + "line": 606, "filename": "loop.11.wat", "module_type": "text", "text": "inline function type" }, { "type": "assert_invalid", - "line": 601, + "line": 614, "filename": "loop.12.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 609, + "line": 622, "filename": "loop.13.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 613, + "line": 626, "filename": "loop.14.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 617, + "line": 630, "filename": "loop.15.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 621, + "line": 634, "filename": "loop.16.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 626, + "line": 639, "filename": "loop.17.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 632, + "line": 645, "filename": "loop.18.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 638, + "line": 651, "filename": "loop.19.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 644, + "line": 657, "filename": "loop.20.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 650, + "line": 663, "filename": "loop.21.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 656, + "line": 669, "filename": "loop.22.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 662, + "line": 675, "filename": "loop.23.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 668, + "line": 681, "filename": "loop.24.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 674, + "line": 687, "filename": "loop.25.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 680, + "line": 693, "filename": "loop.26.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 686, + "line": 699, "filename": "loop.27.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 693, + "line": 706, "filename": "loop.28.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 702, + "line": 715, "filename": "loop.29.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 711, + "line": 724, "filename": "loop.30.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 721, + "line": 734, "filename": "loop.31.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 727, + "line": 740, "filename": "loop.32.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 733, + "line": 746, "filename": "loop.33.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 739, + "line": 752, "filename": "loop.34.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 745, + "line": 758, "filename": "loop.35.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 751, + "line": 764, "filename": "loop.36.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 757, + "line": 770, "filename": "loop.37.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_invalid", - "line": 763, + "line": 776, "filename": "loop.38.wasm", "module_type": "binary", "text": "type mismatch" }, { "type": "assert_malformed", - "line": 770, + "line": 783, "filename": "loop.39.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 774, + "line": 787, "filename": "loop.40.wat", "module_type": "text", "text": "unexpected token" }, { "type": "assert_malformed", - "line": 779, + "line": 792, "filename": "loop.41.wat", "module_type": "text", "text": "mismatching label" }, { "type": "assert_malformed", - "line": 783, + "line": 796, "filename": "loop.42.wat", "module_type": "text", "text": "mismatching label" diff --git a/tests/snapshots/testsuite/loop.wast/0.print b/tests/snapshots/testsuite/loop.wast/0.print index 1b9eb5a9f7..e340612f22 100644 --- a/tests/snapshots/testsuite/loop.wast/0.print +++ b/tests/snapshots/testsuite/loop.wast/0.print @@ -69,6 +69,7 @@ (export "for" (func 53)) (export "nesting" (func 54)) (export "type-use" (func 55)) + (export "br-implicit-drop" (func 56)) (elem (;0;) (table 0) (i32.const 0) func $func) (func $dummy (;0;) (type $block-sig-1)) (func (;1;) (type $block-sig-1) @@ -886,4 +887,20 @@ drop drop ) + (func (;56;) (type $block-sig-2) (result i32) + (local $i i32) + i32.const 1 + loop $loop + local.get $i + i32.const 1 + i32.add + local.set $i + i32.const 2 + local.get $i + i32.const 10 + i32.lt_s + br_if $loop + drop + end + ) ) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast.json b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast.json new file mode 100644 index 0000000000..7a5167de5b --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast.json @@ -0,0 +1,876 @@ +{ + "source_filename": "tests/testsuite/proposals/custom-page-sizes/binary.wast", + "commands": [ + { + "type": "module", + "line": 1, + "filename": "binary.0.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 2, + "filename": "binary.1.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 3, + "name": "M1", + "filename": "binary.2.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 4, + "name": "M2", + "filename": "binary.3.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 6, + "filename": "binary.4.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 7, + "filename": "binary.5.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 8, + "filename": "binary.6.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 9, + "filename": "binary.7.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 10, + "filename": "binary.8.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 11, + "filename": "binary.9.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 12, + "filename": "binary.10.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 13, + "filename": "binary.11.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 14, + "filename": "binary.12.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 15, + "filename": "binary.13.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 16, + "filename": "binary.14.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 17, + "filename": "binary.15.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 18, + "filename": "binary.16.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 21, + "filename": "binary.17.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 24, + "filename": "binary.18.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 25, + "filename": "binary.19.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 28, + "filename": "binary.20.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 31, + "filename": "binary.21.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 34, + "filename": "binary.22.wasm", + "module_type": "binary", + "text": "magic header not detected" + }, + { + "type": "assert_malformed", + "line": 37, + "filename": "binary.23.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 38, + "filename": "binary.24.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 39, + "filename": "binary.25.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 40, + "filename": "binary.26.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 41, + "filename": "binary.27.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 42, + "filename": "binary.28.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 43, + "filename": "binary.29.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 44, + "filename": "binary.30.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 45, + "filename": "binary.31.wasm", + "module_type": "binary", + "text": "unknown binary version" + }, + { + "type": "assert_malformed", + "line": 48, + "filename": "binary.32.wasm", + "module_type": "binary", + "text": "malformed section id" + }, + { + "type": "assert_malformed", + "line": 49, + "filename": "binary.33.wasm", + "module_type": "binary", + "text": "malformed section id" + }, + { + "type": "assert_malformed", + "line": 50, + "filename": "binary.34.wasm", + "module_type": "binary", + "text": "malformed section id" + }, + { + "type": "assert_malformed", + "line": 51, + "filename": "binary.35.wasm", + "module_type": "binary", + "text": "malformed section id" + }, + { + "type": "assert_malformed", + "line": 52, + "filename": "binary.36.wasm", + "module_type": "binary", + "text": "malformed section id" + }, + { + "type": "assert_malformed", + "line": 56, + "filename": "binary.37.wasm", + "module_type": "binary", + "text": "END opcode expected" + }, + { + "type": "assert_malformed", + "line": 77, + "filename": "binary.38.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 93, + "filename": "binary.39.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "assert_malformed", + "line": 113, + "filename": "binary.40.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 126, + "filename": "binary.41.wasm", + "module_type": "binary", + "text": "integer too large" + }, + { + "type": "assert_malformed", + "line": 143, + "filename": "binary.42.wasm", + "module_type": "binary", + "text": "integer too large" + }, + { + "type": "assert_malformed", + "line": 160, + "filename": "binary.43.wasm", + "module_type": "binary", + "text": "too many locals" + }, + { + "type": "assert_malformed", + "line": 176, + "filename": "binary.44.wasm", + "module_type": "binary", + "text": "too many locals" + }, + { + "type": "module", + "line": 194, + "filename": "binary.45.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 210, + "filename": "binary.46.wasm", + "module_type": "binary", + "text": "function and code section have inconsistent lengths" + }, + { + "type": "assert_malformed", + "line": 220, + "filename": "binary.47.wasm", + "module_type": "binary", + "text": "function and code section have inconsistent lengths" + }, + { + "type": "assert_malformed", + "line": 229, + "filename": "binary.48.wasm", + "module_type": "binary", + "text": "function and code section have inconsistent lengths" + }, + { + "type": "assert_malformed", + "line": 240, + "filename": "binary.49.wasm", + "module_type": "binary", + "text": "function and code section have inconsistent lengths" + }, + { + "type": "module", + "line": 250, + "filename": "binary.50.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 256, + "filename": "binary.51.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 263, + "filename": "binary.52.wasm", + "module_type": "binary", + "text": "data count and data section have inconsistent lengths" + }, + { + "type": "assert_malformed", + "line": 275, + "filename": "binary.53.wasm", + "module_type": "binary", + "text": "data count and data section have inconsistent lengths" + }, + { + "type": "assert_malformed", + "line": 287, + "filename": "binary.54.wasm", + "module_type": "binary", + "text": "data count and data section have inconsistent lengths" + }, + { + "type": "module", + "line": 296, + "filename": "binary.55.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 303, + "filename": "binary.56.wasm", + "module_type": "binary", + "text": "data count section required" + }, + { + "type": "assert_malformed", + "line": 326, + "filename": "binary.57.wasm", + "module_type": "binary", + "text": "data count section required" + }, + { + "type": "assert_malformed", + "line": 346, + "filename": "binary.58.wasm", + "module_type": "binary", + "text": "illegal opcode" + }, + { + "type": "assert_malformed", + "line": 374, + "filename": "binary.59.wasm", + "module_type": "binary", + "text": "malformed reference type" + }, + { + "type": "module", + "line": 401, + "filename": "binary.60.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 426, + "filename": "binary.61.wasm", + "module_type": "binary" + }, + { + "type": "module", + "line": 452, + "filename": "binary.62.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 459, + "filename": "binary.63.wasm", + "module_type": "binary", + "text": "length out of bounds" + }, + { + "type": "assert_malformed", + "line": 470, + "filename": "binary.64.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 480, + "filename": "binary.65.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 489, + "filename": "binary.66.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 499, + "filename": "binary.67.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 510, + "filename": "binary.68.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 520, + "filename": "binary.69.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 531, + "filename": "binary.70.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 541, + "filename": "binary.71.wasm", + "module_type": "binary", + "text": "malformed import kind" + }, + { + "type": "assert_malformed", + "line": 554, + "filename": "binary.72.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 573, + "filename": "binary.73.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 597, + "filename": "binary.74.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 604, + "filename": "binary.75.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 614, + "filename": "binary.76.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "assert_malformed", + "line": 623, + "filename": "binary.77.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "assert_malformed", + "line": 633, + "filename": "binary.78.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "module", + "line": 644, + "filename": "binary.79.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 651, + "filename": "binary.80.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 661, + "filename": "binary.81.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "assert_malformed", + "line": 669, + "filename": "binary.82.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "assert_malformed", + "line": 678, + "filename": "binary.83.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "assert_malformed", + "line": 687, + "filename": "binary.84.wasm", + "module_type": "binary", + "text": "malformed limits flags" + }, + { + "type": "module", + "line": 697, + "filename": "binary.85.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 704, + "filename": "binary.86.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 715, + "filename": "binary.87.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 725, + "filename": "binary.88.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 738, + "filename": "binary.89.wasm", + "module_type": "binary", + "text": "length out of bounds" + }, + { + "type": "assert_malformed", + "line": 759, + "filename": "binary.90.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 779, + "filename": "binary.91.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 793, + "filename": "binary.92.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 809, + "filename": "binary.93.wasm", + "module_type": "binary", + "text": "unexpected end" + }, + { + "type": "assert_malformed", + "line": 826, + "filename": "binary.94.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 843, + "filename": "binary.95.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 852, + "filename": "binary.96.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 865, + "filename": "binary.97.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "assert_malformed", + "line": 878, + "filename": "binary.98.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "assert_malformed", + "line": 892, + "filename": "binary.99.wasm", + "module_type": "binary", + "text": "section size mismatch" + }, + { + "type": "module", + "line": 905, + "filename": "binary.100.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 923, + "filename": "binary.101.wasm", + "module_type": "binary", + "text": "unexpected end of section or function" + }, + { + "type": "module", + "line": 956, + "filename": "binary.102.wasm", + "module_type": "binary" + }, + { + "type": "assert_malformed", + "line": 970, + "filename": "binary.103.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 987, + "filename": "binary.104.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 999, + "filename": "binary.105.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1011, + "filename": "binary.106.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1021, + "filename": "binary.107.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1031, + "filename": "binary.108.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1041, + "filename": "binary.109.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1051, + "filename": "binary.110.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1061, + "filename": "binary.111.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1071, + "filename": "binary.112.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1081, + "filename": "binary.113.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1091, + "filename": "binary.114.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1101, + "filename": "binary.115.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1111, + "filename": "binary.116.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1121, + "filename": "binary.117.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1131, + "filename": "binary.118.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1141, + "filename": "binary.119.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1151, + "filename": "binary.120.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1161, + "filename": "binary.121.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1173, + "filename": "binary.122.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1185, + "filename": "binary.123.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1195, + "filename": "binary.124.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1205, + "filename": "binary.125.wasm", + "module_type": "binary", + "text": "unexpected content after last section" + }, + { + "type": "assert_malformed", + "line": 1219, + "filename": "binary.126.wasm", + "module_type": "binary", + "text": "illegal opcode ff" + } + ] +} \ No newline at end of file diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/0.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/0.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/0.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/1.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/1.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/1.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/100.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/100.print new file mode 100644 index 0000000000..7d6e8576d7 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/100.print @@ -0,0 +1,12 @@ +(module + (type (;0;) (func)) + (func (;0;) (type 0) + block ;; label = @1 + i32.const 1 + if ;; label = @2 + i32.const 1 + br_table 2 + end + end + ) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/102.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/102.print new file mode 100644 index 0000000000..d90addbeb7 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/102.print @@ -0,0 +1,5 @@ +(module + (type (;0;) (func)) + (start 0) + (func (;0;) (type 0)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/2.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/2.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/2.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/3.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/3.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/3.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/45.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/45.print new file mode 100644 index 0000000000..5b779b0575 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/45.print @@ -0,0 +1,6 @@ +(module + (type (;0;) (func)) + (func (;0;) (type 0) + (local f32 f32) + ) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/50.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/50.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/50.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/51.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/51.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/51.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/55.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/55.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/55.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/60.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/60.print new file mode 100644 index 0000000000..f60ef5c6a4 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/60.print @@ -0,0 +1,7 @@ +(module + (type (;0;) (func)) + (table (;0;) 0 funcref) + (memory (;0;) 0) + (elem (;0;) funcref (ref.func 0)) + (func (;0;) (type 0)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/61.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/61.print new file mode 100644 index 0000000000..b959a17a4a --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/61.print @@ -0,0 +1,7 @@ +(module + (type (;0;) (func)) + (table (;0;) 0 funcref) + (memory (;0;) 0) + (elem (;0;) funcref (ref.null func)) + (func (;0;) (type 0)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/62.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/62.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/62.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/65.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/65.print new file mode 100644 index 0000000000..4e56904c89 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/65.print @@ -0,0 +1,3 @@ +(module + (type (;0;) (func (param i32))) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/74.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/74.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/74.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/79.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/79.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/79.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/85.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/85.print new file mode 100644 index 0000000000..3af8f25454 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/85.print @@ -0,0 +1 @@ +(module) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/88.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/88.print new file mode 100644 index 0000000000..bb1df0f6c7 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/88.print @@ -0,0 +1,5 @@ +(module + (type (;0;) (func)) + (func (;0;) (type 0)) + (func (;1;) (type 0)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/91.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/91.print new file mode 100644 index 0000000000..e3c7ff0b0d --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/91.print @@ -0,0 +1,5 @@ +(module + (type (;0;) (func)) + (table (;0;) 1 funcref) + (func (;0;) (type 0)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/95.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/95.print new file mode 100644 index 0000000000..ffba26a4b1 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/binary.wast/95.print @@ -0,0 +1,3 @@ +(module + (memory (;0;) 1) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast.json b/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast.json deleted file mode 100644 index e4f9ab31d3..0000000000 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "source_filename": "tests/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast", - "commands": [ - { - "type": "assert_malformed", - "line": 3, - "filename": "custom-page-sizes-invalid.0.wat", - "module_type": "text", - "text": "invalid custom page size" - }, - { - "type": "assert_malformed", - "line": 8, - "filename": "custom-page-sizes-invalid.1.wat", - "module_type": "text", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 14, - "filename": "custom-page-sizes-invalid.2.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 18, - "filename": "custom-page-sizes-invalid.3.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 22, - "filename": "custom-page-sizes-invalid.4.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 26, - "filename": "custom-page-sizes-invalid.5.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 30, - "filename": "custom-page-sizes-invalid.6.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 34, - "filename": "custom-page-sizes-invalid.7.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 38, - "filename": "custom-page-sizes-invalid.8.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 42, - "filename": "custom-page-sizes-invalid.9.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 46, - "filename": "custom-page-sizes-invalid.10.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 50, - "filename": "custom-page-sizes-invalid.11.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 54, - "filename": "custom-page-sizes-invalid.12.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 58, - "filename": "custom-page-sizes-invalid.13.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 62, - "filename": "custom-page-sizes-invalid.14.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 66, - "filename": "custom-page-sizes-invalid.15.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 70, - "filename": "custom-page-sizes-invalid.16.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_invalid", - "line": 76, - "filename": "custom-page-sizes-invalid.17.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "assert_malformed", - "line": 83, - "filename": "custom-page-sizes-invalid.18.wasm", - "module_type": "binary", - "text": "invalid custom page size" - }, - { - "type": "module", - "line": 97, - "name": "m", - "filename": "custom-page-sizes-invalid.19.wasm", - "module_type": "binary" - }, - { - "type": "register", - "line": 101, - "name": "m", - "as": "m" - }, - { - "type": "assert_unlinkable", - "line": 104, - "filename": "custom-page-sizes-invalid.20.wasm", - "module_type": "binary", - "text": "memory types incompatible" - }, - { - "type": "assert_unlinkable", - "line": 111, - "filename": "custom-page-sizes-invalid.21.wasm", - "module_type": "binary", - "text": "memory types incompatible" - } - ] -} \ No newline at end of file diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/19.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/19.print deleted file mode 100644 index 45d7405af2..0000000000 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/19.print +++ /dev/null @@ -1,6 +0,0 @@ -(module $m - (memory (;0;) 0 (pagesize 0x1)) - (memory (;1;) 0 (pagesize 0x10000)) - (export "small-pages-memory" (memory 0)) - (export "large-pages-memory" (memory 1)) -) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/21.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/21.print deleted file mode 100644 index 819194c788..0000000000 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/21.print +++ /dev/null @@ -1,3 +0,0 @@ -(module - (import "m" "small-pages-memory" (memory (;0;) 0 (pagesize 0x10000))) -) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/22.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/22.print deleted file mode 100644 index 30057e3bad..0000000000 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast/22.print +++ /dev/null @@ -1,3 +0,0 @@ -(module - (import "m" "large-pages-memory" (memory (;0;) 0 (pagesize 0x1))) -) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast.json b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast.json index 6f0659e1d9..786c3841b5 100644 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast.json +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast.json @@ -17,26 +17,40 @@ "line": 19, "filename": "memory_max.1.wasm", "module_type": "binary", - "text": "unknown import" + "text": "incompatible import type" }, { "type": "assert_unlinkable", "line": 26, "filename": "memory_max.2.wasm", "module_type": "binary", - "text": "unknown import" + "text": "incompatible import type" }, { - "type": "assert_invalid", - "line": 35, + "type": "assert_unlinkable", + "line": 32, "filename": "memory_max.3.wasm", "module_type": "binary", + "text": "incompatible import type" + }, + { + "type": "assert_unlinkable", + "line": 39, + "filename": "memory_max.4.wasm", + "module_type": "binary", + "text": "incompatible import type" + }, + { + "type": "assert_invalid", + "line": 47, + "filename": "memory_max.5.wasm", + "module_type": "binary", "text": "memory size must be at most" }, { "type": "assert_invalid", - "line": 41, - "filename": "memory_max.4.wasm", + "line": 53, + "filename": "memory_max.6.wasm", "module_type": "binary", "text": "memory size must be at most" } diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/3.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/3.print index 65db9d7ac9..de4476bbda 100644 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/3.print +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/3.print @@ -1,5 +1,3 @@ (module - (type (;0;) (func)) - (import "test" "unknown" (func (;0;) (type 0))) - (memory (;0;) 65536 (pagesize 0x10000)) + (import "test" "unknown" (memory (;0;) 4294967295 (pagesize 0x1))) ) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/4.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/4.print new file mode 100644 index 0000000000..65db9d7ac9 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/4.print @@ -0,0 +1,5 @@ +(module + (type (;0;) (func)) + (import "test" "unknown" (func (;0;) (type 0))) + (memory (;0;) 65536 (pagesize 0x10000)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/5.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/5.print new file mode 100644 index 0000000000..d6a31f919b --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max.wast/5.print @@ -0,0 +1,3 @@ +(module + (import "test" "unknown" (memory (;0;) 65536 (pagesize 0x10000))) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast.json b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast.json index 6ff51fe86d..0f134f6645 100644 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast.json +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast.json @@ -17,26 +17,40 @@ "line": 19, "filename": "memory_max_i64.1.wasm", "module_type": "binary", - "text": "unknown import" + "text": "incompatible import type" }, { "type": "assert_unlinkable", "line": 26, "filename": "memory_max_i64.2.wasm", "module_type": "binary", - "text": "unknown import" + "text": "incompatible import type" + }, + { + "type": "assert_unlinkable", + "line": 32, + "filename": "memory_max_i64.3.wasm", + "module_type": "binary", + "text": "incompatible import type" + }, + { + "type": "assert_unlinkable", + "line": 39, + "filename": "memory_max_i64.4.wasm", + "module_type": "binary", + "text": "incompatible import type" }, { "type": "assert_malformed", - "line": 38, - "filename": "memory_max_i64.3.wat", + "line": 50, + "filename": "memory_max_i64.5.wat", "module_type": "text", - "text": "constant out of range" + "text": "i64 constant out of range" }, { "type": "assert_invalid", - "line": 43, - "filename": "memory_max_i64.4.wasm", + "line": 55, + "filename": "memory_max_i64.6.wasm", "module_type": "binary", "text": "memory size must be at most" } diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/2.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/2.print index d0fbfcde7d..7724ff4e0b 100644 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/2.print +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/2.print @@ -1,5 +1,5 @@ (module (type (;0;) (func)) - (import "test" "import" (func (;0;) (type 0))) + (import "test" "unknown" (func (;0;) (type 0))) (memory (;0;) i64 18446744073709551615 (pagesize 0x1)) ) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/3.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/3.print index 8f60a10b28..c8f005f9ec 100644 --- a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/3.print +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/3.print @@ -1,5 +1,3 @@ (module - (type (;0;) (func)) - (import "test" "unknown" (func (;0;) (type 0))) - (memory (;0;) i64 281474976710656 (pagesize 0x10000)) + (import "test" "unknown" (memory (;0;) i64 18446744073709551615 (pagesize 0x1))) ) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/4.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/4.print new file mode 100644 index 0000000000..8f60a10b28 --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/4.print @@ -0,0 +1,5 @@ +(module + (type (;0;) (func)) + (import "test" "unknown" (func (;0;) (type 0))) + (memory (;0;) i64 281474976710656 (pagesize 0x10000)) +) diff --git a/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/5.print b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/5.print new file mode 100644 index 0000000000..1f92985fbb --- /dev/null +++ b/tests/snapshots/testsuite/proposals/custom-page-sizes/memory_max_i64.wast/5.print @@ -0,0 +1,3 @@ +(module + (import "test" "unknown" (memory (;0;) i64 281474976710656 (pagesize 0x10000))) +) diff --git a/tests/snapshots/testsuite/relaxed_madd_nmadd.wast.json b/tests/snapshots/testsuite/relaxed_madd_nmadd.wast.json index abaf70bbb6..2d2ea57d8d 100644 --- a/tests/snapshots/testsuite/relaxed_madd_nmadd.wast.json +++ b/tests/snapshots/testsuite/relaxed_madd_nmadd.wast.json @@ -277,7 +277,7 @@ }, { "type": "assert_return", - "line": 76, + "line": 75, "action": { "type": "invoke", "field": "f64x2.relaxed_madd", @@ -334,7 +334,7 @@ }, { "type": "assert_return", - "line": 92, + "line": 91, "action": { "type": "invoke", "field": "f64x2.relaxed_madd", @@ -391,7 +391,7 @@ }, { "type": "assert_return", - "line": 99, + "line": 98, "action": { "type": "invoke", "field": "f64x2.relaxed_nmadd", @@ -448,7 +448,7 @@ }, { "type": "assert_return", - "line": 106, + "line": 105, "action": { "type": "invoke", "field": "f64x2.relaxed_nmadd", @@ -505,7 +505,7 @@ }, { "type": "assert_return", - "line": 120, + "line": 119, "action": { "type": "invoke", "field": "f32x4.relaxed_madd_cmp", @@ -557,7 +557,7 @@ }, { "type": "assert_return", - "line": 135, + "line": 134, "action": { "type": "invoke", "field": "f32x4.relaxed_madd_cmp", @@ -609,7 +609,7 @@ }, { "type": "assert_return", - "line": 141, + "line": 140, "action": { "type": "invoke", "field": "f32x4.relaxed_nmadd_cmp", @@ -661,7 +661,7 @@ }, { "type": "assert_return", - "line": 147, + "line": 146, "action": { "type": "invoke", "field": "f32x4.relaxed_nmadd_cmp", @@ -713,7 +713,7 @@ }, { "type": "assert_return", - "line": 159, + "line": 157, "action": { "type": "invoke", "field": "f64x2.relaxed_madd_cmp", @@ -757,7 +757,7 @@ }, { "type": "assert_return", - "line": 174, + "line": 172, "action": { "type": "invoke", "field": "f64x2.relaxed_madd_cmp", @@ -801,7 +801,7 @@ }, { "type": "assert_return", - "line": 180, + "line": 178, "action": { "type": "invoke", "field": "f64x2.relaxed_nmadd_cmp", @@ -845,7 +845,7 @@ }, { "type": "assert_return", - "line": 186, + "line": 184, "action": { "type": "invoke", "field": "f64x2.relaxed_nmadd_cmp", @@ -889,13 +889,13 @@ }, { "type": "module", - "line": 207, + "line": 205, "filename": "relaxed_madd_nmadd.1.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 219, + "line": 217, "action": { "type": "invoke", "field": "test-consistent-nondeterminism", diff --git a/tests/snapshots/testsuite/simd_lane.wast.json b/tests/snapshots/testsuite/simd_lane.wast.json index 744cacb6b9..e1429143c3 100644 --- a/tests/snapshots/testsuite/simd_lane.wast.json +++ b/tests/snapshots/testsuite/simd_lane.wast.json @@ -8259,7 +8259,7 @@ "line": 428, "filename": "simd_lane.28.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_invalid", @@ -8721,14 +8721,14 @@ "line": 521, "filename": "simd_lane.94.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_malformed", "line": 525, "filename": "simd_lane.95.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_invalid", @@ -8987,35 +8987,35 @@ "line": 604, "filename": "simd_lane.132.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_malformed", "line": 608, "filename": "simd_lane.133.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_malformed", "line": 612, "filename": "simd_lane.134.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_malformed", "line": 616, "filename": "simd_lane.135.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "assert_malformed", "line": 620, "filename": "simd_lane.136.wat", "module_type": "text", - "text": "i8 constant out of" + "text": "i8 constant out of range" }, { "type": "module", diff --git a/tests/snapshots/testsuite/table_init.wast.json b/tests/snapshots/testsuite/table_init.wast.json index 883ed2c185..d1e0515ca0 100644 --- a/tests/snapshots/testsuite/table_init.wast.json +++ b/tests/snapshots/testsuite/table_init.wast.json @@ -11113,6 +11113,27 @@ "line": 2128, "filename": "table_init.101.wasm", "module_type": "binary" + }, + { + "type": "module", + "line": 2152, + "filename": "table_init.102.wasm", + "module_type": "binary" + }, + { + "type": "assert_return", + "line": 2166, + "action": { + "type": "invoke", + "field": "run", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "1" + } + ] } ] } \ No newline at end of file diff --git a/tests/snapshots/testsuite/table_init.wast/780.print b/tests/snapshots/testsuite/table_init.wast/780.print new file mode 100644 index 0000000000..53c066c704 --- /dev/null +++ b/tests/snapshots/testsuite/table_init.wast/780.print @@ -0,0 +1,22 @@ +(module + (type $arr (;0;) (array (mut arrayref))) + (type (;1;) (func (result i32))) + (table $table (;0;) 2 arrayref) + (export "run" (func 0)) + (elem $elem (;0;) arrayref (item i32.const 0 array.new_default $arr)) + (func (;0;) (type 1) (result i32) + i32.const 0 + i32.const 0 + i32.const 1 + table.init $elem + i32.const 1 + i32.const 0 + i32.const 1 + table.init $elem + i32.const 0 + table.get $table + i32.const 1 + table.get $table + ref.eq + ) +) diff --git a/tests/snapshots/testsuite/try_table.wast.json b/tests/snapshots/testsuite/try_table.wast.json index a25ecd2129..7d7fe809ca 100644 --- a/tests/snapshots/testsuite/try_table.wast.json +++ b/tests/snapshots/testsuite/try_table.wast.json @@ -938,6 +938,42 @@ "filename": "try_table.15.wasm", "module_type": "binary", "text": "type mismatch" + }, + { + "type": "module", + "line": 499, + "filename": "try_table.16.wasm", + "module_type": "binary" + }, + { + "type": "assert_return", + "line": 522, + "action": { + "type": "invoke", + "field": "as-br-target", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "111" + } + ] + }, + { + "type": "assert_return", + "line": 523, + "action": { + "type": "invoke", + "field": "as-value-provider", + "args": [] + }, + "expected": [ + { + "type": "i32", + "value": "333" + } + ] } ] } \ No newline at end of file diff --git a/tests/snapshots/testsuite/try_table.wast/64.print b/tests/snapshots/testsuite/try_table.wast/64.print new file mode 100644 index 0000000000..5330b5d37f --- /dev/null +++ b/tests/snapshots/testsuite/try_table.wast/64.print @@ -0,0 +1,26 @@ +(module + (type (;0;) (func (result i32))) + (export "as-br-target" (func 0)) + (export "as-value-provider" (func 1)) + (func (;0;) (type 0) (result i32) + block ;; label = @1 + try_table ;; label = @2 + br 0 (;@2;) + unreachable + end + i32.const 111 + return + end + i32.const 222 + ) + (func (;1;) (type 0) (result i32) + block ;; label = @1 + try_table (result i32) ;; label = @2 + i32.const 333 + br 0 (;@2;) + end + return + end + unreachable + ) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast.json b/tests/snapshots/testsuite/type-subtyping.wast.json index bbbbde6019..18a8ab33d6 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast.json +++ b/tests/snapshots/testsuite/type-subtyping.wast.json @@ -107,14 +107,98 @@ "text": "type mismatch" }, { - "type": "module", - "line": 229, + "type": "assert_invalid", + "line": 230, "filename": "type-subtyping.17.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 234, + "filename": "type-subtyping.18.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 238, + "filename": "type-subtyping.19.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 242, + "filename": "type-subtyping.20.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 247, + "filename": "type-subtyping.21.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 251, + "filename": "type-subtyping.22.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 255, + "filename": "type-subtyping.23.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 259, + "filename": "type-subtyping.24.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 264, + "filename": "type-subtyping.25.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 268, + "filename": "type-subtyping.26.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 272, + "filename": "type-subtyping.27.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "assert_invalid", + "line": 276, + "filename": "type-subtyping.28.wasm", + "module_type": "binary", + "text": "type mismatch" + }, + { + "type": "module", + "line": 283, + "filename": "type-subtyping.29.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 282, + "line": 336, "action": { "type": "invoke", "field": "run", @@ -124,7 +208,7 @@ }, { "type": "assert_trap", - "line": 283, + "line": 337, "action": { "type": "invoke", "field": "fail1", @@ -134,7 +218,7 @@ }, { "type": "assert_trap", - "line": 284, + "line": 338, "action": { "type": "invoke", "field": "fail2", @@ -144,7 +228,7 @@ }, { "type": "assert_trap", - "line": 285, + "line": 339, "action": { "type": "invoke", "field": "fail3", @@ -154,7 +238,7 @@ }, { "type": "assert_trap", - "line": 286, + "line": 340, "action": { "type": "invoke", "field": "fail4", @@ -164,7 +248,7 @@ }, { "type": "assert_trap", - "line": 287, + "line": 341, "action": { "type": "invoke", "field": "fail5", @@ -174,7 +258,7 @@ }, { "type": "assert_trap", - "line": 288, + "line": 342, "action": { "type": "invoke", "field": "fail6", @@ -184,13 +268,13 @@ }, { "type": "module", - "line": 290, - "filename": "type-subtyping.18.wasm", + "line": 344, + "filename": "type-subtyping.30.wasm", "module_type": "binary" }, { "type": "assert_trap", - "line": 314, + "line": 368, "action": { "type": "invoke", "field": "fail1", @@ -200,7 +284,7 @@ }, { "type": "assert_trap", - "line": 315, + "line": 369, "action": { "type": "invoke", "field": "fail2", @@ -210,7 +294,7 @@ }, { "type": "assert_trap", - "line": 316, + "line": 370, "action": { "type": "invoke", "field": "fail3", @@ -220,7 +304,7 @@ }, { "type": "assert_trap", - "line": 317, + "line": 371, "action": { "type": "invoke", "field": "fail4", @@ -230,13 +314,13 @@ }, { "type": "module", - "line": 319, - "filename": "type-subtyping.19.wasm", + "line": 373, + "filename": "type-subtyping.31.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 344, + "line": 398, "action": { "type": "invoke", "field": "run", @@ -246,7 +330,7 @@ }, { "type": "assert_trap", - "line": 345, + "line": 399, "action": { "type": "invoke", "field": "fail1", @@ -256,7 +340,7 @@ }, { "type": "assert_trap", - "line": 346, + "line": 400, "action": { "type": "invoke", "field": "fail2", @@ -266,13 +350,13 @@ }, { "type": "module", - "line": 348, - "filename": "type-subtyping.20.wasm", + "line": 402, + "filename": "type-subtyping.32.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 358, + "line": 412, "action": { "type": "invoke", "field": "run", @@ -287,13 +371,13 @@ }, { "type": "module", - "line": 360, - "filename": "type-subtyping.21.wasm", + "line": 414, + "filename": "type-subtyping.33.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 376, + "line": 430, "action": { "type": "invoke", "field": "run", @@ -308,13 +392,13 @@ }, { "type": "module", - "line": 378, - "filename": "type-subtyping.22.wasm", + "line": 432, + "filename": "type-subtyping.34.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 388, + "line": 442, "action": { "type": "invoke", "field": "run", @@ -329,13 +413,13 @@ }, { "type": "module", - "line": 390, - "filename": "type-subtyping.23.wasm", + "line": 444, + "filename": "type-subtyping.35.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 399, + "line": 453, "action": { "type": "invoke", "field": "run", @@ -350,13 +434,13 @@ }, { "type": "module", - "line": 401, - "filename": "type-subtyping.24.wasm", + "line": 455, + "filename": "type-subtyping.36.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 419, + "line": 473, "action": { "type": "invoke", "field": "run", @@ -375,13 +459,13 @@ }, { "type": "module", - "line": 422, - "filename": "type-subtyping.25.wasm", + "line": 476, + "filename": "type-subtyping.37.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 434, + "line": 488, "action": { "type": "invoke", "field": "run", @@ -408,13 +492,13 @@ }, { "type": "module", - "line": 438, - "filename": "type-subtyping.26.wasm", + "line": 492, + "filename": "type-subtyping.38.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 456, + "line": 510, "action": { "type": "invoke", "field": "run", @@ -457,13 +541,13 @@ }, { "type": "module", - "line": 461, - "filename": "type-subtyping.27.wasm", + "line": 515, + "filename": "type-subtyping.39.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 469, + "line": 523, "action": { "type": "invoke", "field": "run", @@ -478,13 +562,13 @@ }, { "type": "module", - "line": 471, - "filename": "type-subtyping.28.wasm", + "line": 525, + "filename": "type-subtyping.40.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 480, + "line": 534, "action": { "type": "invoke", "field": "run", @@ -499,379 +583,379 @@ }, { "type": "module", - "line": 486, - "filename": "type-subtyping.29.wasm", + "line": 540, + "filename": "type-subtyping.41.wasm", "module_type": "binary" }, { "type": "register", - "line": 495, + "line": 549, "as": "M" }, { "type": "module", - "line": 497, - "filename": "type-subtyping.30.wasm", + "line": 551, + "filename": "type-subtyping.42.wasm", "module_type": "binary" }, { "type": "assert_unlinkable", - "line": 511, - "filename": "type-subtyping.31.wasm", + "line": 565, + "filename": "type-subtyping.43.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "assert_unlinkable", - "line": 521, - "filename": "type-subtyping.32.wasm", + "line": 575, + "filename": "type-subtyping.44.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "assert_unlinkable", - "line": 531, - "filename": "type-subtyping.33.wasm", + "line": 585, + "filename": "type-subtyping.45.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "module", - "line": 540, - "filename": "type-subtyping.34.wasm", + "line": 594, + "filename": "type-subtyping.46.wasm", "module_type": "binary" }, { "type": "register", - "line": 546, + "line": 600, "as": "M2" }, { "type": "assert_unlinkable", - "line": 549, - "filename": "type-subtyping.35.wasm", + "line": 603, + "filename": "type-subtyping.47.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "assert_unlinkable", - "line": 557, - "filename": "type-subtyping.36.wasm", + "line": 611, + "filename": "type-subtyping.48.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "module", - "line": 566, - "filename": "type-subtyping.37.wasm", + "line": 620, + "filename": "type-subtyping.49.wasm", "module_type": "binary" }, { "type": "register", - "line": 571, + "line": 625, "as": "M3" }, { "type": "module", - "line": 572, - "filename": "type-subtyping.38.wasm", + "line": 626, + "filename": "type-subtyping.50.wasm", "module_type": "binary" }, { "type": "module", - "line": 578, - "filename": "type-subtyping.39.wasm", + "line": 632, + "filename": "type-subtyping.51.wasm", "module_type": "binary" }, { "type": "register", - "line": 587, + "line": 641, "as": "M4" }, { "type": "module", - "line": 588, - "filename": "type-subtyping.40.wasm", + "line": 642, + "filename": "type-subtyping.52.wasm", "module_type": "binary" }, { "type": "module", - "line": 598, - "filename": "type-subtyping.41.wasm", + "line": 652, + "filename": "type-subtyping.53.wasm", "module_type": "binary" }, { "type": "register", - "line": 604, + "line": 658, "as": "M5" }, { "type": "assert_unlinkable", - "line": 606, - "filename": "type-subtyping.42.wasm", + "line": 660, + "filename": "type-subtyping.54.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "module", - "line": 614, - "filename": "type-subtyping.43.wasm", + "line": 668, + "filename": "type-subtyping.55.wasm", "module_type": "binary" }, { "type": "register", - "line": 620, + "line": 674, "as": "M6" }, { "type": "module", - "line": 621, - "filename": "type-subtyping.44.wasm", + "line": 675, + "filename": "type-subtyping.56.wasm", "module_type": "binary" }, { "type": "module", - "line": 628, - "filename": "type-subtyping.45.wasm", + "line": 682, + "filename": "type-subtyping.57.wasm", "module_type": "binary" }, { "type": "register", - "line": 638, + "line": 692, "as": "M7" }, { "type": "module", - "line": 639, - "filename": "type-subtyping.46.wasm", + "line": 693, + "filename": "type-subtyping.58.wasm", "module_type": "binary" }, { "type": "module", - "line": 652, - "filename": "type-subtyping.47.wasm", + "line": 706, + "filename": "type-subtyping.59.wasm", "module_type": "binary" }, { "type": "register", - "line": 658, + "line": 712, "as": "M8" }, { "type": "module", - "line": 659, - "filename": "type-subtyping.48.wasm", + "line": 713, + "filename": "type-subtyping.60.wasm", "module_type": "binary" }, { "type": "module", - "line": 668, - "filename": "type-subtyping.49.wasm", + "line": 722, + "filename": "type-subtyping.61.wasm", "module_type": "binary" }, { "type": "register", - "line": 676, + "line": 730, "as": "M9" }, { "type": "module", - "line": 677, - "filename": "type-subtyping.50.wasm", + "line": 731, + "filename": "type-subtyping.62.wasm", "module_type": "binary" }, { "type": "module", - "line": 692, - "filename": "type-subtyping.51.wasm", + "line": 746, + "filename": "type-subtyping.63.wasm", "module_type": "binary" }, { "type": "register", - "line": 697, + "line": 751, "as": "M10" }, { "type": "assert_unlinkable", - "line": 699, - "filename": "type-subtyping.52.wasm", + "line": 753, + "filename": "type-subtyping.64.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "module", - "line": 706, - "filename": "type-subtyping.53.wasm", + "line": 760, + "filename": "type-subtyping.65.wasm", "module_type": "binary" }, { "type": "register", - "line": 712, + "line": 766, "as": "M11" }, { "type": "assert_unlinkable", - "line": 714, - "filename": "type-subtyping.54.wasm", + "line": 768, + "filename": "type-subtyping.66.wasm", "module_type": "binary", "text": "incompatible import type" }, { "type": "assert_invalid", - "line": 727, - "filename": "type-subtyping.55.wasm", + "line": 781, + "filename": "type-subtyping.67.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 735, - "filename": "type-subtyping.56.wasm", + "line": 789, + "filename": "type-subtyping.68.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 743, - "filename": "type-subtyping.57.wasm", + "line": 797, + "filename": "type-subtyping.69.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 751, - "filename": "type-subtyping.58.wasm", + "line": 805, + "filename": "type-subtyping.70.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 764, - "filename": "type-subtyping.59.wasm", + "line": 817, + "filename": "type-subtyping.71.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 772, - "filename": "type-subtyping.60.wasm", + "line": 825, + "filename": "type-subtyping.72.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 780, - "filename": "type-subtyping.61.wasm", + "line": 833, + "filename": "type-subtyping.73.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 788, - "filename": "type-subtyping.62.wasm", + "line": 841, + "filename": "type-subtyping.74.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 796, - "filename": "type-subtyping.63.wasm", + "line": 849, + "filename": "type-subtyping.75.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 804, - "filename": "type-subtyping.64.wasm", + "line": 857, + "filename": "type-subtyping.76.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 812, - "filename": "type-subtyping.65.wasm", + "line": 865, + "filename": "type-subtyping.77.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 820, - "filename": "type-subtyping.66.wasm", + "line": 873, + "filename": "type-subtyping.78.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 828, - "filename": "type-subtyping.67.wasm", + "line": 881, + "filename": "type-subtyping.79.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 836, - "filename": "type-subtyping.68.wasm", + "line": 889, + "filename": "type-subtyping.80.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 844, - "filename": "type-subtyping.69.wasm", + "line": 897, + "filename": "type-subtyping.81.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 852, - "filename": "type-subtyping.70.wasm", + "line": 905, + "filename": "type-subtyping.82.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 860, - "filename": "type-subtyping.71.wasm", + "line": 913, + "filename": "type-subtyping.83.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 868, - "filename": "type-subtyping.72.wasm", + "line": 921, + "filename": "type-subtyping.84.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 876, - "filename": "type-subtyping.73.wasm", + "line": 929, + "filename": "type-subtyping.85.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 884, - "filename": "type-subtyping.74.wasm", + "line": 937, + "filename": "type-subtyping.86.wasm", "module_type": "binary", "text": "sub type" }, { "type": "assert_invalid", - "line": 892, - "filename": "type-subtyping.75.wasm", + "line": 945, + "filename": "type-subtyping.87.wasm", "module_type": "binary", "text": "sub type" }, { "type": "module", - "line": 901, - "filename": "type-subtyping.76.wasm", + "line": 954, + "filename": "type-subtyping.88.wasm", "module_type": "binary" }, { "type": "assert_return", - "line": 918, + "line": 971, "action": { "type": "invoke", "field": "f1", @@ -886,7 +970,7 @@ }, { "type": "assert_return", - "line": 919, + "line": 972, "action": { "type": "invoke", "field": "f2", @@ -901,7 +985,7 @@ }, { "type": "assert_return", - "line": 920, + "line": 973, "action": { "type": "invoke", "field": "f3", @@ -916,7 +1000,7 @@ }, { "type": "assert_return", - "line": 921, + "line": 974, "action": { "type": "invoke", "field": "f4", @@ -931,7 +1015,7 @@ }, { "type": "assert_return", - "line": 922, + "line": 975, "action": { "type": "invoke", "field": "f5", @@ -946,7 +1030,7 @@ }, { "type": "assert_return", - "line": 923, + "line": 976, "action": { "type": "invoke", "field": "f6", diff --git a/tests/snapshots/testsuite/type-subtyping.wast/100.print b/tests/snapshots/testsuite/type-subtyping.wast/100.print new file mode 100644 index 0000000000..0f13c2385d --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/100.print @@ -0,0 +1,11 @@ +(module + (rec + (type $f01 (;0;) (sub (func))) + (type $f02 (;1;) (sub $f01 (func))) + ) + (rec + (type $f11 (;2;) (sub (func))) + (type $f12 (;3;) (sub $f01 (func))) + ) + (import "M11" "f" (func (;0;) (type $f11))) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/110.print b/tests/snapshots/testsuite/type-subtyping.wast/122.print similarity index 100% rename from tests/snapshots/testsuite/type-subtyping.wast/110.print rename to tests/snapshots/testsuite/type-subtyping.wast/122.print diff --git a/tests/snapshots/testsuite/type-subtyping.wast/17.print b/tests/snapshots/testsuite/type-subtyping.wast/29.print similarity index 100% rename from tests/snapshots/testsuite/type-subtyping.wast/17.print rename to tests/snapshots/testsuite/type-subtyping.wast/29.print diff --git a/tests/snapshots/testsuite/type-subtyping.wast/30.print b/tests/snapshots/testsuite/type-subtyping.wast/30.print deleted file mode 100644 index cc5e46482c..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/30.print +++ /dev/null @@ -1,33 +0,0 @@ -(module - (type $t1 (;0;) (sub (func))) - (type $t2 (;1;) (sub $t1 (func))) - (type $t3 (;2;) (sub $t2 (func))) - (type $t4 (;3;) (func)) - (table (;0;) 2 2 (ref null $t2)) - (export "run" (func 2)) - (export "fail1" (func 3)) - (export "fail2" (func 4)) - (elem (;0;) (table 0) (i32.const 0) (ref null $t2) (ref.func $f2) (ref.func $f3)) - (func $f2 (;0;) (type $t2)) - (func $f3 (;1;) (type $t3)) - (func (;2;) (type $t1) - i32.const 0 - call_indirect (type $t1) - i32.const 1 - call_indirect (type $t1) - i32.const 0 - call_indirect (type $t2) - i32.const 1 - call_indirect (type $t2) - i32.const 1 - call_indirect (type $t3) - ) - (func (;3;) (type $t1) - i32.const 0 - call_indirect (type $t3) - ) - (func (;4;) (type $t1) - i32.const 0 - call_indirect (type $t4) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/34.print b/tests/snapshots/testsuite/type-subtyping.wast/34.print deleted file mode 100644 index 2a35106a41..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/34.print +++ /dev/null @@ -1,26 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f2)))) - ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (struct)) - ) - (rec - (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (struct)) - ) - (type (;8;) (func (result i32))) - (export "run" (func 1)) - (elem (;0;) declare func $g) - (func $g (;0;) (type $g2)) - (func (;1;) (type 8) (result i32) - ref.func $g - ref.test (ref $g1) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/36.print b/tests/snapshots/testsuite/type-subtyping.wast/36.print deleted file mode 100644 index 8176feb999..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/36.print +++ /dev/null @@ -1,26 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) - ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) - ) - (rec - (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) - ) - (type (;8;) (func (result i32))) - (export "run" (func 1)) - (elem (;0;) declare func $g) - (func $g (;0;) (type $g2)) - (func (;1;) (type 8) (result i32) - ref.func $g - ref.test (ref $g1) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/25.print b/tests/snapshots/testsuite/type-subtyping.wast/37.print similarity index 100% rename from tests/snapshots/testsuite/type-subtyping.wast/25.print rename to tests/snapshots/testsuite/type-subtyping.wast/37.print diff --git a/tests/snapshots/testsuite/type-subtyping.wast/38.print b/tests/snapshots/testsuite/type-subtyping.wast/38.print deleted file mode 100644 index 6ffba1e781..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/38.print +++ /dev/null @@ -1,26 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f1)))) - ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (struct)) - ) - (rec - (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (struct)) - ) - (type (;8;) (func (result i32))) - (export "run" (func 1)) - (elem (;0;) declare func $g) - (func $g (;0;) (type $g2)) - (func (;1;) (type 8) (result i32) - ref.func $g - ref.test (ref $g1) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/40.print b/tests/snapshots/testsuite/type-subtyping.wast/40.print deleted file mode 100644 index a2402f87ab..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/40.print +++ /dev/null @@ -1,22 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f2)))) - ) - (rec - (type $g (;4;) (sub $f1 (func))) - (type (;5;) (struct)) - ) - (type (;6;) (func (result i32))) - (export "run" (func 1)) - (elem (;0;) declare func $g) - (func $g (;0;) (type $g)) - (func (;1;) (type 6) (result i32) - ref.func $g - ref.test (ref $f1) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/42.print b/tests/snapshots/testsuite/type-subtyping.wast/42.print index e216c696ba..cc5e46482c 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/42.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/42.print @@ -1,32 +1,33 @@ (module - (rec - (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) + (type $t1 (;0;) (sub (func))) + (type $t2 (;1;) (sub $t1 (func))) + (type $t3 (;2;) (sub $t2 (func))) + (type $t4 (;3;) (func)) + (table (;0;) 2 2 (ref null $t2)) + (export "run" (func 2)) + (export "fail1" (func 3)) + (export "fail2" (func 4)) + (elem (;0;) (table 0) (i32.const 0) (ref null $t2) (ref.func $f2) (ref.func $f3)) + (func $f2 (;0;) (type $t2)) + (func $f3 (;1;) (type $t3)) + (func (;2;) (type $t1) + i32.const 0 + call_indirect (type $t1) + i32.const 1 + call_indirect (type $t1) + i32.const 0 + call_indirect (type $t2) + i32.const 1 + call_indirect (type $t2) + i32.const 1 + call_indirect (type $t3) ) - (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) + (func (;3;) (type $t1) + i32.const 0 + call_indirect (type $t3) ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) - ) - (rec - (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) - ) - (rec - (type $h (;8;) (sub $g2 (func))) - (type (;9;) (struct)) - ) - (type (;10;) (func (result i32 i32))) - (export "run" (func 1)) - (elem (;0;) declare func $h) - (func $h (;0;) (type $h)) - (func (;1;) (type 10) (result i32 i32) - ref.func $h - ref.test (ref $f1) - ref.func $h - ref.test (ref $g1) + (func (;4;) (type $t1) + i32.const 0 + call_indirect (type $t4) ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/44.print b/tests/snapshots/testsuite/type-subtyping.wast/44.print deleted file mode 100644 index c9fae9e43d..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/44.print +++ /dev/null @@ -1,30 +0,0 @@ -(module - (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) - ) - (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) - ) - (type (;4;) (func (result i32 i32 i32 i32))) - (export "run" (func 2)) - (elem (;0;) declare func $f11) - (elem (;1;) declare func $f12) - (func $f11 (;0;) (type $f11) (result (ref func)) - unreachable - ) - (func $f12 (;1;) (type $f12) (result (ref $f11)) - unreachable - ) - (func (;2;) (type 4) (result i32 i32 i32 i32) - ref.func $f11 - ref.test (ref $f11) - ref.func $f11 - ref.test (ref $f21) - ref.func $f12 - ref.test (ref $f12) - ref.func $f12 - ref.test (ref $f22) - ) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/46.print b/tests/snapshots/testsuite/type-subtyping.wast/46.print index da182e8031..2a35106a41 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/46.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/46.print @@ -1,46 +1,26 @@ (module (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f2)))) ) (rec - (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (struct)) ) (rec - (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) + (type $g2 (;6;) (sub $f2 (func))) + (type (;7;) (struct)) ) - (type (;8;) (func (result i32 i32 i32 i32 i32 i32 i32 i32))) - (export "run" (func 2)) - (elem (;0;) declare func $g11) - (elem (;1;) declare func $g12) - (func $g11 (;0;) (type $g11) (result (ref func)) - unreachable - ) - (func $g12 (;1;) (type $g12) (result (ref $g11)) - unreachable - ) - (func (;2;) (type 8) (result i32 i32 i32 i32 i32 i32 i32 i32) - ref.func $g11 - ref.test (ref $f11) - ref.func $g11 - ref.test (ref $f21) - ref.func $g12 - ref.test (ref $f11) - ref.func $g12 - ref.test (ref $f21) - ref.func $g11 - ref.test (ref $g11) - ref.func $g11 - ref.test (ref $g21) - ref.func $g12 - ref.test (ref $g12) - ref.func $g12 - ref.test (ref $g22) + (type (;8;) (func (result i32))) + (export "run" (func 1)) + (elem (;0;) declare func $g) + (func $g (;0;) (type $g2)) + (func (;1;) (type 8) (result i32) + ref.func $g + ref.test (ref $g1) ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/48.print b/tests/snapshots/testsuite/type-subtyping.wast/48.print index f1868bd768..8176feb999 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/48.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/48.print @@ -1,18 +1,26 @@ (module (rec - (type $f11 (;0;) (sub (func))) - (type $f12 (;1;) (sub $f11 (func))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $f21 (;2;) (sub (func))) - (type $f22 (;3;) (sub $f11 (func))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) - (type (;4;) (func (result i32))) + (rec + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) + ) + (rec + (type $g2 (;6;) (sub $f2 (func))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) + ) + (type (;8;) (func (result i32))) (export "run" (func 1)) - (elem (;0;) declare func $f) - (func $f (;0;) (type $f21)) - (func (;1;) (type 4) (result i32) - ref.func $f - ref.test (ref $f11) + (elem (;0;) declare func $g) + (func $g (;0;) (type $g2)) + (func (;1;) (type 8) (result i32) + ref.func $g + ref.test (ref $g1) ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/50.print b/tests/snapshots/testsuite/type-subtyping.wast/50.print index e86353cb45..6ffba1e781 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/50.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/50.print @@ -1,22 +1,26 @@ (module (rec - (type $f01 (;0;) (sub (func))) - (type $f02 (;1;) (sub $f01 (func))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f11 (;2;) (sub (func))) - (type $f12 (;3;) (sub $f01 (func))) + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f1)))) ) (rec - (type $f21 (;4;) (sub (func))) - (type $f22 (;5;) (sub $f11 (func))) + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (struct)) ) - (type (;6;) (func (result i32))) + (rec + (type $g2 (;6;) (sub $f2 (func))) + (type (;7;) (struct)) + ) + (type (;8;) (func (result i32))) (export "run" (func 1)) - (elem (;0;) declare func $f) - (func $f (;0;) (type $f21)) - (func (;1;) (type 6) (result i32) - ref.func $f - ref.test (ref $f11) + (elem (;0;) declare func $g) + (func $g (;0;) (type $g2)) + (func (;1;) (type 8) (result i32) + ref.func $g + ref.test (ref $g1) ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/52.print b/tests/snapshots/testsuite/type-subtyping.wast/52.print index 7b1919bed3..a2402f87ab 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/52.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/52.print @@ -1,21 +1,22 @@ (module - (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f2)))) ) - (export "f0" (func 0)) - (export "f1" (func 1)) - (export "f2" (func 2)) - (func (;0;) (type $t0) (result funcref) - ref.null func - ) - (func (;1;) (type $t1) (result (ref null $t1)) - ref.null $t1 + (rec + (type $g (;4;) (sub $f1 (func))) + (type (;5;) (struct)) ) - (func (;2;) (type $t2) (result (ref null $t2)) - ref.null $t2 + (type (;6;) (func (result i32))) + (export "run" (func 1)) + (elem (;0;) declare func $g) + (func $g (;0;) (type $g)) + (func (;1;) (type 6) (result i32) + ref.func $g + ref.test (ref $f1) ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/54.print b/tests/snapshots/testsuite/type-subtyping.wast/54.print index a318aa0c18..e216c696ba 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/54.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/54.print @@ -1,15 +1,32 @@ (module - (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) + ) + (rec + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) + ) + (rec + (type $g2 (;6;) (sub $f2 (func))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) + ) + (rec + (type $h (;8;) (sub $g2 (func))) + (type (;9;) (struct)) + ) + (type (;10;) (func (result i32 i32))) + (export "run" (func 1)) + (elem (;0;) declare func $h) + (func $h (;0;) (type $h)) + (func (;1;) (type 10) (result i32 i32) + ref.func $h + ref.test (ref $f1) + ref.func $h + ref.test (ref $g1) ) - (import "M" "f0" (func (;0;) (type $t0))) - (import "M" "f1" (func (;1;) (type $t0))) - (import "M" "f1" (func (;2;) (type $t1))) - (import "M" "f2" (func (;3;) (type $t0))) - (import "M" "f2" (func (;4;) (type $t1))) - (import "M" "f2" (func (;5;) (type $t2))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/55.print b/tests/snapshots/testsuite/type-subtyping.wast/55.print deleted file mode 100644 index 5964b91e55..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/55.print +++ /dev/null @@ -1,10 +0,0 @@ -(module - (type $t0 (;0;) (sub (func (result funcref)))) - (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) - ) - (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) - ) - (import "M" "f0" (func (;0;) (type $t1))) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/56.print b/tests/snapshots/testsuite/type-subtyping.wast/56.print index 7014486db3..c9fae9e43d 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/56.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/56.print @@ -1,10 +1,30 @@ (module - (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (type (;4;) (func (result i32 i32 i32 i32))) + (export "run" (func 2)) + (elem (;0;) declare func $f11) + (elem (;1;) declare func $f12) + (func $f11 (;0;) (type $f11) (result (ref func)) + unreachable + ) + (func $f12 (;1;) (type $f12) (result (ref $f11)) + unreachable + ) + (func (;2;) (type 4) (result i32 i32 i32 i32) + ref.func $f11 + ref.test (ref $f11) + ref.func $f11 + ref.test (ref $f21) + ref.func $f12 + ref.test (ref $f12) + ref.func $f12 + ref.test (ref $f22) ) - (import "M" "f0" (func (;0;) (type $t2))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/58.print b/tests/snapshots/testsuite/type-subtyping.wast/58.print index 4fd6647b51..da182e8031 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/58.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/58.print @@ -1,8 +1,46 @@ (module - (type $t1 (;0;) (sub (func))) - (type $t2 (;1;) (func)) - (export "f1" (func 0)) - (export "f2" (func 1)) - (func (;0;) (type $t1)) - (func (;1;) (type $t2)) + (rec + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + ) + (rec + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (rec + (type $g11 (;4;) (sub $f11 (func (result (ref func))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) + ) + (rec + (type $g21 (;6;) (sub $f21 (func (result (ref func))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) + ) + (type (;8;) (func (result i32 i32 i32 i32 i32 i32 i32 i32))) + (export "run" (func 2)) + (elem (;0;) declare func $g11) + (elem (;1;) declare func $g12) + (func $g11 (;0;) (type $g11) (result (ref func)) + unreachable + ) + (func $g12 (;1;) (type $g12) (result (ref $g11)) + unreachable + ) + (func (;2;) (type 8) (result i32 i32 i32 i32 i32 i32 i32 i32) + ref.func $g11 + ref.test (ref $f11) + ref.func $g11 + ref.test (ref $f21) + ref.func $g12 + ref.test (ref $f11) + ref.func $g12 + ref.test (ref $f21) + ref.func $g11 + ref.test (ref $g11) + ref.func $g11 + ref.test (ref $g21) + ref.func $g12 + ref.test (ref $g12) + ref.func $g12 + ref.test (ref $g22) + ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/60.print b/tests/snapshots/testsuite/type-subtyping.wast/60.print index 979e7f76b6..f1868bd768 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/60.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/60.print @@ -1,5 +1,18 @@ (module - (type $t1 (;0;) (sub (func))) - (type $t2 (;1;) (func)) - (import "M2" "f1" (func (;0;) (type $t2))) + (rec + (type $f11 (;0;) (sub (func))) + (type $f12 (;1;) (sub $f11 (func))) + ) + (rec + (type $f21 (;2;) (sub (func))) + (type $f22 (;3;) (sub $f11 (func))) + ) + (type (;4;) (func (result i32))) + (export "run" (func 1)) + (elem (;0;) declare func $f) + (func $f (;0;) (type $f21)) + (func (;1;) (type 4) (result i32) + ref.func $f + ref.test (ref $f11) + ) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/62.print b/tests/snapshots/testsuite/type-subtyping.wast/62.print index 01474d2e24..e86353cb45 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/62.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/62.print @@ -1,12 +1,22 @@ (module (rec - (type $f2 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f2)))) + (type $f01 (;0;) (sub (func))) + (type $f02 (;1;) (sub $f01 (func))) ) (rec - (type $g2 (;2;) (sub $f2 (func))) - (type (;3;) (struct)) + (type $f11 (;2;) (sub (func))) + (type $f12 (;3;) (sub $f01 (func))) + ) + (rec + (type $f21 (;4;) (sub (func))) + (type $f22 (;5;) (sub $f11 (func))) + ) + (type (;6;) (func (result i32))) + (export "run" (func 1)) + (elem (;0;) declare func $f) + (func $f (;0;) (type $f21)) + (func (;1;) (type 6) (result i32) + ref.func $f + ref.test (ref $f11) ) - (export "g" (func 0)) - (func (;0;) (type $g2)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/64.print b/tests/snapshots/testsuite/type-subtyping.wast/64.print index b1917adb71..7b1919bed3 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/64.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/64.print @@ -1,11 +1,21 @@ (module + (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $g1 (;2;) (sub $f1 (func))) - (type (;3;) (struct)) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) + ) + (export "f0" (func 0)) + (export "f1" (func 1)) + (export "f2" (func 2)) + (func (;0;) (type $t0) (result funcref) + ref.null func + ) + (func (;1;) (type $t1) (result (ref null $t1)) + ref.null $t1 + ) + (func (;2;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) - (import "M3" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/65.print b/tests/snapshots/testsuite/type-subtyping.wast/65.print deleted file mode 100644 index b58299ea5c..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/65.print +++ /dev/null @@ -1,16 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) - ) - (rec - (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) - ) - (export "g" (func 0)) - (func (;0;) (type $g2)) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/66.print b/tests/snapshots/testsuite/type-subtyping.wast/66.print new file mode 100644 index 0000000000..a318aa0c18 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/66.print @@ -0,0 +1,15 @@ +(module + (type $t0 (;0;) (sub (func (result funcref)))) + (rec + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) + ) + (rec + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) + ) + (import "M" "f0" (func (;0;) (type $t0))) + (import "M" "f1" (func (;1;) (type $t0))) + (import "M" "f1" (func (;2;) (type $t1))) + (import "M" "f2" (func (;3;) (type $t0))) + (import "M" "f2" (func (;4;) (type $t1))) + (import "M" "f2" (func (;5;) (type $t2))) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/67.print b/tests/snapshots/testsuite/type-subtyping.wast/67.print index d64d1bd057..5964b91e55 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/67.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/67.print @@ -1,15 +1,10 @@ (module + (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) - ) - (import "M4" "g" (func (;0;) (type $g1))) + (import "M" "f0" (func (;0;) (type $t1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/68.print b/tests/snapshots/testsuite/type-subtyping.wast/68.print index 26d9bf3393..7014486db3 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/68.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/68.print @@ -1,16 +1,10 @@ (module + (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f1)))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) - (rec - (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (struct)) - ) - (export "g" (func 0)) - (func (;0;) (type $g2)) + (import "M" "f0" (func (;0;) (type $t2))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/57.print b/tests/snapshots/testsuite/type-subtyping.wast/69.print similarity index 100% rename from tests/snapshots/testsuite/type-subtyping.wast/57.print rename to tests/snapshots/testsuite/type-subtyping.wast/69.print diff --git a/tests/snapshots/testsuite/type-subtyping.wast/70.print b/tests/snapshots/testsuite/type-subtyping.wast/70.print index 1ce54b4529..4fd6647b51 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/70.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/70.print @@ -1,11 +1,8 @@ (module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $g1 (;2;) (sub $f1 (func))) - (type (;3;) (struct)) - ) - (import "M5" "g" (func (;0;) (type $g1))) + (type $t1 (;0;) (sub (func))) + (type $t2 (;1;) (func)) + (export "f1" (func 0)) + (export "f2" (func 1)) + (func (;0;) (type $t1)) + (func (;1;) (type $t2)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/71.print b/tests/snapshots/testsuite/type-subtyping.wast/71.print deleted file mode 100644 index 0dda8366d8..0000000000 --- a/tests/snapshots/testsuite/type-subtyping.wast/71.print +++ /dev/null @@ -1,16 +0,0 @@ -(module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f2)))) - ) - (rec - (type $g (;4;) (sub $f1 (func))) - (type (;5;) (struct)) - ) - (export "g" (func 0)) - (func (;0;) (type $g)) -) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/61.print b/tests/snapshots/testsuite/type-subtyping.wast/72.print similarity index 60% rename from tests/snapshots/testsuite/type-subtyping.wast/61.print rename to tests/snapshots/testsuite/type-subtyping.wast/72.print index 9c4cd5d2a9..979e7f76b6 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/61.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/72.print @@ -1,5 +1,5 @@ (module (type $t1 (;0;) (sub (func))) (type $t2 (;1;) (func)) - (import "M2" "f2" (func (;0;) (type $t1))) + (import "M2" "f1" (func (;0;) (type $t2))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/73.print b/tests/snapshots/testsuite/type-subtyping.wast/73.print index 4b741c2aa1..9c4cd5d2a9 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/73.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/73.print @@ -1,15 +1,5 @@ (module - (rec - (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref $f1)))) - ) - (rec - (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref $f2)))) - ) - (rec - (type $g (;4;) (sub $f1 (func))) - (type (;5;) (struct)) - ) - (import "M6" "g" (func (;0;) (type $f1))) + (type $t1 (;0;) (sub (func))) + (type $t2 (;1;) (func)) + (import "M2" "f2" (func (;0;) (type $t1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/74.print b/tests/snapshots/testsuite/type-subtyping.wast/74.print index 3552c862df..01474d2e24 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/74.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/74.print @@ -1,20 +1,12 @@ (module (rec - (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) + (type $f2 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f2)))) ) (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) + (type $g2 (;2;) (sub $f2 (func))) + (type (;3;) (struct)) ) - (rec - (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) - ) - (rec - (type $h (;6;) (sub $g2 (func))) - (type (;7;) (struct)) - ) - (export "h" (func 0)) - (func (;0;) (type $h)) + (export "g" (func 0)) + (func (;0;) (type $g2)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/76.print b/tests/snapshots/testsuite/type-subtyping.wast/76.print index da941728e4..b1917adb71 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/76.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/76.print @@ -1,20 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref $f1))))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref $f2))))) + (type $g1 (;2;) (sub $f1 (func))) + (type (;3;) (struct)) ) - (rec - (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) - ) - (rec - (type $h (;6;) (sub $g1 (func))) - (type (;7;) (struct)) - ) - (import "M7" "h" (func (;0;) (type $f1))) - (import "M7" "h" (func (;1;) (type $g1))) + (import "M3" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/77.print b/tests/snapshots/testsuite/type-subtyping.wast/77.print index 4e5e40a636..b58299ea5c 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/77.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/77.print @@ -1,18 +1,16 @@ (module (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) - (export "f11" (func 0)) - (export "f12" (func 1)) - (func (;0;) (type $f11) (result (ref func)) - unreachable - ) - (func (;1;) (type $f12) (result (ref $f11)) - unreachable + (rec + (type $g2 (;4;) (sub $f2 (func))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) + (export "g" (func 0)) + (func (;0;) (type $g2)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/79.print b/tests/snapshots/testsuite/type-subtyping.wast/79.print index 5b4d259355..d64d1bd057 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/79.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/79.print @@ -1,14 +1,15 @@ (module (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) - (import "M8" "f11" (func (;0;) (type $f11))) - (import "M8" "f11" (func (;1;) (type $f21))) - (import "M8" "f12" (func (;2;) (type $f12))) - (import "M8" "f12" (func (;3;) (type $f22))) + (rec + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) + ) + (import "M4" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/80.print b/tests/snapshots/testsuite/type-subtyping.wast/80.print index 05b9e26836..26d9bf3393 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/80.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/80.print @@ -1,26 +1,16 @@ (module (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f1)))) ) (rec - (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) - ) - (rec - (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) - ) - (export "g11" (func 0)) - (export "g12" (func 1)) - (func (;0;) (type $g11) (result (ref func)) - unreachable - ) - (func (;1;) (type $g12) (result (ref $g11)) - unreachable + (type $g2 (;4;) (sub $f2 (func))) + (type (;5;) (struct)) ) + (export "g" (func 0)) + (func (;0;) (type $g2)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/82.print b/tests/snapshots/testsuite/type-subtyping.wast/82.print index 6aeee7012c..1ce54b4529 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/82.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/82.print @@ -1,26 +1,11 @@ (module (rec - (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + (type $g1 (;2;) (sub $f1 (func))) + (type (;3;) (struct)) ) - (rec - (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) - ) - (rec - (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) - ) - (import "M9" "g11" (func (;0;) (type $f11))) - (import "M9" "g11" (func (;1;) (type $f21))) - (import "M9" "g12" (func (;2;) (type $f11))) - (import "M9" "g12" (func (;3;) (type $f21))) - (import "M9" "g11" (func (;4;) (type $g11))) - (import "M9" "g11" (func (;5;) (type $g21))) - (import "M9" "g12" (func (;6;) (type $g12))) - (import "M9" "g12" (func (;7;) (type $g22))) + (import "M5" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/83.print b/tests/snapshots/testsuite/type-subtyping.wast/83.print index 752d548a65..0dda8366d8 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/83.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/83.print @@ -1,12 +1,16 @@ (module (rec - (type $f11 (;0;) (sub (func))) - (type $f12 (;1;) (sub $f11 (func))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) (rec - (type $f21 (;2;) (sub (func))) - (type $f22 (;3;) (sub $f11 (func))) + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f2)))) ) - (export "f" (func 0)) - (func (;0;) (type $f21)) + (rec + (type $g (;4;) (sub $f1 (func))) + (type (;5;) (struct)) + ) + (export "g" (func 0)) + (func (;0;) (type $g)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/85.print b/tests/snapshots/testsuite/type-subtyping.wast/85.print index ac1e29d261..4b741c2aa1 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/85.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/85.print @@ -1,7 +1,15 @@ (module (rec - (type $f11 (;0;) (sub (func))) - (type $f12 (;1;) (sub $f11 (func))) + (type $f1 (;0;) (sub (func))) + (type (;1;) (struct (field (ref $f1)))) ) - (import "M10" "f" (func (;0;) (type $f11))) + (rec + (type $f2 (;2;) (sub (func))) + (type (;3;) (struct (field (ref $f2)))) + ) + (rec + (type $g (;4;) (sub $f1 (func))) + (type (;5;) (struct)) + ) + (import "M6" "g" (func (;0;) (type $f1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/86.print b/tests/snapshots/testsuite/type-subtyping.wast/86.print index 1333a6d633..3552c862df 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/86.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/86.print @@ -1,16 +1,20 @@ (module (rec - (type $f01 (;0;) (sub (func))) - (type $f02 (;1;) (sub $f01 (func))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $f11 (;2;) (sub (func))) - (type $f12 (;3;) (sub $f01 (func))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec - (type $f21 (;4;) (sub (func))) - (type $f22 (;5;) (sub $f11 (func))) + (type $g2 (;4;) (sub $f2 (func))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) - (export "f" (func 0)) - (func (;0;) (type $f21)) + (rec + (type $h (;6;) (sub $g2 (func))) + (type (;7;) (struct)) + ) + (export "h" (func 0)) + (func (;0;) (type $h)) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/88.print b/tests/snapshots/testsuite/type-subtyping.wast/88.print index 0f13c2385d..da941728e4 100644 --- a/tests/snapshots/testsuite/type-subtyping.wast/88.print +++ b/tests/snapshots/testsuite/type-subtyping.wast/88.print @@ -1,11 +1,20 @@ (module (rec - (type $f01 (;0;) (sub (func))) - (type $f02 (;1;) (sub $f01 (func))) + (type $f1 (;0;) (sub (func))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec - (type $f11 (;2;) (sub (func))) - (type $f12 (;3;) (sub $f01 (func))) + (type $f2 (;2;) (sub (func))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) - (import "M11" "f" (func (;0;) (type $f11))) + (rec + (type $g1 (;4;) (sub $f1 (func))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) + ) + (rec + (type $h (;6;) (sub $g1 (func))) + (type (;7;) (struct)) + ) + (import "M7" "h" (func (;0;) (type $f1))) + (import "M7" "h" (func (;1;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/89.print b/tests/snapshots/testsuite/type-subtyping.wast/89.print new file mode 100644 index 0000000000..4e5e40a636 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/89.print @@ -0,0 +1,18 @@ +(module + (rec + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + ) + (rec + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (export "f11" (func 0)) + (export "f12" (func 1)) + (func (;0;) (type $f11) (result (ref func)) + unreachable + ) + (func (;1;) (type $f12) (result (ref $f11)) + unreachable + ) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/91.print b/tests/snapshots/testsuite/type-subtyping.wast/91.print new file mode 100644 index 0000000000..5b4d259355 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/91.print @@ -0,0 +1,14 @@ +(module + (rec + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + ) + (rec + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (import "M8" "f11" (func (;0;) (type $f11))) + (import "M8" "f11" (func (;1;) (type $f21))) + (import "M8" "f12" (func (;2;) (type $f12))) + (import "M8" "f12" (func (;3;) (type $f22))) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/92.print b/tests/snapshots/testsuite/type-subtyping.wast/92.print new file mode 100644 index 0000000000..05b9e26836 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/92.print @@ -0,0 +1,26 @@ +(module + (rec + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + ) + (rec + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (rec + (type $g11 (;4;) (sub $f11 (func (result (ref func))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) + ) + (rec + (type $g21 (;6;) (sub $f21 (func (result (ref func))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) + ) + (export "g11" (func 0)) + (export "g12" (func 1)) + (func (;0;) (type $g11) (result (ref func)) + unreachable + ) + (func (;1;) (type $g12) (result (ref $g11)) + unreachable + ) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/94.print b/tests/snapshots/testsuite/type-subtyping.wast/94.print new file mode 100644 index 0000000000..6aeee7012c --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/94.print @@ -0,0 +1,26 @@ +(module + (rec + (type $f11 (;0;) (sub (func (result (ref func))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) + ) + (rec + (type $f21 (;2;) (sub (func (result (ref func))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) + ) + (rec + (type $g11 (;4;) (sub $f11 (func (result (ref func))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) + ) + (rec + (type $g21 (;6;) (sub $f21 (func (result (ref func))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) + ) + (import "M9" "g11" (func (;0;) (type $f11))) + (import "M9" "g11" (func (;1;) (type $f21))) + (import "M9" "g12" (func (;2;) (type $f11))) + (import "M9" "g12" (func (;3;) (type $f21))) + (import "M9" "g11" (func (;4;) (type $g11))) + (import "M9" "g11" (func (;5;) (type $g21))) + (import "M9" "g12" (func (;6;) (type $g12))) + (import "M9" "g12" (func (;7;) (type $g22))) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/95.print b/tests/snapshots/testsuite/type-subtyping.wast/95.print new file mode 100644 index 0000000000..752d548a65 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/95.print @@ -0,0 +1,12 @@ +(module + (rec + (type $f11 (;0;) (sub (func))) + (type $f12 (;1;) (sub $f11 (func))) + ) + (rec + (type $f21 (;2;) (sub (func))) + (type $f22 (;3;) (sub $f11 (func))) + ) + (export "f" (func 0)) + (func (;0;) (type $f21)) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/97.print b/tests/snapshots/testsuite/type-subtyping.wast/97.print new file mode 100644 index 0000000000..ac1e29d261 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/97.print @@ -0,0 +1,7 @@ +(module + (rec + (type $f11 (;0;) (sub (func))) + (type $f12 (;1;) (sub $f11 (func))) + ) + (import "M10" "f" (func (;0;) (type $f11))) +) diff --git a/tests/snapshots/testsuite/type-subtyping.wast/98.print b/tests/snapshots/testsuite/type-subtyping.wast/98.print new file mode 100644 index 0000000000..1333a6d633 --- /dev/null +++ b/tests/snapshots/testsuite/type-subtyping.wast/98.print @@ -0,0 +1,16 @@ +(module + (rec + (type $f01 (;0;) (sub (func))) + (type $f02 (;1;) (sub $f01 (func))) + ) + (rec + (type $f11 (;2;) (sub (func))) + (type $f12 (;3;) (sub $f01 (func))) + ) + (rec + (type $f21 (;4;) (sub (func))) + (type $f22 (;5;) (sub $f11 (func))) + ) + (export "f" (func 0)) + (func (;0;) (type $f21)) +) diff --git a/tests/testsuite b/tests/testsuite index e999a10519..51279a9d02 160000 --- a/tests/testsuite +++ b/tests/testsuite @@ -1 +1 @@ -Subproject commit e999a1051925895022ab06abc25b23ca300ab0d0 +Subproject commit 51279a9d02cbba193cb25142d115388d7b83299c From 27879fe27d0431e66542eaf09cbd798d26b2c1d4 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Apr 2026 08:05:30 -0700 Subject: [PATCH 2/2] Fix warnings --- src/bin/wasm-tools/wast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/wasm-tools/wast.rs b/src/bin/wasm-tools/wast.rs index a4fc836cd0..9c0fea6cda 100644 --- a/src/bin/wasm-tools/wast.rs +++ b/src/bin/wasm-tools/wast.rs @@ -268,7 +268,7 @@ impl Opts { } WastDirective::AssertMalformedCustom { - span, + span: _, mut module, message, } => match module.encode() { @@ -313,7 +313,7 @@ impl Opts { WastDirective::AssertInvalidCustom { mut module, - message, + message: _, span: _, } => { let binary_wasm = module.encode()?;