mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 13:55:33 +00:00
26 lines
702 B
Rust
26 lines
702 B
Rust
#![no_main]
|
|
#[macro_use]
|
|
extern crate libfuzzer_sys;
|
|
extern crate wasmer_runtime;
|
|
extern crate wasmer_runtime_core;
|
|
extern crate wasmer_llvm_backend;
|
|
extern crate wasmer_singlepass_backend;
|
|
|
|
use wasmer_runtime::{compile, compile_with};
|
|
use wasmer_runtime_core::backend::Compiler;
|
|
|
|
fn get_llvm_compiler() -> impl Compiler {
|
|
use wasmer_llvm_backend::LLVMCompiler;
|
|
LLVMCompiler::new()
|
|
}
|
|
fn get_singlepass_compiler() -> impl Compiler {
|
|
use wasmer_singlepass_backend::SinglePassCompiler;
|
|
SinglePassCompiler::new()
|
|
}
|
|
|
|
fuzz_target!(|data: &[u8]| {
|
|
let _ = compile_with(data, &get_llvm_compiler());
|
|
let _ = compile(data);
|
|
let _ = compile_with(data, &get_singlepass_compiler());
|
|
});
|