From 4f92214dba106babb2f8c114e3bbfb963ee4e338 Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Sat, 13 Feb 2016 11:55:22 +1100 Subject: [PATCH] Test that the start function index space does not include imports. The v8 encoding appears to be using it's imports-and-functions index space for the start function index encoding, so these tests check that tools are mapping it correctly. --- ml-proto/test/expected-output/start.wast.log | 2 ++ ml-proto/test/start.wast | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 ml-proto/test/expected-output/start.wast.log diff --git a/ml-proto/test/expected-output/start.wast.log b/ml-proto/test/expected-output/start.wast.log new file mode 100644 index 0000000000..f74aa5848a --- /dev/null +++ b/ml-proto/test/expected-output/start.wast.log @@ -0,0 +1,2 @@ +1 : i32 +2 : i32 diff --git a/ml-proto/test/start.wast b/ml-proto/test/start.wast index 791614e955..2d8bb811fc 100644 --- a/ml-proto/test/start.wast +++ b/ml-proto/test/start.wast @@ -73,3 +73,17 @@ (assert_return (invoke "get") (i32.const 69)) (invoke "inc") (assert_return (invoke "get") (i32.const 70)) + +(module + (import $print_i32 "spectest" "print" (param i32)) + (func $main + (call_import $print_i32 (i32.const 1))) + (start 0) +) + +(module + (import $print_i32 "spectest" "print" (param i32)) + (func $main + (call_import $print_i32 (i32.const 2))) + (start $main) +)