Commit Graph

70 Commits

Author SHA1 Message Date
Alex Crichton
59b15eab13 Simplify #[test] generation for *.wast files (#507)
This commit simplifies the build script slightly for generating tests by
doing a few dull refactorings:

* Leaves formatting to `rustfmt`
* Extract bulk of code execution into a top-level shared `run_wast`
  function so each test is a one-liner
* Use `anyhow` for errors both in the script and in tests
2019-11-07 17:01:17 -06:00
Dan Gohman
d896cc34c2 Remove an obsolete workaround. (#505)
We needed a workaround when using wabt on old Linux distros due to using
old versions of `strtof`. With the switch to `wat`, we no longer need
these workarounds.
2019-11-07 13:33:17 -08:00
Peter Huene
920728d14d Implement registering JIT unwind information on Windows.
This commit implements registering unwind information for JIT functions on
Windows so that the operating system can both walk and unwind stacks containing
JIT frames.

Currently this only works with Cranelift as lightbeam does not emit unwind
information yet.

This commit also resets the stack guard page on Windows for stack overflow
exceptions, allowing reliable stack overflow traps.

With these changes, all previously disabled test suite tests (not including
the multi-value tests) on Windows are now passing.

Fixes #291.
2019-11-06 20:27:32 -08:00
Andrew Brown
3053444b57 Add more SIMD spec tests (#388)
* Add more SIMD spec tests

Also provides a helper, extract_name, for building the names needed for the generated code

* Use `cargo test ... -- --nocapture` to see test errors in CI

* Use OS-independent paths for WAST files

* Ignore 'skip-stack-guard-page'

* Temporarily disable SIMD tests

* Re-enable SIMD spec tests and only disable on Windows temporarily
2019-10-25 06:18:41 -07:00
Nick Fitzgerald
842faf5aa6 Support for multi-value wasm (#399)
* deps: bump wasmparser to 0.39.2

This has a bug fix for multi-value Wasm validation that is required for getting
the spec tests passing.

https://github.com/yurydelendik/wasmparser.rs/pull/135

* Update cranelift to 0.46.1 to get multi-value Wasm support

The `cranelift_wasm` APIs had to change a little bit to maintain state necessary
when translating multi-value Wasm blocks. The `translate_module` function now
returns a `ModuleTranslationState` that is borrowed during each function's
translation.

* Enable multi-value proposal's spec tests

This enables all the Wasm multi-value proposal's spec tests other than the ones
that rely on functions having more return values than registers available on the
target. That is not supported by cranelift yet.

* wasmtime-interface-types: always use multi-value Wasm

And remove the return pointer hacks that work around the lack of multi-value.
2019-10-17 17:12:01 -07:00
Dan Gohman
8e593506dc Don't run the spec_testsuite tests if the submodule isn't checked out. (#409)
* Don't run the spec_testsuite tests if the submodule isn't checked out.

This way, if someone checks out the repository without checking out the
submodules, they can still run "cargo test".

Also, fix a warning in the generated test runner code.

* Print a message if the spec_testsuite submodule is not enabled.

* Move the `#[cfg(test)]` to the top-level `mod`.
2019-10-09 13:34:09 -07:00
Dan Gohman
8e1b44b29c Make more code work with no_std. (#407)
* Make more code work with no_std.

no_std support is still incomplete, but this patch takes care of the
bulk of the straightforward parts.
2019-10-08 16:53:32 -07:00
Dan Gohman
5ccdf13b11 Rename --always-cranelift to --cranelift.
Also, enable use of Lightbeam in wasm2obj.
2019-10-04 17:02:31 -07:00
Dan Gohman
d4353f03cb Don't check assert_trap tests when Lightbeam is enabled.
Lightbeam doesn't yet produce trap metadata, so it can't yet match the
expected `assert_trap` messages. Disable them for now.
2019-10-02 13:42:26 -07:00
Dan Gohman
5bf2fc0ffa Don't enable Lightbeam tests if Lightbeam isn't enabled. 2019-10-02 12:06:00 -07:00
Dan Gohman
65b8afabe6 Make use of Lightbeam configurable.
This adds a `--always-lightbeam` option as well as an `--always-cranelift`
option, to allow the compilation strategy to be selected via the
command-line. This also enables regular testing for Lightbeam.
2019-10-02 11:54:06 -07:00
Andrew Brown
0667a2897d Ignore simd_const test when glibc has a floating point parsing issue 2019-09-26 15:46:18 -07:00
Andrew Brown
03a9f0e461 Run SIMD const spec test 2019-09-26 15:46:18 -07:00
Andrew Brown
ce8e8662ff Enable SIMD in WAST testsuites 2019-09-26 15:46:18 -07:00
Dan Gohman
86142f2e94 Use r# to escape strings which may be rust keywords. (#379)
This is a minor simplification, replacing a hardcoded list of keywords.
2019-09-26 13:44:43 -07:00
Dan Gohman
8ea883a603 Workaround a rounding difference in the strtof function in Centos 6. (#290)
* Workaround a rounding difference in the strtof function in Centos 6.

This difference causes the spec test const.wast to fail, so disable the
test on platforms where we detect the rounding difference occurs.
2019-08-20 23:29:19 -07:00
Till Schneidereit
a988443422 Set up CI and releases with Azure Pipelines (#237)
This Azure Pipelines setup compiles and tests Wasmtime for Linux, macOS, and Windows.

If the CI run was triggered by a new tag being created, a new release for that tag is created with a changelog relative to the last tag release and archives of the builds for all platforms.

If the CI run was triggered by new commits landing on `master`, the release `latest-master` is updated with a new changelog relative to the last tag release and archives of the new builds for all platforms.

Note: This PR also contains changes to disable a bunch of tests on Windows, which are failing due to issues with signal handling.
2019-08-03 13:41:10 +02:00
Dan Gohman
7592c99f3b Refactor the compilation and instantiation pipeline.
wasmtime-execute is now wasmtime-jit. Move `JITCode` and the TargetIsa
into a new `Compiler` type. `InstancePlus` is no more, with trampoline
functionality now handled by `Compiler`.
2019-01-03 11:47:55 -08:00
Dan Gohman
c4e10227de Tidy up trap-handling code. 2018-12-19 15:14:30 -08:00
Dan Gohman
3f24098edc Implement the remaining valid spec tests.
And lots of other miscellaneous changes. Rename InstanceWorld to
InstancePlus and reorganize its contents. This still isn't a great name,
but at least now it has a clear purpose.
2018-12-12 11:49:02 -08:00