Skip to content

Commit

Permalink
custom-page-sizes: a few test wat
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed May 23, 2024
1 parent 776d0cc commit db496ae
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
20 changes: 20 additions & 0 deletions wat/custom-page-sizes/1.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(module
(func (export "_start")
;; memory.grow here is expected to fail because it's already max-sized.
i32.const 1
memory.grow 0
i32.const -1
i32.ne
if
unreachable
end

memory.size 0
i32.const -1
i32.ne
if
unreachable
end
)
(memory 0xffffffff (pagesize 1))
)
4 changes: 4 additions & 0 deletions wat/custom-page-sizes/16.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(module
(func (export "_start"))
(memory 0x10000 0x10000 (pagesize 65536))
)
33 changes: 33 additions & 0 deletions wat/custom-page-sizes/trap.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(module
(func (export "i32-ok")
i32.const 27
i32.load
drop
)
(func $i32-trap (export "i32-trap")
i32.const 28
i32.load
drop
)
(func (export "i8-ok")
i32.const 30
i32.load8_u
drop
)
(func (export "i8-trap")
i32.const 31
i32.load8_u
drop
)
(func (export "i32-ok-after-grow")
i32.const 1
memory.grow
i32.const -1
i32.eq
if
unreachable
end
call $i32-trap
)
(memory 31 (pagesize 1))
)

0 comments on commit db496ae

Please sign in to comment.