16 lines
493 B
Rust
16 lines
493 B
Rust
use leaf_allocators::SyncArenaAllocator;
|
|
use leaf_assembly::context::{Context, CreateConst};
|
|
use leaf_assembly::types::derivations::MakeTypeDerivations;
|
|
|
|
fn main() {
|
|
let allocator = SyncArenaAllocator::default();
|
|
let context = Context::new(&allocator);
|
|
let func = context.create_function(context.u32_t().make_fn([]));
|
|
let mut builder = func.create_body().unwrap();
|
|
builder
|
|
.ret(Some(context.create_const(42u32).into()))
|
|
.unwrap();
|
|
builder.build().unwrap();
|
|
println!("{func:#?}");
|
|
}
|