wip
[bigint-presentation-code.git] / register_allocator / fuzz / fuzz_targets / fn_new.rs
1 #![no_main]
2 use bigint_presentation_code_register_allocator::{
3 function::{FnFields, Function},
4 interned::GlobalState,
5 };
6 use libfuzzer_sys::{
7 arbitrary::{Arbitrary, Unstructured},
8 fuzz_target, Corpus,
9 };
10
11 fuzz_target!(|data: &[u8]| -> Corpus {
12 GlobalState::scope(|| {
13 let u = Unstructured::new(data);
14 let Ok(fields) = FnFields::arbitrary_take_rest(u) else {
15 return Corpus::Reject;
16 };
17 Function::new(fields).expect("should succeed");
18 Corpus::Keep
19 })
20 });