Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
senekor committed Apr 3, 2023
commit 8e7591ae978a9e6ecf6fdc155044dcf68e2e3f64
5 changes: 3 additions & 2 deletions cranelift/filetests/src/function_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct DefinedFunction {
/// "outside-of-function" functionality, see `cranelift_jit::backend::JITBackend`.
///
/// ```
/// # let ctrl_plane = &mut Default::default();
/// use cranelift_filetests::TestFileCompiler;
/// use cranelift_reader::parse_functions;
/// use cranelift_codegen::data_value::DataValue;
Expand All @@ -58,8 +59,8 @@ struct DefinedFunction {
/// let func = parse_functions(code).unwrap().into_iter().nth(0).unwrap();
/// let mut compiler = TestFileCompiler::with_default_host_isa().unwrap();
/// compiler.declare_function(&func).unwrap();
/// compiler.define_function(func.clone()).unwrap();
/// compiler.create_trampoline_for_function(&func).unwrap();
/// compiler.define_function(func.clone(), ctrl_plane).unwrap();
/// compiler.create_trampoline_for_function(&func, ctrl_plane).unwrap();
/// let compiled = compiler.compile().unwrap();
/// let trampoline = compiled.get_trampoline(&func).unwrap();
///
Expand Down
6 changes: 5 additions & 1 deletion fuzz/fuzz_targets/cranelift-fuzzgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ impl TestCase {
ALLOWED_LIBCALLS.to_vec(),
)?;
functions.push(func);
ctrl_planes.push(ControlPlane::arbitrary(gen.u)?)

#[cfg(not(feature = "chaos"))]
ctrl_planes.push(ControlPlane::default());
#[cfg(feature = "chaos")]
ctrl_planes.push(ControlPlane::arbitrary(gen.u)?);
}
// Now reverse the functions so that the main function is at the start.
functions.reverse();
Expand Down