| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
NFC (#4090)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#3792 added support for module linking and (register command to
wasm-shell, but forgot about three problems:
- Splitting spec tests prevents linking test modules together.
- Registered modules may still be used in assertions or an invoke
- Modules may re-export imported objects
This PR appends transformed modules after binary checks to a spec.wast
file, plus assertion tests and register commands. Then runs wasm-shell
on the whole file. It also keeps both the module name and its registered
name available in wasm-shell for use in shell commands and linked
modules. Furthermore, it correctly finds the module where an object is
defined even if it is imported and re-exported several times.
The updated version of imports.wast spec test is enabled to verify the
fixes.
|
|
|
|
|
|
|
|
|
|
|
| |
This change as automatically generated by:
$ ./scripts/test/generate_lld_tests.py
$ ./auto_update_tests.py --binaryen-bin=../binaryen-out/bin lld
The changes here are mostly due to:
- llvm now emits names for globals and segments
- emscripten now packs EM_ASM consts into a single contiguous segment
|
|
|
|
|
|
| |
This removes feature flags that are now included in `--wasm-staging` and
adds new experimental flags. Does not change the fuzzer's behavior at
the moment because the fuzzer does not seem to be currently enabled for
GC or typed funcref yet.
|
|
|
|
|
|
| |
This will allow .fromBinary tests be executed with the desired featurs
so there will be no difference between those tests and .from-wast tests.
Fixes #3545
|
|
|
|
|
|
|
|
|
|
|
|
| |
minify_check checks that we can print and read minified wast. The test
also, however, assumed that we round-trip such things perfectly. That's
never been true, and only by chance did this go unnoticed until now,
in #3523
The specific issue happening there is that we create a block without a
name. Then we write that as text, then read it. When we read it, we give
all such blocks a name (and we rely on optimizations to remove it later
when possible - this avoids optimizing in the parser). The extra name
looks like a bug to minify_check.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the addDefault* methods would avoid adding opt passes that we
know are incompatible with DWARF. However, that didn't handle the case of
passes that are added in other ways. For example, when running Asyncify,
emcc will run --flatten before, and that pass is not compatible with DWARF.
This PR lets us warn on that by annotating the passes themselves. Then we
use those annotation to either not run a pass at all (matching the previous
behavior) or to show a warning when necessary.
Fixes emscripten-core/emscripten#13288 . That is, concretely
after this PR running asyncify + DWARF will show a warning to the user.
|
|
|
|
| |
And demonstrate its capabilities by porting all tests of the
optimize-instructions pass to use lit and FileCheck.
|
|
|
|
|
|
|
| |
`node` is he name used by the upstream project. `nodejs` is a legacy
name used on older debian/ubunru systems.
Searching for `nodejs` first meant it was finding my local (old)
`nodejs` package even those I have a more recent `node` in my $PATH.
|
|
|
|
|
| |
(#3431)
Also improved the LLD test scripts to accomodate 64-bit tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bugs (#3401)
* Count signatures in tuple locals.
* Count nested signature types (confirming @aheejin was right, that was missing).
* Inlining was using the wrong type.
* OptimizeInstructions should return -1 for unhandled types, not error.
* The fuzzer should check for ref types as well, not just typed function references,
similar to what GC does.
* The fuzzer now creates a function if it has no other option for creating a constant
expression of a function type, then does a ref.func of that.
* Handle unreachability in call_ref binary reading.
* S-expression parsing fixes in more places, and add a tiny fuzzer for it.
* Switch fuzzer test to just have the metrics, and not print all the fuzz output which
changes a lot. Also fix noprint handling which only worked on binaries before.
* Fix Properties::getLiteral() to use the specific function type properly, and make
Literal's function constructor require that, to prevent future bugs.
* Turn all input types into nullable types, for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lit and FileCheck are the tools used to run the majority of tests in LLVM. Each
lit test file contains the commands to be run for that test, so lit tests are
much more flexible and can be more precise than our current ad hoc testing
system. FileCheck reads expected test output from comments, so it allows test
output to be written alongside and interspersed with test input, making tests
more readable and precise than in our current system.
This PR adds a new suite to check.py that runs lit tests in the test/lit
directory. A few tests have been ported to demonstrate the features of the new
test runner.
This change is motivated by a need for greater flexibility in testing wasm-split.
See #3359.
|
|
|
|
| |
This makes it easier to install libbinaryen.so into an alternative
locations. Fixes part of issue #2999 for me.
|
| |
|
|
|
|
|
|
| |
Emscripten no longer needs this information as of
https://github.com/emscripten-core/emscripten/pull/12643.
This also removes the need to export __data_end.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
Normally a wast file has a module and then asserts on it, but
some tests have just asserts without a module. In that case,
set the module to None.
(This can happen if the asserts do not refer to a module,
and are at the top of the wast file.)
|
|
|
|
|
|
|
|
|
|
| |
This will allow for the completely removal of
`__growWasmMemory` as a followup. We currently
unconditionally generate this function
in `generateMemoryGrowthFunction`.
See #3180
|
|
|
|
|
|
|
|
|
|
|
|
| |
These test output files are ignored and so contain stale output
that is neither checked during `check.py` not updated during
`auto_update_tests.py`.
There are three clases to tests here:
1. Spec tests that end in 64.wast are ignored by scripts/test/wasm2js.py
2. Spec tests that are globallyi ignoed by shared.py:SPEC_TESTS_TO_SKIP
3. hello_world.2asm.js.. I cant tell where this came remove it seems
like an anomaly.
|
| |
|
|
|
| |
Also includes a lot of new spec tests that eventually need to go into the spec repo
|
|
|
|
|
|
| |
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).
|
|
|
| |
Adds a new script `./third_party/setup.py` to conveniently install necessary dependencies for testing and fuzzing, including the SpiderMonkey JS shell (mozjs), the V8 JS shell and WABT. Other scripts now automatically pick these up when installed and fall back to look for the tools in PATH like before.
|
|
|
|
|
| |
Switch us back to C++ standard support to 14 (for now), so we can easily upgrade
again once the autoroller issues are resolved (atm the chromium roller does not
have a libc++ with c++17 support).
|
| |
|
|
|
| |
Allows for using `*` wildcards and simplifies the code!
|
| |
|
|
|
|
|
|
|
| |
outputs (#3066)
It was confusing that you had to run ./auto_update_tests.py binfmt to update
a test checked by ./check.py wasm-opt. Instead, make
./auto_update_tests.py wasm-opt update those, so it's symmetrical.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
| |
Current locale may not be UTF-8, which makes the spec/names.wast
test fail. Fixes issue #3003.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `--no-gc-sections` was added as part of #2857 but is not
needed and in fact changes the output of some tests.
`--experimental-pic` is needed these days when building shared
libraries with emscripten's abi.
After these two changes I verfied that the following command
generated no local changes (i.e. is a no-op):
./scripts/test/generate_lld_tests.py --binaryen-bin=$PWD/../binaryen-out/bin/ $PWD/../llvm-build/bin/ $PWD/../emscripten
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes issue #2970
Avoids "Exception: 'run_command unexpected stderr'" when running wasm2js tests
with nodejs-14.5.0+, which is due to extra warnings from that node:
$ cd out/test/
$ /usr/bin/node --experimental-modules --loader /builddir/build/BUILD/binaryen-version_95/scripts/test/node-esm-loader.mjs a.2asm.mjs
(node:187299) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Necessary preparations for a later PR that adds bulk memory
support to wasm2js (splitting this out so the next PR is less big):
* Fix logging of print functions in wasm2js spec tests, there
was an extra space in the output (which console.log adds
automatically between items).
* Don't assume the output is always empty, as some tests
(like bulk memory) do have expected output.
* Rename test/bulk-memory.wast as it "conflicts" with
test/spec/bulk-memory.wast - the problem is that we scan
both places, and emit files in test/wasm2js/*, so those
would collide if the names overlap.
* Extend the parsing and emitting of JS for (assert.. ) lines such as
(assert_return (invoke "foo" (i32.const 1)) (i32.const 2))
to also handle
(invoke "foo" (i32.const 1)) (i32.const 2))
Without this, we skip (invoke ..) lines in spec tests, which normally is
fine, but in bulk memory at least they have side effects we need - we
must run them before the later assertions.
|
|
|
|
| |
To avoid the conditional trailing comma.
|
|
|
|
|
|
|
| |
anyref future semantics were changed to only represent opaque host values, and thus renamed to externref.
[Chromium](https://bugs.chromium.org/p/v8/issues/detail?id=7748#c360) was just updated to today (not yet released). I couldn't find a Mozilla bugzilla ticket mentioning externref so I don't immediately know if they've updated yet.
https://github.com/WebAssembly/reference-types/pull/87
|
|
|
|
|
| |
This test verifies that functions in the llvm input source that
do stack pointer manipulation get correctly handled by
`wasm-emscripten-finalize --check-stack-overflow` (StackLimitEnforcer)
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In wasm2js we ignore things that trap in wasm that we can't
really handle, like a load from memory out of bounds would
trap in wasm, but in JS we don't want to emit a bounds check
on each load. So wasm2js focuses on programs that don't
trap.
However, this is annoying in the fuzzer as it turns out that
our behavior for places where wasm would trap was not
deterministic. That is, wasm would trap, wasm2js would not
trap and do behavior X, and wasm2js with optimizations
would also not trap but do behavior Y != X. This produced
false positives in the fuzzer (and might be annoying in
manual debugging too).
As a workaround, this adds a --deterministic flag to wasm2js,
which tries to be deterministic about what it does for cases
where wasm would trap. This handles the case of an int
division by 0 which traps in wasm but without this flag could
have different behavior in wasm2js with or without opts
(see details in the patch).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are no all driven by only by the two top level scripts:
check.py
auto_update_tests.py
What is more all of them were broken when run isolation due to
relative import rules in python3. e.g.:
```
$ scripts/test/binaryenjs.py
Traceback (most recent call last):
File "scripts/test/binaryenjs.py", line 21, in <module>
from . import shared
ImportError: cannot import name 'shared' from '__main__' (scripts/test/binaryenjs.py)
```
|
|
|
|
| |
Also, factor out auto-updating of binaryenjs testing so it lives
alongside the actual test code.
|
|
|
|
|
| |
It looks like these were only uses as part of the vanilla tests
which were removed back in #2482.
|
|
|
|
|
| |
If wasm-emscripten-finalize is given the BigInt flag, then we will
be using BigInts on the JS side, and need no legalization at all
since i64s will just be BigInts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we update the dylink section properly, we can
do the same optimization in side modules as in main ones:
if the module provides a function, don't call an $fp method
during startup, instead add it to the table ourselves and use
the relative offset to the table base.
Fix an issue when the table has no segments initially: the
code just added an offset of 0, but that's not right. Instead,
an a __table_base import and use that as the offset. As
this is ABI-specific I did it on wasm-emscripten-finalize,
leaving TableUtils to just assert on having a singleton
segment.
Add a test of a wasm file with a dylink section to the lld tests.
|
|
|
| |
An attempt to fix the node-esm-loader related [issues](https://travis-ci.org/WebAssembly/binaryen/jobs/649056649#L22931) seen on CI currently, apparently due to CI automatically picking up a newer node LTS (12.16.0 released 2020/02/11) where the API changed.
|
| |
|
|
|
|
| |
fail_if_not_identical_to_file() (#2649)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds EH support to `EffectAnalyzer`. Before `throw` and `rethrow`
conservatively set property. Now `EffectAnalyzer` has a new property
`throws` to represent an expression that can throw, and expression that
can throw sets `throws` correctly.
When EH is enabled, any calls can throw too, so we cannot reorder them
with another expression with any side effects, meaning all calls should
be treated in the same way as branches when evaluating `invalidate`.
This prevents many reorderings, so this patch sets `throws` for calls
only when the exception handling features is enabled. This is also why I
passed `--disable-exception-handling` to `wasm2js` tests. Most of code
changes outside of `EffectAnalyzer` class was made in order to pass
`FeatureSet` to it.
`throws` isn't always set whenever an expression contains a throwable
instruction. When an throwable instruction is within an inner try, it
will be caught by the corresponding inner catch, so it does not set
`throws`.
|