Browse Source
While here, move rs2wasm-add-func.wat into the same directory as the other .wat tests to keep things tidy.pull/1364/head
Dan Gohman
5 years ago
committed by
GitHub
5 changed files with 68 additions and 1 deletions
@ -0,0 +1,25 @@ |
|||
(module |
|||
(import "wasi_unstable" "proc_exit" |
|||
(func $__wasi_proc_exit (param i32))) |
|||
(import "wasi_unstable" "fd_write" |
|||
(func $__wasi_fd_write (param i32 i32 i32 i32) (result i32))) |
|||
(func $_start |
|||
(i32.store (i32.const 24) (i32.const 14)) |
|||
(i32.store (i32.const 20) (i32.const 0)) |
|||
(block |
|||
(br_if 0 |
|||
(call $__wasi_fd_write |
|||
(i32.const 1) |
|||
(i32.const 20) |
|||
(i32.const 1) |
|||
(i32.const 16))) |
|||
(br_if 0 (i32.ne (i32.load (i32.const 16)) (i32.const 14))) |
|||
(br 1) |
|||
) |
|||
(call $__wasi_proc_exit (i32.const 1)) |
|||
) |
|||
(memory 1) |
|||
(export "memory" (memory 0)) |
|||
(export "_start" (func $_start)) |
|||
(data (i32.const 0) "Hello, world!\0a") |
|||
) |
@ -0,0 +1,25 @@ |
|||
(module |
|||
(import "wasi_snapshot_preview1" "proc_exit" |
|||
(func $__wasi_proc_exit (param i32))) |
|||
(import "wasi_snapshot_preview1" "fd_write" |
|||
(func $__wasi_fd_write (param i32 i32 i32 i32) (result i32))) |
|||
(func $_start |
|||
(i32.store (i32.const 24) (i32.const 14)) |
|||
(i32.store (i32.const 20) (i32.const 0)) |
|||
(block |
|||
(br_if 0 |
|||
(call $__wasi_fd_write |
|||
(i32.const 1) |
|||
(i32.const 20) |
|||
(i32.const 1) |
|||
(i32.const 16))) |
|||
(br_if 0 (i32.ne (i32.load (i32.const 16)) (i32.const 14))) |
|||
(br 1) |
|||
) |
|||
(call $__wasi_proc_exit (i32.const 1)) |
|||
) |
|||
(memory 1) |
|||
(export "memory" (memory 0)) |
|||
(export "_start" (func $_start)) |
|||
(data (i32.const 0) "Hello, world!\0a") |
|||
) |
Loading…
Reference in new issue