summaryrefslogtreecommitdiff
path: root/test/spec
Commit message (Collapse)AuthorAgeFilesLines
* Update spec test suite (#2484)Heejin Ahn2019-11-2991-4819/+38496
| | | | | | | | | | | | | This updates spec test suite to that of the current up-to-date version of https://github.com/WebAssembly/spec repo. - All failing tests are added in `BLACKLIST` in shared.py with reasons. - For tests that already existed and was passing and started failing after the update, we add the new test to the blacklist and preserve the old file by renaming it to 'old_[FILENAME].wast' not to lose test coverage. When the cause of the error is fixed or the unsupported construct gets support so the new test passes, we can delete the corresponding 'old_[FILENAME].wast' file. - Adds support for `spectest.print_[type] style imports.
* Auto-update spec test outputs (#2481)Heejin Ahn2019-11-261-1/+0
| | | | | | | | This makes auto_update_tests.py update spec test outputs (ones that are printed with `spectest.print` import) and extracts spec tests blacklist into shared.py with comments for reasons why each of them fails. Also deletes if-label-scope.fail.wast.log because it does not seem to match with any of existing tests.
* Print only literal values when printing literals (#2469)Heejin Ahn2019-11-261-2/+2
| | | | | | | | | | | | | | | Current `<<` operator on `Literal` prints `[type].const` with it. But `[type].const` is rather an instruction than a literal itself, and printing it with the literals makes less sense when we later have literals whose type don't have `const` instructions (such as reference types). This patch - Makes `<<` operator on `Literal` print only its value - Makes wasm-shell's shell interface comply with the spec interpreter's printing format (`value : type`). - Prints wasm-shell's `[trap]` message to stderr These make all `fix_` routines for spec tests in check.py unnecessary.
* Add i32x4.dot_i16x8_s (#2420)Thomas Lively2019-11-041-0/+5
| | | | | This experimental instruction is specified in https://github.com/WebAssembly/simd/pull/127 and is being implemented to enable further investigation of its performance impact.
* Add SIMD integer min and max instructions (#2416)Thomas Lively2019-11-011-0/+84
| | | As proposed in https://github.com/WebAssembly/simd/pull/27.
* v8x16.swizzle (#2368)Thomas Lively2019-10-031-0/+8
| | | | As specified at https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices.
* SIMD load and extend instructions (#2353)Thomas Lively2019-09-241-0/+13
| | | | | | Adds support for the new load and extend instructions. Also updates from C++11 to C++17 in order to use generic lambdas in the interpreter implementation.
* v128.andnot instruction (#2355)Thomas Lively2019-09-241-0/+2
| | | | | As specified at https://github.com/WebAssembly/simd/pull/102. Also fixes bugs in the JS API for other SIMD bitwise operators.
* vNxM.load_splat instructions (#2350)Thomas Lively2019-09-231-1/+9
| | | | | | | Introduces a new instruction class, `SIMDLoad`. Implements encoding, decoding, parsing, printing, and interpretation of the load and splat instructions, including in the C and JS APIs. `v128.load` remains in the `Load` instruction class for now because the interpreter code expects a `Load` to be able to load any memory value type.
* SIMD narrowing and widening operations (#2341)Thomas Lively2019-09-141-0/+74
|
* Add atomic.fence instruction (#2307)Heejin Ahn2019-08-271-0/+8
| | | | | | | This adds `atomic.fence` instruction: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#fence-operator This also fix bugs in `atomic.wait` and `atomic.notify` instructions in binaryen.js and adds tests for them.
* Add basic exception handling support (#2282)Heejin Ahn2019-08-132-3/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds basic support for exception handling instructions, according to the spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md This PR includes support for: - Binary reading/writing - Wast reading/writing - Stack IR - Validation - binaryen.js + C API - Few IR routines: branch-utils, type-updating, etc - Few passes: just enough to make `wasm-opt -O` pass - Tests This PR does not include support for many optimization passes, fuzzer, or interpreter. They will be follow-up PRs. Try-catch construct is modeled in Binaryen IR in a similar manner to that of if-else: each of try body and catch body will contain a block, which can be omitted if there is only a single instruction. This block will not be emitted in wast or binary, as in if-else. As in if-else, `class Try` contains two expressions each for try body and catch body, and `catch` is not modeled as an instruction. `exnref` value pushed by `catch` is get by `pop` instruction. `br_on_exn` is special: it returns different types of values when taken and not taken. We make `exnref`, the type `br_on_exn` pushes if not taken, as `br_on_exn`'s type.
* Allow 0-value events (#2256)Heejin Ahn2019-07-241-5/+0
| | | | Before I disallowed events with no values, but spec does not say anything about it, so I think that restriction is not necessary.
* Rename except_ref type to exnref (#2224)Heejin Ahn2019-07-141-1/+1
| | | | In WebAssembly/exception-handling#79 we agreed to rename `except_ref` type to `exnref`.
* Relax bulk memory rules (#2186)Thomas Lively2019-06-301-26/+8
| | | As decided in the recent in-person CG meeting.
* Reduce interpreter recursion limit (#2162)Alon Zakai2019-06-042-8/+8
| | | | | | | This should be small enough to work in a 512K stack on Linux, which may then be small enough to work on all common OSes. I had to update some spec tests which actually did more recursive calls, but I don't think the change reduces any relevant amount of test coverage. This may fix the Mac bot finally, as with this it passes for me on the stack size I think Macs have by default.
* Add event section (#2151)Heejin Ahn2019-05-311-0/+43
| | | | | | | | | | | | | | | | | | This adds support for the event and the event section, as specified in https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model. Wasm events are features that suspend the current execution and transfer the control flow to a corresponding handler. Currently the only supported event kind is exceptions. For events, this includes support for - Binary file reading/writing - Wast file reading/writing - Binaryen.js API - Fuzzer - Validation - Metadce - Passes: metrics, minify-imports-and-exports, remove-unused-module-elements
* Reflect instruction renaming in code (#2128)Heejin Ahn2019-05-2110-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reflected new renamed instruction names in code and tests: - `get_local` -> `local.get` - `set_local` -> `local.set` - `tee_local` -> `local.tee` - `get_global` -> `global.get` - `set_global` -> `global.set` - `current_memory` -> `memory.size` - `grow_memory` -> `memory.grow` - Removed APIs related to old instruction names in Binaryen.js and added APIs with new names if they are missing. - Renamed `typedef SortedVector LocalSet` to `SetsOfLocals` to prevent name clashes. - Resolved several TODO renaming items in wasm-binary.h: - `TableSwitch` -> `BrTable` - `I32ConvertI64` -> `I32WrapI64` - `I64STruncI32` -> `I64SExtendI32` - `I64UTruncI32` -> `I64UExtendI32` - `F32ConvertF64` -> `F32DemoteI64` - `F64ConvertF32` -> `F64PromoteF32` - Renamed `BinaryenGetFeatures` and `BinaryenSetFeatures` to `BinaryenModuleGetFeatures` and `BinaryenModuleSetFeatures` for consistency.
* Finish bulk memory support (#2030)Thomas Lively2019-04-221-0/+183
| | | | | | | Implement interpretation of remaining bulk memory ops, add bulk memory spec tests with light modifications, fix bugs preventing the fuzzer from running correctly with bulk memory, and fix bugs found by the fuzzer.
* Move features from passOptions to Module (#2001)Thomas Lively2019-04-121-20/+0
| | | | | This allows us to emit a (potentially modified) target features section and conditionally emit other sections such as the DataCount section based on the presence of features.
* Update test/spec/memory.wast to latest upstream (#1801)Alon Zakai2019-04-031-157/+38
| | | | | | | Minus multi-memory which we don't support yet. Improve validator. Fix some minor validation issues in our tests.
* Update v128.const text formats (#1934)Thomas Lively2019-03-191-305/+315
| | | | | Parse the formats allowed by the spec proposal and emit the i32x4 canonical format.
* Massive renaming (#1855)Thomas Lively2019-01-0769-1580/+1580
| | | | | | Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329.
* Fix SIMD test placement (#1853)Thomas Lively2019-01-061-2/+2
|
* SIMD (#1820)Thomas Lively2018-12-131-0/+661
| | | | | | | | | Implement and test the following functionality for SIMD. - Parsing and printing - Assembling and disassembling - Interpretation - C API - JS API
* Implement nontrapping float-to-int instructions (#1780)Thomas Lively2018-12-041-0/+172
|
* check-in the test/spec suite instead of as submodule (#1677)Jay Phelps2018-09-1198-0/+22299
|
* Update call_indirect text syntax to match spec update (#1281)Derek Schuff2017-11-131-0/+0
| | | | Function type gets its own element rather than being a part of the call_indirect (see WebAssembly/spec#599)
* Return to more structured type rules for block and if (#1148)Alon Zakai2017-09-051-0/+0
| | | | | | | | * if a block has a concrete final element (or a break with a value), then even if it has an unreachable child, keep it with that concrete type. this means we no longe allow the silly case of a block with an unreachable in the middle and a concrete as the final element while the block is unreachable - after this change, the block would have the type of the final element * if an if has a concrete element in one arm, make it have that type as a result, even if the if condition is unreachable, to parallel block * make type rules for brs and switches simpler, ignore whether they are reachable or not. whether they are dead code should not affect how they influence other types in our IR.
* validate returned values in all cases, even if the function returns none we ↵Alon Zakai2017-06-021-0/+0
| | | | should still not have returns with a value, etc. update spec tests to remove some stacky tests that do not fit these new validation rules (#1034)
* update spec tests, now using binary-0xc branch as our stack test refactoring ↵Alon Zakai2016-10-121-0/+0
| | | | landed in upstream (#754)
* precompute void expressions tooAlon Zakai2016-09-241-0/+0
|
* update spec tests and check.py's handling of themAlon Zakai2016-09-211-0/+0
|
* re-enable spec testsAlon Zakai2016-09-071-0/+0
|
* in DemoteFloat64, if the truncated value is exactly at the limit, return it ↵Alon Zakai2016-08-081-0/+0
| | | | | (#665) and update spec tests
* Update waterfall build revision to 9397 (#662)Derek Schuff2016-08-041-0/+0
| | | Includes torture tests and new expected passes
* wast function type name desugaring is changing in spec:301 (#654)Alon Zakai2016-07-281-0/+0
|
* update spec tests, and handle some flux in call_indirect in upstreamAlon Zakai2016-07-061-0/+0
|
* update spec tests, and handle the new .fail. tests (#541)Alon Zakai2016-05-251-0/+0
|
* spec test updates, and many validation fixesAlon Zakai2016-05-181-0/+0
|
* update spec tests (#478)Alon Zakai2016-05-111-0/+0
|
* update spec testsAlon Zakai2016-05-091-0/+0
|
* update testsAlon Zakai2016-04-181-0/+0
|
* Properly align the stack pointerDerek Schuff2016-04-061-0/+0
| | | | | | | | | | | | * Properly align the stack pointer By default (if no global base is given) the global base is 1, which seems wrong. In this case the stack pointer gets an address of 1, which is unaligned and definitely wrong. So, start the global base at 0 instead of 1 by default and align the stack pointer. Also factor allocation of statics into a function. * unconditionally allocate stack pointer; explicitly reserve address 0
* update spec tests, and new memory page size usageAlon Zakai2016-03-251-0/+0
|
* update spec tests and support eqzAlon Zakai2016-03-191-0/+0
|
* Implement rotatesDerek Schuff2016-03-091-0/+0
|
* Make initial and max memory sizes be in pages instead of bytesDerek Schuff2016-03-091-0/+0
| | | | | | | The AST and everything that uses it treats the values as pages. Javascript continues to use bytes. This matches v8 and sexpr-wasm, and the consensus from live discussion and PR209 in the spec.
* br_table, no more casesAlon Zakai2016-03-071-0/+0
|
* update spec test repoAlon Zakai2016-03-071-0/+0
|