Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions benchmarks/wasm/data.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (result i32)))
(func (;0;) (type 0) (param i32) (result i32)
local.get 0
i32.load8_u)
(func (;1;) (type 1) (result i32)
;; Call the `load_byte` function with an address of 0
i32.const 0
call 0)
(memory (;0;) 1)
;; (start 1) ;; should return 72
;; Define a memory with an initial size of 1 page (64KB)
(export "memory" (memory 0))
(export "main" (func 1))
;; Initialize memory using the `data` directive at offset 0
(data (;0;) (i32.const 0) "Hello"))
2 changes: 2 additions & 0 deletions src/test/scala/genwasym/TestEval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ class TestEval extends FunSuite {
test("btree") { testFile("./benchmarks/wasm/btree/2o1u-unlabeled.wat") }
test("fib") { testFile("./benchmarks/wasm/fib.wat", None, Some(144)) }

test("data") { testFile("./benchmarks/wasm/data.wat", None, Some(72)) }

// TODO: add wasm spec tests? How to utilize wast files?
}
Loading