pr review
This commit is contained in:
@@ -19,3 +19,6 @@ log = "0.4.8"
|
|||||||
wasmparser = "0.42.1"
|
wasmparser = "0.42.1"
|
||||||
wasmprinter = "0.2.0"
|
wasmprinter = "0.2.0"
|
||||||
wasmtime-jit = { path = "../jit" }
|
wasmtime-jit = { path = "../jit" }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
wat = "1.0"
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
use cranelift_codegen::settings;
|
|
||||||
use wasmtime_jit::{CompilationStrategy, Compiler, NullResolver};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn instantiate_empty_module() {
|
|
||||||
// `(module)`
|
|
||||||
let wasm = vec![0x0, 0x61, 0x73, 0x6d, 0x01, 0x0, 0x0, 0x0];
|
|
||||||
let compilation_strategy = CompilationStrategy::Cranelift;
|
|
||||||
|
|
||||||
let isa = {
|
|
||||||
let flag_builder = settings::builder();
|
|
||||||
let isa_builder =
|
|
||||||
cranelift_native::builder().expect("host machine is not a supported target");
|
|
||||||
isa_builder.finish(settings::Flags::new(flag_builder))
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut compiler = Compiler::new(isa, compilation_strategy);
|
|
||||||
let mut imports_resolver = NullResolver {};
|
|
||||||
|
|
||||||
wasmtime_jit::instantiate(
|
|
||||||
&mut compiler,
|
|
||||||
&wasm,
|
|
||||||
&mut imports_resolver,
|
|
||||||
Default::default(),
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
.expect("failed to instantiate valid Wasm!");
|
|
||||||
}
|
|
||||||
@@ -7,3 +7,9 @@
|
|||||||
|
|
||||||
#[allow(unused_imports)] // Until we actually have some regression tests...
|
#[allow(unused_imports)] // Until we actually have some regression tests...
|
||||||
use wasmtime_fuzzing::*;
|
use wasmtime_fuzzing::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn instantiate_empty_module() {
|
||||||
|
let data = wat::parse_str(include_str!("./regressions/empty.wat")).unwrap();
|
||||||
|
oracles::instantiate(&data, wasmtime_jit::CompilationStrategy::Auto);
|
||||||
|
}
|
||||||
|
|||||||
1
crates/fuzzing/tests/regressions/empty.wat
Normal file
1
crates/fuzzing/tests/regressions/empty.wat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(module)
|
||||||
Reference in New Issue
Block a user