github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/imports/wasi_snapshot_preview1/testdata/exit_on_start.wat (about)

     1  (module $exit_on_start
     2    (import "wasi_snapshot_preview1" "proc_exit"
     3      (func $wasi.proc_exit (param $rval i32)))
     4  
     5    (func (export "_start")
     6       i32.const 2           ;; push $rval onto the stack
     7       call $wasi.proc_exit  ;; return a sys.ExitError to the caller
     8    )
     9  )