Fixed all fuzzer targets (some API changes)
This commit is contained in:
@@ -12,5 +12,5 @@ fuzz_target!(|func: Func| {
|
||||
let _ = env_logger::try_init();
|
||||
log::debug!("func:\n{:?}", func);
|
||||
let env = regalloc2::fuzzing::func::machine_env();
|
||||
let _out = regalloc2::ion::run(&func, &env).expect("regalloc did not succeed");
|
||||
let _out = regalloc2::ion::run(&func, &env, false).expect("regalloc did not succeed");
|
||||
});
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
*/
|
||||
|
||||
#![no_main]
|
||||
use libfuzzer_sys::arbitrary::{Arbitrary, Result, Unstructured};
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use libfuzzer_sys::arbitrary::{Arbitrary, Unstructured, Result};
|
||||
|
||||
use regalloc2::fuzzing::func::{Func, Options};
|
||||
use regalloc2::checker::Checker;
|
||||
use regalloc2::fuzzing::func::{Func, Options};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct TestCase {
|
||||
@@ -18,16 +18,19 @@ struct TestCase {
|
||||
impl Arbitrary for TestCase {
|
||||
fn arbitrary(u: &mut Unstructured) -> Result<TestCase> {
|
||||
Ok(TestCase {
|
||||
func: Func::arbitrary_with_options(u, &Options {
|
||||
reused_inputs: true,
|
||||
fixed_regs: true,
|
||||
clobbers: true,
|
||||
control_flow: true,
|
||||
reducible: false,
|
||||
block_params: true,
|
||||
always_local_uses: false,
|
||||
reftypes: true,
|
||||
})?,
|
||||
func: Func::arbitrary_with_options(
|
||||
u,
|
||||
&Options {
|
||||
reused_inputs: true,
|
||||
fixed_regs: true,
|
||||
clobbers: true,
|
||||
control_flow: true,
|
||||
reducible: false,
|
||||
block_params: true,
|
||||
always_local_uses: false,
|
||||
reftypes: true,
|
||||
},
|
||||
)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -37,7 +40,7 @@ fuzz_target!(|testcase: TestCase| {
|
||||
let _ = env_logger::try_init();
|
||||
log::debug!("func:\n{:?}", func);
|
||||
let env = regalloc2::fuzzing::func::machine_env();
|
||||
let out = regalloc2::ion::run(&func, &env).expect("regalloc did not succeed");
|
||||
let out = regalloc2::ion::run(&func, &env, true).expect("regalloc did not succeed");
|
||||
|
||||
let mut checker = Checker::new(&func);
|
||||
checker.prepare(&out);
|
||||
|
||||
@@ -37,6 +37,6 @@ impl Arbitrary for TestCase {
|
||||
}
|
||||
|
||||
fuzz_target!(|t: TestCase| {
|
||||
let cfginfo = CFGInfo::new(&t.f);
|
||||
let cfginfo = CFGInfo::new(&t.f).expect("could not create CFG info");
|
||||
validate_ssa(&t.f, &cfginfo).expect("invalid SSA");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user