Skip to content

Commit

Permalink
a few more wat files
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 1, 2023
1 parent 0dcf073 commit 6a02c7b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wat/empty_func.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

(module
(func $f)
(func (export "_start")
call $f
)
(memory (export "memory") 0)
)
11 changes: 11 additions & 0 deletions wat/infiniteloop.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(module
(func (export "_start")
loop
br 0
end
)

;; a dummy memory export to appease wamr.
;; https://github.com/bytecodealliance/wasm-micro-runtime/issues/2097
(memory (export "memory") 0)
)
26 changes: 26 additions & 0 deletions wat/recurise_call_and_trap.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;; https://github.com/bytecodealliance/wasm-micro-runtime/pull/2233

(module
(func $f (param i32)
block
local.get 0
i32.load8_u
i32.eqz
br_if 0
unreachable
end
local.get 0
i32.const 1
i32.add
call $f
loop
br 0
end
)
(func (export "_start")
i32.const 0
call $f
)
(memory (export "memory") 1)
(data (i32.const 100) "\01")
)

0 comments on commit 6a02c7b

Please sign in to comment.