From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- js/src/jit-test/tests/wasm/spec/start.wast | 93 ++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 js/src/jit-test/tests/wasm/spec/start.wast (limited to 'js/src/jit-test/tests/wasm/spec/start.wast') diff --git a/js/src/jit-test/tests/wasm/spec/start.wast b/js/src/jit-test/tests/wasm/spec/start.wast new file mode 100644 index 0000000000..513f7b9bab --- /dev/null +++ b/js/src/jit-test/tests/wasm/spec/start.wast @@ -0,0 +1,93 @@ +(assert_invalid + (module (func) (start 1)) + "unknown function" +) +(assert_invalid + (module + (func $main (result i32) (return (i32.const 0))) + (start $main) + ) + "start function" +) +(assert_invalid + (module + (func $main (param $a i32)) + (start $main) + ) + "start function" +) +(module + (memory (data "A")) + (func $inc + (i32.store8 + (i32.const 0) + (i32.add + (i32.load8_u (i32.const 0)) + (i32.const 1) + ) + ) + ) + (func $get (result i32) + (return (i32.load8_u (i32.const 0))) + ) + (func $main + (call $inc) + (call $inc) + (call $inc) + ) + + (start $main) + (export "inc" (func $inc)) + (export "get" (func $get)) +) +(assert_return (invoke "get") (i32.const 68)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 69)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 70)) + +(module + (memory (data "A")) + (func $inc + (i32.store8 + (i32.const 0) + (i32.add + (i32.load8_u (i32.const 0)) + (i32.const 1) + ) + ) + ) + (func $get (result i32) + (return (i32.load8_u (i32.const 0))) + ) + (func $main + (call $inc) + (call $inc) + (call $inc) + ) + (start 2) + (export "inc" (func $inc)) + (export "get" (func $get)) +) +(assert_return (invoke "get") (i32.const 68)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 69)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 70)) + +(module + (func $print_i32 (import "spectest" "print") (param i32)) + (func $main (call $print_i32 (i32.const 1))) + (start 1) +) + +(module + (func $print_i32 (import "spectest" "print") (param i32)) + (func $main (call $print_i32 (i32.const 2))) + (start $main) +) + +(assert_trap + (module (func $main (unreachable)) (start $main)) + "unreachable" +) -- cgit v1.2.3