summaryrefslogtreecommitdiff
path: root/scripts/test
Commit message (Collapse)AuthorAgeFilesLines
* Support stack overflow checks in standalone mode (#2525)Alon Zakai2019-12-121-7/+7
| | | | | | | | | In normal mode we call a JS import, but we can't import from JS in standalone mode. Instead, just trap in that case with an unreachable. (The error reporting is not as good in this case, but at least it catches all errors and halts, and the emitted wasm is valid for standalone mode.) Helps emscripten-core/emscripten#10019
* Rename a couple of files that were missing in #2518 (#2521)Sam Clegg2019-12-101-1/+1
|
* Look for bin/binaryen_js.js directly, instead of expecting us to copy it. ↵Alon Zakai2019-12-101-1/+3
| | | | (#2508)
* Use wat over wast for text format filenames (#2518)Sam Clegg2019-12-081-15/+15
|
* Regenerate lld test inputs (#2502)Sam Clegg2019-12-051-2/+3
|
* Update spec test suite (#2484)Heejin Ahn2019-11-293-8/+80
| | | | | | | | | | | | | 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-0/+16
| | | | | | | | 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.
* Use package name in imports (NFC) (#2462)Heejin Ahn2019-11-225-107/+103
| | | | | Don't directly import names from shared.py and support.py, and use prefixes instead. Also this reorders imports based on PEP recommendation.
* Fix syntax errors from #2457 (#2460)Heejin Ahn2019-11-201-1/+1
|
* Simplify test scripts (NFC) (#2457)Heejin Ahn2019-11-204-47/+45
| | | | | | | | This makes test scripts simpler by reducing loop depths and extracting repeating code into methods or variables. - `get_tests` returns a list of tests with specified extensions. This includes files with a full path rather than just file names. - Reduces loop depths by using early exits and `get_tests`.
* 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.