summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup scripts in scripts/test (#1566)Sam Clegg2018-05-251-0/+1
| | | | | | | | | | 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.
* Apply flake8 to remaining python code (#1542)Sam Clegg2018-05-151-316/+401
| | | | Also refactor auto_update_tests.py into functions to match check.py
* Clean up wasm2asm testing (#1546)Alon Zakai2018-05-131-5/+9
| | | | | * 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.
* A couple of fixes for out-of-tree builds (#1538)Sam Clegg2018-05-091-3/+3
|
* fix auto_update_tests.py for wasm-opt (#1487)Nathan Froyd2018-03-231-2/+3
| | | | After #1450, it looks like `auto_update_tests.py` was not changed to account for the new, updated expectations filename.
* Allow small names in test/passes (#1450)Alon Zakai2018-03-051-0/+2
| | | | | * allow tests in test/passes/ to have a numeric name, in which case there is a name.passes file with the names instead of the name containing the passes (which might be long, see #1020)
* Fold wasm-link-metadata into wasm-emscripten-finalize (#1408)Jacob Gravelle2018-02-141-18/+3
| | | | | | | * wasm-link-metadata: Use `__data_end` symbol. * Add --global-base param to emscripten-wasm-finalize to compute staticBump properly * Let ModuleWriter write to a provided Output object
* Support multiple extensions in lld test generation (#1417)Heejin Ahn2018-02-121-9/+22
|
* Emscripten addFunction support for Wasm backend (#1395)Heejin Ahn2018-02-071-0/+1
| | | This adds necessary command line options for addFunction support, and generates required jsCall imports and generates jsCall thunk functions.
* ThreadPool refactoring (#1389)Alon Zakai2018-01-261-0/+2
| | | | | | | | Refactor ThreadPool code for clarity and to fix some bugs with using the pool from different threads in parallel. We have a singleton pool, and need to ensure it is created only once and used only by one thread at a time. This model is a simple way to ensure we use a number of threads equal to the number of cores, more or less (a pool per Module might lead to number of cores * number of Modules being optimized). This refactoring adds a parent pointer in the worker threads (giving them direct access to the pool makes it simpler to make sure that pool and thread creation and teardown are threadsafe). This commit also adds proper locking around pool creation and pool usage.
* First pass at LLD support for Emscripten (#1346)Jacob Gravelle2018-01-221-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Skeleton of a beginning of o2wasm, WIP and probably not going to be used * Get building post-cherry-pick * ast->ir, remove commented out code, include a debug module print because linking * Read linking section, print emscripten metadata json * WasmBinaryWriter emits user sections on Module * Remove debugging prints, everything that isn't needed to build metadata * Rename o2wasm to lld-metadata * lld-metadata support for outputting to file * Use tables index instead of function index for initializer functions * Add lld-emscripten tool to add emscripten-runtime functions to wasm modules (built with lld) * Handle EM_ASM in lld-emscripten * Add a list of functions to forcibly export (for initializer functions) * Disable incorrect initializer function reading * Add error printing when parsing .o files in lld-metadata * Remove ';; METADATA: ' prefix from lld-metadata, output is now standalone json * Support em_asm consts that aren't at the start of a segment * Initial test framework for lld-metadata tool * Add em_asm test * Add support for WASM_INIT_FUNCS in the linking section * Remove reloc section parsing because it's unused * lld-emscripten can read and write text * Add test harness for lld-emscripten * Export all functions for now * Add missing lld test output * Add support for reading object files differently Only difference so far is in importing mutable globals being an object file representation for symbols, but invalid wasm. * Update help strings * Update linking tests for stackAlloc fix * Rename lld-emscripten,lld-metadata to wasm-emscripten-finalize,wasm-link-metadata * Add help text to header comments * auto& instead of auto & * Extract LinkType to abi/wasm-object.h * Remove special handling for wasm object file reading, allow mutable globals * Add braces around default switch case * Fix flake8 errors * Handle generating dyncall thunks for imports as well * Use explicit bool for stackPointerGlobal * Use glob patterns for lld file iteration * Use __wasm_call_ctors for all initializer functions
* Add optimize, shrink level and debug info options to C/JS (#1357)Daniel Wirtz2018-01-171-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add optimize, shrink level and debug info options to C/JS * Add instantiate functionality for creating additional unique instances of the API * Use a workaround when running tests in node Tests misuse a module as a script by concatenating, so instead of catching this case in the library, catch it there * Update sieve test Seems optimized output changed due to running with optimize levels 2/1 now * Use the options with all pass runners * Update relooper-fuzz C-API test * Share defaults between tools and the C-API * Add a test for optimize levels * Unify node test support in check.by and auto_update_tests.py * Also add getters for optimize levels and test them * Also test debugInfo * Add debug info to C tests that used it as well * Fix missing NODEJS import in auto_update_tests * Detect node.js version (WASM support) * Update hello-world JS test (now also runs with node) * feature-test WebAssembly in node instead * Document that these options apply globally, and where * Make sure hello-world.js output doesn't differ between mozjs/node
* Fixes for #5998 (#1341)Alon Zakai2017-12-301-0/+1
| | | | | | | | | | | | | | * binaryen.js and wasm.js don't need filesystem support * newest emscripten no longer uses Runtime.* * build fixes for binaryen.js and wasm.js also move binaryen.js to use standard emscripten MODULARIZE * run binaryen.js in all possible engines ; update js builds * don't emit debug build to a different name, just emit binaryen.js. makes testing easier and safer * remove volatile things from binaryen.js info printing in tests
* wasm-metadce tool (#1320)Alon Zakai2017-12-061-2/+15
| | | | | | | This adds a new tool for better dead code elimination. The problem this helps overcome is when the wasm module is part of something larger, like a wasm+JS combination, and therefore doing DCE in either one is not sufficient as it can't remove a cycle spanning the wasm and JS worlds. Concretely, when binaryen performs DCE by itself, it can never remove an export, because it considers those roots - but in the larger ("meta") space outside, they may actually be removable. To solve that, this tool receives a description of the outside graph (in very abstract form), including which nodes are roots. It then adds to that graph nodes from the wasm, so that we have a single graph representing the entire space (the outside + wasm + connections between them). It then performs DCE, finding what is not reachable from the roots, and cleaning it up from the wasm. It of course can't clean up things from the outside, since all it has is the abstract representation of those things in the graph, but it prints out the ids of the removable nodes, which an outside tool can use. This tool is written in as general a way as possible, hopefully it can have multiple uses. The use I have in mind is to write something in emscripten that uses this to DCE the JS+wasm combination that we emit.
* Fix binaryen.js's wasm2asm (#1257)Alon Zakai2017-11-011-1/+1
| | | | * fix wasm2asm in binaryen.js, the function locals may not all have names, so add them as necessary
* Update auto_update_tests.py for trap-mode flags (#1225)Jacob Gravelle2017-10-171-10/+19
|
* Flattening rewrite (#1201)Alon Zakai2017-10-031-14/+17
| | | | | | | | | | | | | | | | | | | | Rename flatten-control-flow to flatten, which now flattens everything, not just control flow, so e.g. (i32.add (call $x) (call $y) ) ==> (block (set_local $temp_x (call $x)) (set_local $temp_y (call $y)) (i32.add (get_local $x) (get_local $y) ) ) This uses more locals than before, but is much simpler and avoids a bunch of corner cases and fuzz bugs the old one hit. We can optimize later if necessary.
* Add --trap-mode=allow/clamp/js argument to asm2wasm and s2wasm (#1210)jgravelle-google2017-10-031-2/+2
| | | | | | | | | | * Add --trap-mode=allow/clamp/js argument to asm2wasm and s2wasm * Update asm2wasm and auto_update_tests scripts to use --trap-mode * Throw std::invalid_argument instead of adding a new Invalid TrapMode type * Remove legacy asm2wasm trap mode arguments
* Update text syntax for shared memory limits (#1197)Derek Schuff2017-09-221-3/+3
| | | | Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
* Return to more structured type rules for block and if (#1148)Alon Zakai2017-09-051-1/+21
| | | | | | | | * 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.
* wasm-reduce tool (#1139)Alon Zakai2017-09-011-2/+16
| | | Reduce an interesting wasm to a smaller still interesting wasm. This takes an arbitrary command to run, and reduces the wasm as much as it can while keeping the behavior of that command fixed. This can be used to reduce compiler bugs in an arbitrary VM, etc.
* Fix locaion of wasm-merge in auto_update_tests.py (#1151)Sam Clegg2017-08-291-13/+15
| | | | | Also, fix -l and -rpath lib directories so that it can be run out-of-tree
* New fuzzer (#1126)Alon Zakai2017-08-111-1/+8
| | | | | | This adds a new method of fuzzing, "translate to fuzz" which means we consider the input to be a stream of data that we translate into a valid wasm module. It's sort of like a random seed for a process that creates a random wasm module. By using the input that way, we can explore the space of valid wasm modules quickly, and it makes afl-fuzz integration easy. Also adds a "fuzz binary" option which is similar to "fuzz execution". It makes wasm-opt not only execute the code before and after opts, but also write to binary and read from it, helping to fuzz the binary format.
* do not combine a load/store offset with a constant pointer if it would wrap ↵Alon Zakai (kripken)2017-07-291-1/+1
| | | | a negative value to a positive one, as trapping is tricky
* Add shared memories (#1069)Derek Schuff2017-06-271-13/+15
| | | | | Begin to implement wasm threading proposal in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md This PR just has shared memory attribute with wast and binary support.
* Fix auto_update_tests for printing/minifier tests (#1071)Derek Schuff2017-06-271-2/+3
| | | | | It was using wasm-shell instead of wasm-opt to print. This was emitting an error and empty output. Also this means that the min.wast test input didn't get updated along with the spec, so I fixed that as well.
* Fix path to wasm-ctor-eval binary used in test codeSam Clegg2017-06-091-2/+2
|
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-011-0/+4
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* Unreachable typing fixes (#1004)Alon Zakai2017-05-091-3/+4
| | | | | | | | | | | | * fix type of drop, set_local, set_global, load, etc: when operand is unreachable, so is the node itself * support binary tests properly in test/passes * fix unreachable typing of blocks with no name and an unreachable child * fix continue emitting in asm2wasm * properly handle emitting of unreachable load
* --no-js-ffi opt to disable JS FFI mangling. (#984)Joel Martin2017-05-011-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Always use scripts.test.shared for bin paths. Update scripts/test/shared.py to add WASM_MERGE relative to build directory. Update auto_update_tests.py to use scripts.test.shared variables for all bin paths. Update check.py to use scripts.test.shared for wasm-merge path (this was missing). This allows check.py and auto_update_tests.py to be run from the source directory using built binaries in a different location. * --no-legalize-javascript-ffi disables JS FFI mangling. For JS/Web platform, calls to JS imports are wrapped to convert i64 to i32 and f32 to f64. Likewise calls from JS into exports do the inverse wrapping. This change provides an option to disable that wrapping and use the original types for the call. Includes tests test/noffi_f32.asm.js and test/noffi_i64.asm.js to make sure neither f32->f64 nor i64->i32 type mangling is happening when --no-legalize-javascript-ffi is specified. To fully disable JS FFI mangling when using emscripten, the fastcomp FFI mangling must also be disabled using the -emscripten-legalize-javascript-ffi=0 flag.
* ctor evaller (#982)Alon Zakai2017-04-281-0/+13
| | | | | Add wasm-ctor-eval, which evaluates functions at compile time - typically static constructor functions - and applies their effects into memory, saving work at startup. If we encounter something we can't evaluate at compile time in our interpreter, stop there. This is similar to ctor_evaller.py in emscripten (which was for asm.js).
* wasm-merge tool (#919)Alon Zakai2017-04-171-0/+20
| | | | wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
* New binaryen.js (#922)Alon Zakai2017-03-241-0/+13
| | | New binaryen.js implementation, based on the C API underneath and with a JS-friendly API on top. See docs under docs/ for API details.
* Use 3 modes for potentially trapping ops in asm2wasm (#929)Alon Zakai2017-03-071-4/+6
| | | * use 3 modes for potentially trapping ops in asm2wasm: allow (just emit a potentially trapping op), js (do exactly what js does, even if it takes a slow ffi to do it), and clamp (avoid the trap by clamping as necessary)
* Fix emitting of unreachable block/if/loop (#911)Alon Zakai2017-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | * an unreachable block is one with an unreachable child, plus no breaks * document new difference between binaryen IR and wasm * fix relooper missing finalize * add a bunch of tests * don't assume that test/*.wast files print to themselves exactly; print to from.wast. this allows wast tests with comments in them * emit unreachable blocks as (block .. unreachable) unreachable * if without else and unreachable ifTrue is still not unreachable, it should be none * update wasm.js * cleanups * empty blocks have none type
* asm2wasm debuginfo (#895)Alon Zakai2017-02-071-0/+2
| | | | | | | | | | | | * parse file/line comments in asm.js into debug intrinsics * convert debug intrinsics into annotations, and print them * ignore --debuginfo if not emitting text, as wasm binaries don't support that yet * emit full debug info when -g and emitting text; when -g and emitting binary, all we can do is the Names section * update wasm.js
* Improve handling of implicit traps (#898)Alon Zakai2017-02-061-1/+1
| | | | | | | | * add --ignore-implicit-traps option, and by default do not ignore them, to properly preserve semantics * implicit traps can be reordered, but are side effects and should not be removed * add testing for --ignore-implicit-traps
* Read/Write Abstraction (#889)Alon Zakai2017-01-261-1/+1
| | | | | * Added ModuleReader/Writer classes that support text and binary I/O * Use them in wasm-opt and asm2wasm
* Handle stacky code (#868)Alon Zakai2017-01-041-0/+11
| | | | * handle stacky code in binaries, using a block+local
* Refactor check.py so that groups of tests can be split into separate … (#849)jgravelle-google2016-12-061-1/+1
| | | | | | | | | | | | | | * Refactor check.py so that groups of tests can be split into separate files - Move helper util functions into test/shared.py - Move scripts/support.py to test/support.py - Split s2wasm tests into its own file * Fix flake8 warnings for shared.py and s2wasm.py * Move test scripts from test/ to scripts/test/ * Replace 'from shared import *' with explicit imports
* add a --memory-base options to asm2wasm, to fix the memory base instead of ↵Alon Zakai2016-10-311-0/+2
| | | | depending on an import
* support pass test files with -O plus a level, like -O1, -Os, etc.Alon Zakai2016-10-211-1/+1
|
* Add -O0,-O1,etc. options (#790)Alon Zakai2016-10-191-1/+4
| | | | And use them in wasm-opt and asm2wasm consistently and uniformly.
* More wasm-only opts (#727)Alon Zakai2016-10-021-1/+1
| | | | | | * wasm-only loads and stores * wasm-only 32-bit bitcasts
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-0/+2
| | | | | | | | | | | | * support i64 intrinsics from fastcomp, adding --wasm-only flag * refactor callImport logic in asm2wasm to avoid recomputing wasm types again * legalize illegal i64 params in exports and imports * do safe i64 binary ops depending on precision * fix addVar, only assert on names if we are using a name
* Make wasm-as emit the names section/debug info only with -g (#705)Alon Zakai2016-09-261-13/+17
|
* Update s2wasm for 0xc changes (#698)Derek Schuff2016-09-151-6/+2
| | | | | | | | | | | Several updates for s2wasm and its tests: Add explicit drops where they are emitted by LLVM already Convert loops (which are still modeled in the old way by LLVM) to wrap them in an explicit block (for the exit label). This also allows simplifying the loop creation (no need to post-process the implicit block which is the loop's body). After the engines update to 0xc we should update LLVM to model loops in the 0xc way, but for now it remains compatible with 0xb and 0xc. Fix the order of the calls to setTee() when creating tee_locals Add an explicit drop when creating the _start entry function wrapper if needed Update dot_s and llvm_autogenerated tests to remove store-results optimization (and few other minor updates) Fix the test auto-updater to fail if subprocesses fail There still seems to be a validation failure when building libc (I think it's from the stricter drop rules, but it may be in the source rather than the compiler), but this at least makes Binaryen's tests pa
* add asm2wasm option to import a mem init fileAlon Zakai2016-09-071-0/+4
| | | | | | | | apply memory segments only if there isn't a memory initializer (which we need for asmjs and asm2wasm modes) use wasm-opt to check recreated wasts for validity, as wasm-shell would try to execute them add testing for combined modes like asmjs,interpret-binary
* add drop and tee expressionsAlon Zakai2016-09-071-0/+3
|
* wast function type name desugaring is changing in spec:301 (#654)Alon Zakai2016-07-281-0/+18
|