code wiki / (root) / wasm_test.nx

wasm_test.nx

buildroot/runtime/wasm_test.nx

1559 B49 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic wasm
docsdependenciesstructsconstsfunctions

about

wasm_test.nx -- self-test for wasm.nx. Builds a trivial IR module `func main() -> i64 { return 10 + 20 }`, runs wat_emit_module over it, verifies the output buffer is non- empty and contains some known WAT tokens.

dependencies 5 imports · 0 importers

syscalls.nx types.nx ir.nx outbuf.nx wasm.nx wasm_test.nx

imports: syscalls.nxtypes.nxir.nxoutbuf.nxwasm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ir_module_new sys_mmap ir_function_new sys_mmap ↻ ir_type_i64 alloc_type sys_mmap ↻ ir_block_new nx_assert_ptr sys_write nx_puts_err sys_write ↻ nx_assert sys_write ↻ nx_puts_err ↻ nx_assert_lt sys_write ↻ nx_puti_err sys_mmap ↻ sys_write ↻ nx_puts_err ↻ ir_const_i64 nx_assert_ptr ↻ nx_assert ↻ alloc_value nx_assert_ptr ↻ nx_assert ↻ nx_assert_lt ↻ ir_type_i64 ↻ ir_emit_binop nx_assert_ptr ↻ nx_assert ↻ alloc_instr nx_assert_ptr ↻ nx_assert ↻ nx_assert_lt ↻ alloc_value ↻ append_instr ir_emit_return

structs

none

consts

none

functions

14func contains(buf: *u8, buf_len: i64, needle: *u8) -> i64 {
called by 1: main
31func main() -> i64 {