code wiki / (root) / nx_x86_64_ctx_test.nx

nx_x86_64_ctx_test.nx

buildroot/runtime/nx_x86_64_ctx_test.nx

1471 B50 linesdepth 5pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_64_ctx_test.nx -- session 6 smoke for IR-driven x86_64 codegen. Hand-builds a tiny Function via the nx_ir APIs: func main() -> i64 { return 42 } then drives x86ctx_emit_function on it, prints the asm to stdout. The bash wrapper gcc-links + runs the resulting native binary, expects exit code 42.

dependencies 6 imports · 0 importers

syscalls.nx nx_outbuf.nx nx_types.nx nx_ir.nx nx_x86_64.nx nx_x86_64_ctx.nx nx_x86_64_ctx_test.nx

imports: syscalls.nxnx_outbuf.nxnx_types.nxnx_ir.nxnx_x86_64.nxnx_x86_64_ctx.nx

imported by: nobody (leaf or entry point)

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

main out_new sys_mmap ir_module_new sys_mmap ↻ ir_type_i64 alloc_type sys_mmap ↻ ir_function_new 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_return ir_bb_sealed alloc_instr nx_assert_ptr ↻ nx_assert ↻ nx_assert_lt ↻ ir_type_void alloc_type ↻

structs

none

consts

none

functions

20func main() -> i64