github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/cmd/wazero/testdata/exit_on_start_unstable.wat (about)

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