Skip to content

Commit

Permalink
a case shows that block can have inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Oct 13, 2024
1 parent ea20ef7 commit a1caf0f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions benchmarks/wasm/block.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(module
(func $test_block (param i32 i32 i32) (result i32)
local.get 0
local.get 1
local.get 2
block (param i32 i32 i32) (result i32 i32)
i32.add
end
i32.add
)

(func $real_main (result i32)
i32.const 1
i32.const 3
i32.const 5
call $test_block
)
(export "real_main" (func $real_main))
)
3 changes: 3 additions & 0 deletions src/test/scala/genwasym/TestEval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class TestEval extends FunSuite {
test("load") { testFile("./benchmarks/wasm/load.wat", None, Some(1)) }
test("btree") { testFile("./benchmarks/wasm/btree/2o1u-unlabeled.wat") }
test("fib") { testFile("./benchmarks/wasm/fib.wat", None, Some(144)) }


test("block") { testFile("./benchmarks/wasm/block.wat", Some("$real_main"), Some(9)) }

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

0 comments on commit a1caf0f

Please sign in to comment.