summaryrefslogtreecommitdiff
path: root/check.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow setting the path to libbinaryen.so shared library (#3025)rathann2020-11-101-1/+1
| | | | This makes it easier to install libbinaryen.so into an alternative locations. Fixes part of issue #2999 for me.
* Remove remaining bits of C API tracing, which has been removed (#3322)Alon Zakai2020-11-051-30/+17
| | | It was removed in #2841
* Remove remnants of spec interpreter, and excess mozjs warning (#3262)Alon Zakai2020-10-201-5/+0
| | | | | The spec interpreter is no longer used at all. Mozjs is still used optionally, but while it was crucial in the past for test coverage, it is entirely optional now and not run by default, so no need to warn.
* Improve testing on Windows (#3142)Wouter van Oortmerssen2020-09-171-4/+0
| | | | | | This PR contains: - Changes that enable/disable tests on Windows to allow for better local testing. - Also changes many abort() into Fatal() when it is really just exiting on error. This is because abort() generates a dialog window on Windows which is not great in automated scripts. - Improvements to CMake to better work with the project in IDEs (VS).
* Upgrade to C++17 (#3103)Daniel Wirtz2020-09-061-2/+2
|
* Remove asm2wasm (#3042)Alon Zakai2020-08-171-3/+0
| | | | | | | Now that fastcomp has been removed from Emscripten, there is no need for the asm2wasm tool which it used to compile fastcomp's asm.js output to wasm. See emscripten-core/emscripten#11860
* Skip tests that fail on windows and enable all the rest (#3035)Alon Zakai2020-08-111-6/+17
| | | | | | | | | | | | | | This lets us run most tests at least on that platform. Add a new function for skipping those tests, skip_if_on_windows, so that it's easy to find which tests are disabled on windows for later fixing efforts. This fixes a few minor issues for windows, like comparisons should ignore \r in some cases. Rename all passes tests that use --dwarfdump to contain "dwarf" in their name, which makes it easy to skip those (and is clearer anyhow).
* Remove unneeded old binary validation in test suite (#3034)Alon Zakai2020-08-101-2/+0
| | | | | | | | This was useful back when we didn't have many VMs to test in, and we weren't confident in our binaries being valid wasm. Today we have lots of testing on VMs, and in particular, this test tends to fail when we do things like reorder SIMD opcode constants. (This doesn't fail on CI as we don't have v8 installed there, so this path is never reached, but it does happen locally.)
* Put validator test outputs in out/test (#2882)Heejin Ahn2020-05-311-6/+6
| | | | | | | We now put outputs of all other tests in out/test in order not to pollute the test directory, but validator tests didn't have a output file specified so their output files were written in test/validator. This adds `-o a.wasm` to validator tests command lines, in the same way as other tests, to make them go into out/test directory.
* Fix issues with cleanup dSYM in scripts for MacOS (#2871)Max Graey2020-05-261-5/+0
| | | | Remove rmtree call from check.py & auto_update_tests.py
* Use --detect-features in wasm-reduce. Fixes #2813 (#2815)Alon Zakai2020-04-281-3/+3
|
* Fix binaryenjs testing (#2810)Sam Clegg2020-04-271-2/+14
| | | | | | These tests are now optional. However, if you run them and the build is not found they will now error out, in order to avoid silently failing.
* Convert CI from travis + appveyor to github actions (#2646)Sam Clegg2020-04-211-1/+1
| | | | | | The intention is to move away from travis and appveyor which have become very slow. See: #2356
* Emit tuples in the fuzzer (#2695)Thomas Lively2020-04-151-2/+2
| | | | | | | | Emit tuple.make, tuple.extract, and multivalue control flow, and tuple locals and globals when multivalue is enabled. Also slightly refactors the top-level `makeConcrete` function to be more selective about what it tries to make based on the requested type to reduce the number of trivial nodes created because the requested type is incompatible with the requested node.
* Speed up wasm-reduce test (#2756)Alon Zakai2020-04-131-2/+2
| | | | | | The test there just wants to see that the reducer can remove a significant amount of code. I changed it from a file of 3.6K to 200 bytes, which is enough to see the effect, and much faster.
* Use std::cout for interpreter trap logging (#2755)Alon Zakai2020-04-131-1/+5
| | | | | | | | | | | | | | We used std::cerr as a workaround for that this logging interfered with spec testing. But it's easy enough to filter out this stuff for the spec tests. The benefit to using std::cout is that as you can see in the test output here, this is relevant test output - it's not a side channel for debugging. If the rest of the interpreter output is in std::cout but only traps are in std::cerr then they might end up out of order etc., so best to keep them all together. This will allow easier additions of tests for fuzz testcases
* Factor out wasm_opt testing. NFC. (#2737)Sam Clegg2020-04-091-108/+2
| | | | Also, factor out auto-updating of binaryenjs testing so it lives alongside the actual test code.
* Update Precompute to handle tuples (#2687)Thomas Lively2020-03-101-1/+1
| | | | | | This involves replacing `Literal::makeZero` with `Literal::makeZeroes` and `Literal::makeSingleZero` and updating `isConstantExpression` to handle constant tuples as well. Also makes `Literals` its own struct and adds convenience methods on it.
* DWARF: Fix debug_range handling of invalid entries (#2662)Alon Zakai2020-02-181-1/+3
| | | | | | | | | | | | | | If an invalid entry appears - either it began as such, or became invalid after optimization - we should not emit (0, 0) which is an end marker. Instead, emit an invalid entry marker, something with (0, x) for x != 0. As a bonus, if a test/passes case has "noprint" in the name, don't print the wasm, which we do by default. In the testcase here for example we just care about the dwarf, and the printed module would be quite large. Thank you to @paolosevMSFT for identifying and suggesting the fix.
* Trap when call_indirect's signatures mismatch (#2636)Heejin Ahn2020-02-031-1/+1
| | | | | | | | | | | This makes the interpreter trap when the signature in `call_indirect` instruction and that of the actual function in the table mismatch. This also makes the `wasm-ctor-eval` not evaluate `call_indirect` in case the signatures mismatch. Before we only compared the arguments' signature and the function signature, which was sufficient before we had subtypes, but now the signature in `call_indirect` and that of the actual function can be different even if the argument's signature is OK.
* Verify --version output matches CHANGELOG (#2580)Sam Clegg2020-01-101-0/+15
| | | | | | | | | | | | | | | | | The new version string looks like this: wasm-opt version 90 (version_90-18-g77329439d) The version reported here is the version from the CMakeLists.txt file followed by the git version in brackets. We verify that the main version here matches the CHANGELOG to prevent people from changing one without changeing the other. This will help with emscripten that wants to be able to programaticaly check the --version of binaryen tools. See https://github.com/emscripten-core/emscripten/issues/10175
* Add support for reference types proposal (#2451)Heejin Ahn2019-12-301-6/+11
| | | | | | | | | | | | This adds support for the reference type proposal. This includes support for all reference types (`anyref`, `funcref`(=`anyfunc`), and `nullref`) and four new instructions: `ref.null`, `ref.is_null`, `ref.func`, and new typed `select`. This also adds subtype relationship support between reference types. This does not include table instructions yet. This also does not include wasm2js support. Fixes #2444 and fixes #2447.
* Binary format code section offset tracking (#2515)Alon Zakai2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally track the binary format code section offsets, that is, when loading a binary, remember where each IR node was read from. This is necessary for DWARF debug info, as these are the offsets DWARF refers to. (Note that eventually we may want to do something else, like first read the DWARF and only then add debug info annotations into the IR in a more LLVM-like manner, but this is more straightforward and should be enough to update debug lines and ranges). This tracking adds noticeable overhead - every single IR node adds an entry in a map - so avoid it unless actually necessary. Specifically, if the user passes in -g and there are actually DWARF sections in the binary, and we are not about to remove those sections, then we need it. Print binary format code section offsets in text, when printing with -g. This will help debug and test dwarf support. It looks like ;; code offset: 0x7 as an annotation right before each node. Also add support for -g in wasm-opt tests (unlike a pass, it has just one - as a prefix). Helps #2400
* Allow test/passes tests to have arbitrary names, with a side file that ↵Alon Zakai2019-12-161-2/+3
| | | | | | contains the passes (#2532) We already supported this, but required that the filename be a number. This lets the name be anything, and we check if *.passes exists for it.
* Use wat over wast for text format filenames (#2518)Sam Clegg2019-12-081-11/+11
|
* Refactor removing module elements (#2489)Heejin Ahn2019-12-021-2/+2
| | | | | | | | | | | This creates utility functions for removing module elements: removing one element by name, and removing multiple elements using a predicate function. And makes other parts of code use it. I think this is a light-handed approach than calling `Module::updateMaps` after removing only a part of module elements. This also fixes a bug in the inlining pass: it didn't call `Module::updateMaps` after removing functions. After this patch callers don't need to additionally call it anyway.
* Update spec test suite (#2484)Heejin Ahn2019-11-291-12/+1
| | | | | | | | | | | | | 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-17/+1
| | | | | | | | 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.
* Remove vanilla tests (#2482)Heejin Ahn2019-11-261-47/+0
| | | These have not been used in years and seem outdated.
* Print only literal values when printing literals (#2469)Heejin Ahn2019-11-261-18/+0
| | | | | | | | | | | | | | | 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.
* Use package name in imports (NFC) (#2462)Heejin Ahn2019-11-221-149/+138
| | | | | Don't directly import names from shared.py and support.py, and use prefixes instead. Also this reorders imports based on PEP recommendation.
* Multivalue type creation and inspection (#2459)Thomas Lively2019-11-221-1/+1
| | | | | | | | | | | | | Adds the ability to create multivalue types from vectors of concrete value types. All types are transparently interned, so their representation is still a single uint32_t. Types can be extracted into vectors of their component parts, and all the single value types expand into vectors containing themselves. Multivalue types are not yet used in the IR, but their creation and inspection functionality is exposed and tested in the C and JS APIs. Also makes common type predicates methods of Type and improves the ergonomics of type printing.
* Simplify test scripts (NFC) (#2457)Heejin Ahn2019-11-201-255/+230
| | | | | | | | 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`.
* Improve type selection in fuzzer (#2424)Heejin Ahn2019-11-061-1/+3
| | | | | | | | | - Adds `items` function for `FeatureOptions` so we can get a vector of eligible types - Replaces hardcoded enumeration of MVP types with `getConcreteTypes`, which also adds v128 type to the list if SIMD is enabled - Removes `getType()` function; this does not seem to be used anywhere - Renames `vectorPick` with `pick` - Use the absolute path for d8 in the fuzzer
* Add --out-dir to allow setting the test output dir. (#2389)Alon Zakai2019-10-171-2/+2
| | | This allows fuzzing in parallel invocations.
* Add feature flags and validation to wasm-metadce (#2364)Thomas Lively2019-09-271-1/+1
| | | | | | Sometimes wasm-metadce is the last tool to run over a binary in Emscripten, and in that case it needs to know what features are enabled in order to emit a valid binary. For example it needs to know whether to emit a data count section.
* Ignore .manifest files in check.py (#2324)Ingvar Stepanyan2019-09-031-1/+1
| | | | | These files are produced alongside .exe when CMake is used on Windows. Subsequently, check.py finds, tries to execute them and fails since they're not excluded.
* Remove test output from source tree (#2114)Sam Clegg2019-08-211-6/+8
|
* Support --version argument in command line tools (#2304)Sam Clegg2019-08-201-7/+23
|
* Switch python indentation from 2-space to 4-space (#2299)Sam Clegg2019-08-161-472/+474
| | | | | | | | 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.
* Add basic exception handling support (#2282)Heejin Ahn2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 running a portion of binaryen test suite (#2286)Guanzhong Chen2019-08-071-24/+40
|
* Python3-ify check.py and auto_update_tests.py (#2270)Alon Zakai2019-07-311-70/+71
| | | | | 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
* Upgrade Travis CI system (#2252)Heejin Ahn2019-07-231-0/+3
| | | | | | | This upgrades the OS in the Travis CI to Bionic and GCC version to 7. This also fixes a bug that COMPILER_FLAGS was not correctly added at build time in gcc tests. Somehow this bug hasn't manifested so far, but after upgrading, this failed thread sanitizer tests because -fsanitize=thread was added only at link time and not in build time.
* Use v8 to test wasm binaries are valid in test suite binary checks (#2206)Alon Zakai2019-07-031-2/+5
|
* Split binaryenjs tests out from main check.py script (#2163)Sam Clegg2019-06-061-55/+4
|
* Fix run_gcc_tests with out-of-tree builds (#2152)Sam Clegg2019-05-311-48/+46
|
* wasm2js: unreachability fixes (#2037)Alon Zakai2019-04-221-15/+1
| | | Also test in pass-debug mode, for better coverage.
* Change default feature set to MVP (#1993)Thomas Lively2019-04-161-10/+9
| | | | | 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 segment merging to fit web limits into its own pass (#1980)Thomas Lively2019-04-081-1/+2
| | | | | | It was previously part of writing a binary, but changing the number of segments at such a late stage would not work in the presence of bulk memory's datacount section. Also updates the memory packing pass to respect the web's limits on the number of data segments.