summaryrefslogtreecommitdiff
path: root/scripts/test
Commit message (Collapse)AuthorAgeFilesLines
* When renaming functions ensure the corresponding GOT.func entry is also ↵Sam Clegg2019-10-252-3/+3
| | | | | | renamed (#2382) Fixes https://github.com/WebAssembly/binaryen/issues/2180
* Upgrade the build container for linux releases (#2405)Alex Crichton2019-10-252-3/+3
| | | | | | | | This is a continued effort to try and track down #2273 which came up again and is still present in the current release binaries. Issues like crystal-lang/crystal#4276 may indicate that C++ exceptions are just somewhat broken with static linking when using alpine, but I've at least locally been able to verify that upgrading the container produces working binaries which previously segfaulted on some wasm files.
* Add --out-dir to allow setting the test output dir. (#2389)Alon Zakai2019-10-171-4/+11
| | | This allows fuzzing in parallel invocations.
* Add a --standalone-wasm flag to wasm-emscripten-finalize (#2333)Alon Zakai2019-09-181-0/+2
| | | The flag indicates that we want to run the wasm by itself, without JS support. In that case we don't emit JS dynCalls etc., and we also emit a wasi _start if there is a main, i.e., we try to use the current conventions in the wasm-only space.
* [wasm2js] Fix memory.size (#2330)Alon Zakai2019-09-051-2/+2
| | | | | | | We emitted the __wasm_memory_size function only when memory growth was enabled, but it can be used without that too. In theory we could only emit it if either memory growth or memory.size is used, but I think we can expect JS minifiers to do that later. Also fix a test suite bug - the check/auto_update script didn't run all the wasm2js tests when you run it with argument wasm2js (it used that as the list of tests, instead of the list of files, which confused me here for a while...).
* Allow all features on wasm2js and add atomic tests (#2311)Heejin Ahn2019-08-281-4/+4
| | | | | | This adds `-all` argument to wasm2js testing and fixes wasm2js to actually take that argument (currently it doesn't, when it takes a wast file). This also adds a wasm2js test for `atomic.fence` instruction that was added in #2307.
* Fix auto_update_tests.py after #2114 (#2306)Sam Clegg2019-08-261-2/+2
|
* Remove test output from source tree (#2114)Sam Clegg2019-08-213-3/+11
|
* Add initial support for anyref as an opaque type (#2294)Jay Phelps2019-08-201-2/+2
| | | | | | | | | | | | | Another round of trying to push upstream things from my fork. This PR only adds support for anyref itself as an opaque type. It does NOT implement the full [reference types proposal](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md)--so no table.get/set/grow/etc or ref.null, ref.func, etc. Figured it was easier to review and merge as we go, especially if I did something fundamentally wrong. *** I did put it under the `--enable-reference-types` flag as I imagine that even though this PR doesn't complete the full feature set, it probably is the right home. Lmk if not. I'll also be adding a few github comments to places I want to point out/question.
* Switch python indentation from 2-space to 4-space (#2299)Sam Clegg2019-08-167-806/+807
| | | | | | | | pep8 specifies 4 space indentation. The use of 2 spaces is, I believe a historical anomaly where certain large organizations such as google chose 2 over 4 and have yet to make the switch. Since there isn't too much code in binaryen today it seems reasonable to make the switch.
* Upgrade flake8 and run it on python 3 (#2297)Guanzhong Chen2019-08-131-3/+5
|
* Allow running a portion of binaryen test suite (#2286)Guanzhong Chen2019-08-071-10/+12
|
* Implement --check-stack-overflow flag for wasm-emscripten-finalize (#2278)Guanzhong Chen2019-08-021-4/+6
|
* Python3-ify check.py and auto_update_tests.py (#2270)Alon Zakai2019-07-316-106/+95
| | | | | I fixed flatten.bin.txt which seems to have just had some corrupted data, and I removed some fancy unicode from the spec comments tests, which I'm not sure it's important enough to figure out how to fix. Fixes #1691
* wasm2js: Mangle import names for JS (#2267)Alon Zakai2019-07-282-3/+6
| | | | | | | This fixes names that would be invalid in JS, like a.b. Turns out the Go compiler emits wasm with such imports. Also add some docs on how to use wasm2js. Fixes #2263
* Handle passive segments in wasm-emscripten-finalize (#2217)Thomas Lively2019-07-111-3/+11
|
* Ignore --initial-stack-pointer arg to wasm-emscripten-finalize (#2201)Sam Clegg2019-07-101-1/+1
| | | | | | | | | | | | | We were passing bad value in --initial-stack-pointer which did not include the STATIC_BUMP (since STATIC_BUMP is determinted by the output of finalize). If emscripten wants to set the stack pointer position it can do so by calling the stackRestore() function at startup. This argument will be removed completely once we stop passing it on the emscripten side. See https://github.com/emscripten-core/emscripten/issues/8905
* Use v8 to test wasm binaries are valid in test suite binary checks (#2206)Alon Zakai2019-07-031-2/+39
|
* Split binaryenjs tests out from main check.py script (#2163)Sam Clegg2019-06-062-1/+77
|
* First stage of cleeanup in source tree pollution (#2105)Sam Clegg2019-05-161-5/+4
| | | | | | | | | | | Update build-js.sh to output to `out` directory. This is district from the `bin` directory which is used by the cmake build and may or may not live in the source tree. The `out` directory currently always lives in the source tree. As a followup change I hope to additionally move all test outout into this tree. See #2104
* wasm2js: run full optimizations during the pipeline (#2071)Alon Zakai2019-04-301-70/+80
| | | | | We flatten for the i64 lowering etc. passes, and it is worth optimizing afterwards, to clean up stuff they created. That is run if the user ran wasm2js with an optimization level (like wasm2js -O3). Split the test files to check both optimized and unoptimized code.
* wasm2js2: optimize call_indirect and select operands (#2056)Alon Zakai2019-04-251-0/+3
| | | Don't use temp vars to reorder them unless we need to.
* wasm2js: support non-constant indexes for memory and table segments (#2055)Alon Zakai2019-04-251-0/+2
| | | Mostly what we need for dynamic linking, at least on the binaryen side.
* wasm2js: start to optionally optimize the JS (#2046)Alon Zakai2019-04-241-2/+2
| | | Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
* wasm2js: unreachability fixes (#2037)Alon Zakai2019-04-222-1/+17
| | | Also test in pass-debug mode, for better coverage.
* wasm2js: use scratch memory properly (#2033)Alon Zakai2019-04-221-2/+0
| | | | | | | This replaces all uses of __tempMemory__, the old scratch space location, with calls to function imports for scratch memory access. This lets us then implement those in a way that does not use the same heap as main memory. This avoids possible bugs with scratch memory overwriting something, or just in general that it has observable side effects, which can confuse fuzzing etc. The intrinsics are currently implemented in the glue. We could perhaps emit them inline instead (but that might limit asm.js optimizations, so I wanted to keep our options open for now - easy to change later). Also fixes some places where we used 0 as the scratch space address.
* wasm2js2 import fixes (#2031)Alon Zakai2019-04-191-0/+11
| | | | | | * Don't assume function types exist in legalize-js-interface. * Properly handle (ignore) imports in RemoveNonJSOps - do not try to recurse into them. * Run legalize-js-interface and remove-unused-module-elements in wasm2js, the first is necessary, the last is nice to have.
* Reland emitting of DataCount section (#2027)Thomas Lively2019-04-181-1/+1
| | | | | | This reverts commit cb2d63586c08a3dd194d2b733ceb3f5051c081f8. The issues with feature validation were mostly resolved in #1993, and this PR finishes the job by adding feature flags to wasm-as to avoid emitting the DataCount section when bulk-memory is not enabled.
* Change default feature set to MVP (#1993)Thomas Lively2019-04-161-3/+3
| | | | | In the absence of the target features section or command line flags. When there are command line flags, it is an error if they do not exactly match the target features section, except if --detect-features has been provided. Also adds a --print-features pass to print the command line flags for all enabled options and uses it to make the feature tests more rigorous.
* Move features from passOptions to Module (#2001)Thomas Lively2019-04-121-7/+2
| | | | | 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.
* Wasm2js memory fixes (#2003)Alon Zakai2019-04-123-33/+56
| | | | | | | | * I64ToI32Lowering - don't assume address 0 is a hardcoded location for scratch memory. Import __tempMemory__ for that. * RemoveNonJSOps - also use __tempMemory__. Oddly here the address was a hardcoded 1024 (perhaps where the rust program put a static global?). * Support imported ints in wasm2js, coercing them as needed. * Add "env" import support in the tests, since now we emit imports from there. * Make wasm2js tests split out multi-module tests using split_wast which is more robust and avoids emitting multiple outputs in one file (which makes no sense for ES6 modules)
* wasm2js: emscripten glue option (#2000)Alon Zakai2019-04-111-0/+4
| | | | | | Add a wasm2js option for the glue to be in emscripten-compatible format (as opposed to ES6). This does a few things so far: * Emit START_FUNCTIONS, END_FUNCTIONS markers in the code, for future use in the optimizer. * Emit the glue as a function to be called from emscripten.
* Handle relocatable code in AsmConstWalker (#1992)Sam Clegg2019-04-101-1/+2
| | | | | | In relocatable code the constant offset might be relative to __memory_base.
* wasm-emscripten-finalize: Improve shared library support (#1961)Sam Clegg2019-04-022-33/+50
| | | | | | | | | | | | | | | | | Convert PIC code generated by llvm to work with the current emscripten ABI for dynamic linking: - Convert mutable global imports from GOT.mem and GOT.func into internal globals. - Initialize these globals on started up in g$foo and f$foo imported functions to calculate addresses at runtime. Also: - Add a test case for linking and finalizing a shared library - Allow __stack_pointer global to be non-existent as can be case for a shared library. - Allow __stack_pointer global to be an import, as can be the case for a shared library.
* Delete wasm-merge (#1969)Thomas Lively2019-03-291-1/+0
| | | It is not very useful.
* Improve test scripts (#1959)* Improve test scripts * feedback [skip ci]Sam Clegg2019-03-213-7/+73
| | | | | - Move auto_update_tests.py code into respective scripts - Use shared argument parsing in generate_lld_tests.py - Use wasm-ld rather than passing -flavor
* Discover and run unit tests from check.py (#1948)Thomas Lively2019-03-191-0/+54
| | | | | | unittest is Python's standard testing framework, so this change allows arbitrary tests to be written without introducing any new dependencies or code in check.py. A new test that was not possible to write before is also included. It is the first of many.
* wasm-emscripten-finalize: Remove JSCall thunk generation (#1938)Sam Clegg2019-03-121-1/+0
| | | | We now implement addFunction by creating a wasm module to wrap that JS function and simply adding it to the table.
* Emscripten stack simplification (#1870)Alon Zakai2019-01-161-1/+1
| | | | | | This takes advantage of the recent memory simplification in emscripten, where JS static allocation is done at compile time. That means we know the stack's initial location at compile time, and can apply it. This is the binaryen side of that: * asm2wasm support for asm.js globals with an initial value var X = Y; where Y is not 0 (which is what the stack now is). * wasm-emscripten-finalize support for a flag --initial-stack-pointer=X, and remove the old code to import the stack's initial location.
* Check $NODE environment variable when looking for node (#1792)Sam Clegg2018-11-301-1/+1
| | | | This allows me to run tests on a system where the default installed node is not recent enough.
* Add wasm-emscripten-finalize flag to separate data segments into a file (#1741)Derek Schuff2018-11-141-5/+11
| | | | This writes the data section into a file suitable for use with emscripten's --memory-init-file flag
* Support 4GB Memories (#1702)Alon Zakai2018-10-151-0/+2
| | | This fixes asm2wasm parsing of the max to allow 4GB, and also changes the internal Memory::kMaxValue values to reflect that. We used to use kMaxValue to also represent "no limit", so I split that out into kUnlimitedValue.
* Rename `wasm2asm` to `wasm2js`, emit ESM by default (#1642)Alex Crichton2018-08-305-40/+77
| | | | | | | | | | | | | | | | | | | | | | | | * Rename the `wasm2asm` tool to `wasm2js` This commit performs a relatively simple rename of the `wasm2asm` tool to `wasm2js`. The functionality of the tool doesn't change just yet but it's intended that we'll start generating an ES module instead of just an `asm.js` function soon. * wasm2js: Support `*.wasm` input files Previously `wasm2js` only supported `*.wast` files but to make it a bit easier to use in tooling pipelines this commit adds support for reading in a `*.wasm` file directly. Determining which parser to use depends on the input filename, where the binary parser is used with `*.wasm` files and the wast parser is used for all other files. * wasm2js: Emit ESM imports/exports by default This commit alters the default behavior of `wasm2js` to emit an ESM by default, either importing items from the environment or exporting. Items like initialization of memory are also handled here.
* Proper error handling in add* and get* methods (#1570)Alon Zakai2018-07-101-1/+1
| | | | | | | See #1479 (comment) Also a one-line readme update, remove an obsolete compiler (mir2wasm) and add a new one (asterius). Also improve warning and error reporting in binaryen.js - show a stack trace when relevant (instead of node.js process.exit), and avoid atexit warning spam in debug builds.
* Stop bundling binaryen.js builds (#1609)Alon Zakai2018-07-041-0/+1
| | | | | | | Instead, we point users to the bot @dcodeIO has, see #1571 This is useful because otherwise every change to binaryen.js requires bundling a build here, which is more work for contributors (and also grows the git repo over time). We still keep a bundled build of wasm.js. We use that for testing of the interpreter currently, and emscripten depends on it. Eventually wasm2asm may replace that. In any case, wasm.js builds are required far less frequently than binaryen.js.
* Remove s2wasm (#1607)Sam Clegg2018-06-282-136/+0
| | | | s2wasm is no longer used my emscripten and as far as I know now as no other users.
* Fix check.py on windows platform (#1605)Loppin Vincent2018-06-202-4/+5
| | | | Fix some file reading & endline issues on windows platform.
* Remove testing of s2wasm via the wasm waterfall scripts (#1604)Sam Clegg2018-06-191-66/+0
| | | | The wasm waterfall is moving away from testing with s2wasm and s2wasm hopefully going to be removed soon.
* Cleanup scripts in scripts/test (#1566)Sam Clegg2018-05-258-99/+123
| | | | | | | | | | Remove executable bit and #! from scripts that don't have entry point. Add missing licence test. Move arg parsing into a function. Remove legacy --only_prepare (with underscrore) argument.
* Clean up wasm2asm testing (#1546)Alon Zakai2018-05-131-5/+5
| | | | | * Move wasm2asm test outputs into their natural location, test/wasm2asm/ * Let people create new tests in there that ./auto_update_tests.py will auto-generate outputs for, just like all the other tests.