summaryrefslogtreecommitdiff
path: root/test/roundtrip
Commit message (Collapse)AuthorAgeFilesLines
* binary/wat: Implement EHv4 (#2470)Soni L.2024-11-203-3/+86
| | | | This pull request implements EHv4. Binary is mostly untested until interp is working.
* Add support for the custom-page-sizes proposal (#2502)Keith Winstein2024-11-081-0/+91
| | | | This adds support in the binary/text parsers and writers, the validator and interpreter, and objdump (but not wasm2c).
* Implement custom section reading/writing (#2284)Diego Frias2023-09-151-0/+13
|
* Always do a full roundtrip in run-roundtrip.py (#1661)Sam Clegg2023-02-282-3/+4
| | | | | | | | | | | | | | | | Even when the result is to be printed rather than compared byte for byte with the first version its still good to process the resulting wat output file so that we know we can parse what we generate. Case in point, this changed caused me to fix two latent bugs: 1. We were not correctly parsing events with inline import/export. 2. We were output element segment names even when bulk memory was not enabled (See #1651) The fix for (2) is a little more involved that we might like since for the first time the wat writer needs to know what features are enabled. Fixes: #1651
* BinaryReaderIR: set name of type if given in name section (#1996)Keith Winstein2022-09-181-0/+2
| | | | Fixes #1687
* Allow Code Metadata Annotations to have arbitrary hex strings (#1876)Jacob Abraham2022-08-161-1/+1
|
* Verify that alignment in SIMD load/store lane roundtrips (#1649)Alex Crichton2022-08-161-0/+37
|
* Implement \u{hex} escape parsing (#1909)Zoltan Herczeg2022-05-021-0/+17
| | | | | Support \u{hex} escape sequences for string literals. These literals are converted to UTF-8 characters.
* Add initial support for code metadata (#1840)Yuri Iozzelli2022-02-251-0/+8
| | | | | | | | | | | | | | | | | | | | | See https://github.com/WebAssembly/tool-conventions/blob/main/CodeMetadata.md for the specification. In particular this pr implements the following: - Parsing code metadata sections in BinaryReader, providing appropriate callbacks that a BinaryReaderDelegate can implement: - BinaryReaderObjdump: show the sections in a human-readable form - BinaryReaderIr: add code metadata in the IR as expressions - Parsing code metadata annotations in text format, adding them in the IR like the BinaryReaderIR does - Writing the code metadata present in the IR in the proper sections when converting IR to binary - Support in wasm-decompiler for showing code metadata as comments in the pseudo-code All the features have corresponding tests. Support for code metadata is gated through the --enable-code-metadata feature. For reading/writing in the text format, --enable-annotations is also required. Missing features: Support for function-level code metadata (offset 0) Extensive validation in validator.cc (like making sure that all metadata instances are at the same code offset of an instruction)
* Added support for multi-memory in apply-names (#1810)Yuhan Deng2022-02-172-3/+28
|
* Finish instruction renaming (#1792)Heejin Ahn2021-12-2030-81/+81
| | | | | | | | | | | | | This finishes #985. This - replaces the old names in the tests with the new names - drops support for the deprecated names - renames test files to match new instruction names I don't think dropping support for the old names will be a problem at this point. #985 says the old names are supported for convenience but we should remove those too at some point; that "some point" may have well arrived given that three years have passed. The lists of names updated are in #933, #1564, WebAssembly/spec#720.
* Fix type names for function references (#1787)Sam Clegg2021-12-131-5/+5
| | | | | | | | This requires `Type::GetName` to return to be dynamicllay created and return `std::string` rather then a `const char*` As this diff shows this type name is only used in textual output and error messages so should this change should not have a effect of binary parse time or the interpreter.
* Support function references in parameters and results of functions and ↵Dmitry Bezhetskov2021-11-161-0/+97
| | | | blocks. (#1695)
* Enable reference types by default (#1729)Sam Clegg2021-10-137-7/+7
| | | | | | | | | This features was finished earlier this year: https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md One thing to note is that the version of the spec tests we currently have in third_party/testsuite doesn't have ref types merged yet so this change disables ref types when running some of those tests. This can be removed in a followup when we update the testsuite.
* Enable bulk memory by default (#1728)Sam Clegg2021-10-135-5/+4
| | | | | | | | | | | This features was finished earlier this year: https://github.com/WebAssembly/proposals/blob/master/finished-proposals.md One thing to note is that the version of the spec tests we currently have in third_party/testsuite doesn't have bulk memory merged yet so this change disables bulk memory when running some of those tests. This will be removed in a followup when we update the testsuite. Fixes: #1717
* SIMD is now phase 5, enable it by default (#1712)Ng Zhi An2021-09-202-2/+2
| | | | | * SIMD is now phase 5, enable it by default * Update test flags, rebase test, and docs
* Begin support for typed function references proposal: added the flag and ↵Dmitry Bezhetskov2021-07-251-0/+64
| | | | supported call_ref (#1691)
* Allow plain `try` with no `catch` or `delegate` (#1676)Asumu Takikawa2021-06-291-0/+8
| | | | | | Matches recent changes in the exception handling spec that allowed this case to reduce special cases in the syntax: https://github.com/WebAssembly/exception-handling/pull/157
* [EH] Remove `unwind` (#1682)Heejin Ahn2021-06-291-25/+0
| | | `unwind` was removed. See WebAssembly/exception-handling#156.
* Fix try-delegate label printing (#1685)Asumu Takikawa2021-06-291-0/+29
| | | | | | | This is similar to a previous bug (#1609) for other kinds of block labels. The tests check that 2+ adjacent try-delegate blocks will have labels that print correctly. (split from #1675)
* [EH] Replace event with tag (#1678)Heejin Ahn2021-06-226-15/+15
| | | | | | | | | | | We recently decided to change 'event' to 'tag', and 'event section' to 'tag section', out of the rationale that the section contains a generalized tag that references a type, which may be used for something other than exceptions, and the name 'event' can be confusing in the web context. See - https://github.com/WebAssembly/exception-handling/issues/159#issuecomment-857910130 - https://github.com/WebAssembly/exception-handling/pull/161
* [Memory64] Support reading/writing limits as 64-bit LEBs (#1664)Wouter van Oortmerssen2021-04-222-0/+16
|
* Add more support to extended names section. (#1659)Sam Clegg2021-04-071-1/+5
| | | I noticed we lacked support here while debugging #1651.
* [simd] Rename widen to extend, implement some double precision ops (#1633)Ng Zhi An2021-03-111-16/+16
| | | | | | | | | | | | 4 double precision conversion instructions are implemented: - f32x4.demote_f64x2_zero - f64x2.demote_low_f32x4 - f64x2.convert_low_i32x4_s - f64x2.convert_low_i32x4_u This is now sufficient to unskip simd_conversions.txt. Rebase a bunch of tests due to the rename from widen to extend.
* [simd] Rename any_true, implement i64x2 bitmask and all_true (#1624)Ng Zhi An2021-03-041-12/+4
| | | | | | | | | | | * Rename all any_true to v128.any_true * Add i64x2.bitmask and i64x2.all_true, rebase simd_boolean * Unskip spec/simd/simd_i16x8_arith2.txt since i64x2.abs is now implemented * Unskip spec/simd/simd_lane.txt * Update dump interp tests, rebase
* Fix label printing for blocks in folded form (#1609)Asumu Takikawa2021-02-231-0/+89
| | | | This makes labels consistent with non-folded printing when multiple blocks are in function or block body.
* Update exception handling support to current proposal (#1596)Asumu Takikawa2021-02-106-41/+63
| | | | | | | | | | This PR updates the support of exception handling to the latest proposal (that is compatible with future 2-phase exception handling) described in https://github.com/WebAssembly/exception-handling/pull/137 and https://github.com/WebAssembly/exception-handling/pull/143. * Adds back tagged `catch $e`, `catch_all`, and `rethrow N` from a previous version of wabt, but with updates to match the current spec (e.g., `catch_all` shares an opcode with `else`, `rethrow`'s depth indexes only catch blocks, etc). * Adds `unwind` and `delegate` instructions. * Removes `exnref` and `br_on_exn`. * Updates relevant tests. There are some details that could still change (e.g., maybe how `delegate`'s depth is validated), but I'd be happy to submit further PRs if the spec details change.
* Rename atomic.notify, *.atomic.wait (#1564)Ben Smith2020-11-031-3/+3
| | | | | | | | atomic.notify -> memory.atomic.notify i32.atomic.wait -> memory.atomic.wait32 i64.atomic.wait -> memory.atomic.wait64 These were renamed upstream a while ago, but the new names were not added to wabt.
* Changes required to make the new Memory64 spec tests run (#1560)Wouter van Oortmerssen2020-10-263-6/+6
| | | | | These uncovered some things the previous tests didn't! Also required the switching of the location of the index as discussed in https://github.com/WebAssembly/memory64/issues/5 Also one small .py change that ensures the new tests have consistent posix paths.
* Update SIMD support (#1553)Darin Morrison2020-10-262-42/+42
| | | | | | | | | | | | | * Update testsuite * Update test results * Disallow lane nums with optional + for simd ops * Update simd support * Mark `test/spec/func.txt` as failing Co-authored-by: Darin Morrison <darinmorrison@users.noreply.github.com>
* Disallow "64-bit" flag if memory64 is disabled (#1547)Paweł Bylica2020-09-182-2/+2
| | | | Fixes regressions in binary reader introduced by the implementation of the memory64 extension: https://github.com/WebAssembly/wabt/pull/1500.
* Fix bug when writing multi-value block type (#1533)Ben Smith2020-09-081-0/+149
| | | | | | | | | * Fix bug when writing multi-value block type The block type must be written as an SLEB, not an LEB. We also want it to be relocatable, so I added a way to write a fixed-size SLEB too (`WriteS32Leb128WithReloc` and `WriteFixedS32Leb128`). * Fix ubsan issue
* Added initial "memory64" proposal support (#1500)Wouter van Oortmerssen2020-08-073-0/+145
|
* Print newline after rethrow instruction (#1503)Asumu Takikawa2020-07-301-0/+23
|
* Print newline after ref.is_null instruction (#1495)Ben Smith2020-07-241-1/+2
|
* Fix folding for *.load_splat and table.fill (#1486)Ben Smith2020-07-162-7/+877
| | | | Also remove default case from `ir-util.cc` so we get compile warnings in the future.
* [wasm2wat] Fix a few more roundtripping issues (#1450)Ben Smith2020-05-292-0/+25
| | | | | | | * The `declare` keyword should be printed when using element expressions or element indexes (i.e. flags == 3 or flags == 7). * An imported table was not properly setting the element type in the IR Fixes #1448 and #1449.
* [wasm2wat] Write select type immediate (#1451)Ben Smith2020-05-291-0/+17
| | | | | | | | | | | | | | | The main fix is in `wat-writer.cc`, where the type immediate was never being printed. But I've also included a change to how `select` type immediates are represented in wabt. Previously, a bare `select` instruction would be stored with the type `Type::Any`. This is not a real wasm type, and is primarily used for type validation. The spec instead considers this form of `select` to have an empty type immediate, which is closer to the `Type::Void` type. This commit now uses `Type::Void` (or an empty `TypeVector`) to represent the bare `select` instruction. Fixes #1444.
* [wat2wasm] Write table indexes in text format (#1446)Ben Smith2020-05-284-1/+64
| | | | | | | | | | | | * [wasm2wat] Write table index when non-zero It was already being properly written to binary, and read from binary into IR. It just wasn't been written out to wat. Fixes #1443. * Also write table indexes for table.{init,copy} Fixes #1445
* Reference types changes to remove subtyping (#1407)Ben Smith2020-05-282-4/+4
| | | | | | | | Main changes: * Rename `anyref` -> `externref` * Remove `nullref` * Rename `hostref` -> `externref` * `ref.null` and `ref.is_null` now have "ref kind" parameter * Add ref kind keywords: `func`, `extern`, `exn`
* Require `do` in folded `try` statement (#1425)Ben Smith2020-05-143-2/+5
| | | | | | | | | | | | | For example: ``` (try $label (param ...) (result ...) (do ...) (catch ...) ) ``` See comment here: https://github.com/WebAssembly/exception-handling/issues/52#issuecomment-626696720
* Fix bug when writing grouped named parameters (#1418)Ben Smith2020-05-132-0/+17
| | | | | | | | | | A named parameter (or local) must always be in its own `param` block, so this syntax is not allowed: `(param i32 $b i32)` And must instead be converted to: `(param i32) (param $b i32)`
* Enabled merged proposals by default (#1405)Alex Crichton2020-05-061-1/+1
| | | | | | | | | | | | | This enables three proposals by default since they've been merged into the upstream specification: * `saturating-float-to-int` - WebAssembly/spec#1143 * `sign-extension` - WebAssembly/spec#1144 * `multi-value` - WebAssembly/spec#1145 Most of the fallout from this is in the test suite with lots of `--enable` flags getting removed and some tests which now unconditionally pass also getting removed. Two spec tests explicitly pass `--disable` until the spec test submodule is updated.
* Add support for atomic.fence from the threads proposal (#1231)Andy Wingo2020-04-201-0/+13
| | | | | See https://github.com/WebAssembly/threads/pull/141 for the binary encoding. This patch does add a field to AtomicFenceExpr for the consistency model, though without a type for the time being.
* Fix whitespace formatting of SIMD ops (#1372)Adam Klein2020-03-231-0/+22
| | | Fixes #1227.
* Apply start function name in wasm2wat (#1289)Ben Smith2020-01-091-0/+11
| | | | Fixes #1226.
* Replace newline by a space (#1261)Amir Bawab2019-12-111-0/+14
|
* Update spec testsuite (#1237)Sam Clegg2019-11-229-12/+12
| | | | | | | The only major change to the interpreter is to move segment initialization out `ReadBinaryInterp` (in the binary reader) and into interp.cc. This is because the test suite now expects out of bound semgments to be reported during initialization rather than reported as validation errors.
* reference-types: Table immediate of call_indirect comes first in the text ↵Sam Clegg2019-11-142-2/+2
| | | | | | | | format (#1219) The overview document was incorrect until recently which I imagine is why wabt got this wrong initially. See https://github.com/WebAssembly/reference-types/issues/59
* Update spec testsuite (#1111)Ben Smith2019-07-163-14/+14
| | | | | * Remove passive keyword from bulk-memory * Fix rounding on hex floats * Allow underscores in NaN payloads