Since we support the multi-memory proposal, we should skip tests that
validate that we have only one memory. Once multi-memory gets included
in the main WebAssembly specification (and the testsuite is updated), we
can revert this commit.
(cherry picked from commit 98ac8d98510e61665cf8a6b96f5cd4874a561cd7)
Because `nan:arithmetic` and `nan:canonical` aren't bound to a single
bit pattern, we cannot check against a float-containing SIMD vector
against a single value in the tests. Now, we represent `v128`s as
`TypedArray`s in `testjs` (as opposed to using `BigInt`s), allowing us
to properly check `NaN` bit patterns.
(cherry picked from commit d84a3f91272a4a047332bd6cc4ecbbb239f5995a)
Some spec-tests check the bit pattern of a returned `NaN` (i.e.
`nan:canonical`, `nan:arithmetic`, or something like `nan:0x200000`).
Previously, we just accepted any `NaN`.
(cherry picked from commit ae7a46a862b1af8b5bf4a89326bc03b835b26086)
`linking.wast` has an unusual pattern for invoke commands, which is now
accounted-for. Also, special unicode characters are now properly
serialized in JavaScript as string literals (this is only relevant for
`names.wast`).
(cherry picked from commit 5b9a026bde930a5543b5de454cca0ead47c7bd6d)
A `Uint8Array` can now be passed in the Wasm testjs files to be
transmuted into a Wasm value.
(cherry picked from commit 6493acf2f46f6e4522a0f1f01e12d0e48347562e)
Implements `table.get`, `table.set`, `elem.drop`, `table.size`,
and `table.grow`. Also fixes a few issues when generating ref-related
spectests. Also changes the `TableInstance` type to use
`Vector<Reference>` instead of `Vector<Optional<Reference>>`, because
the ability to be null is already encoded in the `Reference` type.
...and let LibWasm do the validation instead of removing the test when a
module is invalid.
Also, one of the tests has an integer literal starting with zero, so
account for this to make it not fail :^)
`wasm-as` will do some semantic analysis on the modules, which is not
something we're looking for here.
Instead, use `wat2wasm` to generate the exact module.
This also optionally generates a test suite from the WebAssembly
testsuite, which can be enabled via passing `INCLUDE_WASM_SPEC_TESTS`
to cmake, which will generate test-wasm-compatible tests and the
required fixtures.
The generated directories are excluded from git since there's no point
in committing them.