code wiki / (root) / opt_test.nx

opt_test.nx

buildroot/runtime/opt_test.nx

1413 B51 linesdepth 7pulls 11 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

opt_test.nx -- self-test for opt.nx. Builds a trivial IR for `(10+20)*3`, runs opt_run, checks the result collapsed to const 90.

dependencies 4 imports · 0 importers

syscalls.nx types.nx ir.nx opt.nx opt_test.nx

imports: syscalls.nxtypes.nxir.nxopt.nx

imported by: nobody (leaf or entry point)

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

main 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 ir_bb_sealed alloc_instr ↻

structs

none

consts

none

functions

11func main() -> i64 {