Skip to content

Commit

Permalink
cargo fmt buzz and make lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ailisp committed Apr 21, 2021
1 parent dadc812 commit b4056da
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 8 deletions.
54 changes: 54 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions fuzz/fuzz_targets/equivalence_jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ impl PartialEq for FunctionResult {
match (self, other) {
(FunctionResult::Values(self_values), FunctionResult::Values(other_values)) => {
self_values.len() == other_values.len()
&& self_values.iter().zip(other_values.iter()).all(|(x, y)| match (x, y) {
(Val::F32(x), Val::F32(y)) => x.to_bits() == y.to_bits(),
(Val::F64(x), Val::F64(y)) => x.to_bits() == y.to_bits(),
_ => x == y,
})
&& self_values
.iter()
.zip(other_values.iter())
.all(|(x, y)| match (x, y) {
(Val::F32(x), Val::F32(y)) => x.to_bits() == y.to_bits(),
(Val::F64(x), Val::F64(y)) => x.to_bits() == y.to_bits(),
_ => x == y,
})
}
_ => true,
}
Expand Down Expand Up @@ -177,11 +180,17 @@ fuzz_target!(|module: WasmSmithModule| {
}

#[cfg(feature = "singlepass")]
let singlepass = maybe_instantiate_singlepass(&wasm_bytes).transpose().map(evaluate_instance);
let singlepass = maybe_instantiate_singlepass(&wasm_bytes)
.transpose()
.map(evaluate_instance);
#[cfg(feature = "cranelift")]
let cranelift = maybe_instantiate_cranelift(&wasm_bytes).transpose().map(evaluate_instance);
let cranelift = maybe_instantiate_cranelift(&wasm_bytes)
.transpose()
.map(evaluate_instance);
#[cfg(feature = "llvm")]
let llvm = maybe_instantiate_llvm(&wasm_bytes).transpose().map(evaluate_instance);
let llvm = maybe_instantiate_llvm(&wasm_bytes)
.transpose()
.map(evaluate_instance);

#[cfg(all(feature = "singlepass", feature = "cranelift"))]
if singlepass.is_some() && cranelift.is_some() {
Expand Down

0 comments on commit b4056da

Please sign in to comment.