Skip to content

Commit

Permalink
load is the culprit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuoguo committed Oct 5, 2024
1 parent 779be15 commit 9e7740c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
19 changes: 19 additions & 0 deletions benchmarks/wasm/load.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(module
(type (;0;) (func (result i32)))
(type (;1;) (func))
(func (;0;) (type 0) (result i32)
i32.const 0
i32.const 1
i32.store
i32.const 0
i32.load
)
(func (;1;) (type 1)
call 0
;; should be 65536
;; drop
)
(start 1)
(memory (;0;) 2)
(export "main" (func 1))
)
16 changes: 8 additions & 8 deletions src/test/scala/genwasym/TestEval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ class TestEval extends FunSuite {
// TODO: the power test can be used to test the stack
// For now: 2^10 works, 2^100 results in 0 (TODO: why?),
// and 2^1000 results in a stack overflow
test("ack") { testFile("./benchmarks/wasm/ack.wat", Some("$real_main"), Some(7)) }
test("power") { testFile("./benchmarks/wasm/pow.wat", Some("$real_main"), Some(1024)) }
test("start") { testFile("./benchmarks/wasm/start.wat") }
test("fact") { testFile("./benchmarks/wasm/fact.wat", None, Some(120)) }
test("loop") { testFile("./benchmarks/wasm/loop.wat", None, Some(10)) }
test("even-odd") { testFile("./benchmarks/wasm/even_odd.wat", None, Some(1)) }
test("return") { testFile("./benchmarks/wasm/return.wat", None, None) }
// test("ack") { testFile("./benchmarks/wasm/ack.wat", Some("$real_main"), Some(7)) }
// test("power") { testFile("./benchmarks/wasm/pow.wat", Some("$real_main"), Some(1024)) }
// test("start") { testFile("./benchmarks/wasm/start.wat") }
// test("fact") { testFile("./benchmarks/wasm/fact.wat", None, Some(120)) }
// test("loop") { testFile("./benchmarks/wasm/loop.wat", None, Some(10)) }
// test("even-odd") { testFile("./benchmarks/wasm/even_odd.wat", None, Some(1)) }
// test("return") { testFile("./benchmarks/wasm/return.wat", None, None) }

// Parser works, but the memory issue remains
// test("btree") { testFile("./benchmarks/wasm/btree/2o1u-tee.wat") }

// TODO: add more wasm spec tests?
// test("memory") { testFile("./benchmarks/wasm/spectest/test.wat") }
test("load") { testFile("./benchmarks/wasm/load.wat") }
}

0 comments on commit 9e7740c

Please sign in to comment.