summaryrefslogtreecommitdiff
path: root/test/spec/tail-call
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-08 11:19:32 -0800
committerGitHub <noreply@github.com>2022-11-08 19:19:32 +0000
commit10ac7f9a85969f00201ef063c0631d9660946d7b (patch)
tree40551e840639ddbc3084fb736d8cf02bbb2f67db /test/spec/tail-call
parentac20a437ada3afc67b2ed3a4fedc335c8201a7f3 (diff)
downloadwabt-10ac7f9a85969f00201ef063c0631d9660946d7b.tar.gz
wabt-10ac7f9a85969f00201ef063c0631d9660946d7b.tar.bz2
wabt-10ac7f9a85969f00201ef063c0631d9660946d7b.zip
Add tail-call spec tests and fix related parser issue (#2049)
Fixes: #2018
Diffstat (limited to 'test/spec/tail-call')
-rw-r--r--test/spec/tail-call/return_call.txt36
-rw-r--r--test/spec/tail-call/return_call_indirect.txt120
2 files changed, 156 insertions, 0 deletions
diff --git a/test/spec/tail-call/return_call.txt b/test/spec/tail-call/return_call.txt
new file mode 100644
index 00000000..74145cdb
--- /dev/null
+++ b/test/spec/tail-call/return_call.txt
@@ -0,0 +1,36 @@
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/proposals/tail-call/return_call.wast
+;;; ARGS*: --enable-tail-call
+(;; STDOUT ;;;
+out/test/spec/tail-call/return_call.wast:124: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.1.wasm:000001e: error: return signatures have inconsistent types: expected [i32], got []
+ 000001e: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:131: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.2.wasm:000001f: error: return signatures have inconsistent types: expected [i32], got [i64]
+ 000001f: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:139: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.3.wasm:000001e: error: type mismatch in return_call, expected [i32] but got []
+ 000001e: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:146: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.4.wasm:000001f: error: type mismatch in return_call, expected [f64, i32] but got []
+ 000001f: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:164: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.7.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]
+ 0000022: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:171: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.8.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]
+ 0000022: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:178: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.9.wasm:000002a: error: type mismatch in return_call, expected [i32, f64] but got [f64, i32]
+ 000002a: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:185: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.10.wasm:000002a: error: type mismatch in return_call, expected [f64, i32] but got [i32, f64]
+ 000002a: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:196: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.11.wasm:0000019: error: function variable out of range: 1 (max 1)
+ 0000019: error: OnReturnCallExpr callback failed
+out/test/spec/tail-call/return_call.wast:200: assert_invalid passed:
+ out/test/spec/tail-call/return_call/return_call.12.wasm:000001d: error: function variable out of range: 1012321300 (max 1)
+ 000001d: error: OnReturnCallExpr callback failed
+44/44 tests passed.
+;;; STDOUT ;;)
diff --git a/test/spec/tail-call/return_call_indirect.txt b/test/spec/tail-call/return_call_indirect.txt
new file mode 100644
index 00000000..1c3354c2
--- /dev/null
+++ b/test/spec/tail-call/return_call_indirect.txt
@@ -0,0 +1,120 @@
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/proposals/tail-call/return_call_indirect.wast
+;;; ARGS*: --enable-tail-call
+(;; STDOUT ;;;
+out/test/spec/tail-call/return_call_indirect.wast:234: assert_trap passed: indirect call signature mismatch
+out/test/spec/tail-call/return_call_indirect.wast:235: assert_trap passed: indirect call signature mismatch
+out/test/spec/tail-call/return_call_indirect.wast:236: assert_trap passed: undefined table index
+out/test/spec/tail-call/return_call_indirect.wast:237: assert_trap passed: undefined table index
+out/test/spec/tail-call/return_call_indirect.wast:238: assert_trap passed: undefined table index
+out/test/spec/tail-call/return_call_indirect.wast:244: assert_trap passed: indirect call signature mismatch
+out/test/spec/tail-call/return_call_indirect.wast:245: assert_trap passed: indirect call signature mismatch
+out/test/spec/tail-call/return_call_indirect.wast:273: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.1.wat:1:129: error: unexpected token "param", expected an expr.
+ ...indirect (type $sig) (result i32) (param i32) (i32.const 0) (i32.const ...
+ ^^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.1.wat:1:173: error: unexpected token ), expected EOF.
+ ...irect (type $sig) (result i32) (param i32) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:285: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.2.wat:1:116: error: unexpected token "type", expected an expr.
+ ...(return_call_indirect (param i32) (type $sig) (result i32) (i32.const 0...
+ ^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.2.wat:1:173: error: unexpected token ), expected EOF.
+ ...irect (param i32) (type $sig) (result i32) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:297: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.3.wat:1:129: error: unexpected token "type", expected an expr.
+ ...indirect (param i32) (result i32) (type $sig) (i32.const 0) (i32.const ...
+ ^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.3.wat:1:173: error: unexpected token ), expected EOF.
+ ...irect (param i32) (result i32) (type $sig) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:309: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.4.wat:1:117: error: unexpected token "type", expected an expr.
+ ...return_call_indirect (result i32) (type $sig) (param i32) (i32.const 0)...
+ ^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.4.wat:1:173: error: unexpected token ), expected EOF.
+ ...irect (result i32) (type $sig) (param i32) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:321: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.5.wat:1:117: error: unexpected token "param", expected an expr.
+ ...return_call_indirect (result i32) (param i32) (type $sig) (i32.const 0)...
+ ^^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.5.wat:1:173: error: unexpected token ), expected EOF.
+ ...irect (result i32) (param i32) (type $sig) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:333: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.6.wat:1:74: error: unexpected token "param", expected an expr.
+ ...return_call_indirect (result i32) (param i32) (i32.const 0) (i32.const ...
+ ^^^^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.6.wat:1:118: error: unexpected token ), expected EOF.
+ ...urn_call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0) ))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:345: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.7.wat:1:53: error: unexpected token $x, expected ).
+ ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))
+ ^^
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.7.wat:1:89: error: unexpected token ), expected EOF.
+ ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))
+ ^
+out/test/spec/tail-call/return_call_indirect.wast:352: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.8.wat:1:57: error: expected 0 results, got 1
+ ...ncref)(func (result i32) (return_call_indirect (type $sig) (result i32) (...
+ ^^^^^^^^^^^^^^^^^^^^
+out/test/spec/tail-call/return_call_indirect.wast:362: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.9.wat:1:82: error: expected 1 arguments, got 0
+ ...ncref)(func (result i32) (return_call_indirect (type $sig) (result i32) (...
+ ^^^^^^^^^^^^^^^^^^^^
+out/test/spec/tail-call/return_call_indirect.wast:372: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.10.wat:1:69: error: expected 1 results, got 0
+ ...))(table 0 funcref)(func (return_call_indirect (type $sig) (param i32) ...
+ ^^^^^^^^^^^^^^^^^^^^
+out/test/spec/tail-call/return_call_indirect.wast:384: assert_malformed passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.11.wat:1:86: error: expected 2 arguments, got 1
+ ...ncref)(func (result i32) (return_call_indirect (type $sig) (param i32) (r...
+ ^^^^^^^^^^^^^^^^^^^^
+out/test/spec/tail-call/return_call_indirect.wast:399: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.12.wasm:000001c: error: table variable out of range: 0 (max 0)
+ 000001c: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:407: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.13.wasm:0000024: error: type mismatch at end of function, expected [] but got [i32]
+ 0000024: error: EndFunctionBody callback failed
+out/test/spec/tail-call/return_call_indirect.wast:415: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.14.wasm:0000026: error: return signatures have inconsistent types: expected [], got [i64]
+ 0000026: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:424: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.15.wasm:0000026: error: type mismatch in return_call_indirect, expected [i32] but got []
+ 0000026: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:432: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.16.wasm:0000027: error: type mismatch in return_call_indirect, expected [f64, i32] but got []
+ 0000027: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:455: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.19.wasm:0000027: error: type mismatch in return_call_indirect, expected [i32] but got []
+ 0000027: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:463: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.20.wasm:0000028: error: type mismatch in return_call_indirect, expected [i32] but got [... i64]
+ 0000028: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:472: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.21.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]
+ 000002a: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:482: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.22.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]
+ 000002a: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:492: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.23.wasm:0000032: error: type mismatch in return_call_indirect, expected [i32, f64] but got [f64, i32]
+ 0000032: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:502: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.24.wasm:0000032: error: type mismatch in return_call_indirect, expected [f64, i32] but got [i32, f64]
+ 0000032: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:516: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.25.wasm:0000022: error: function type variable out of range: 1 (max 1)
+ 0000022: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:523: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.26.wasm:0000026: error: function type variable out of range: 1012321300 (max 1)
+ 0000026: error: OnReturnCallIndirectExpr callback failed
+out/test/spec/tail-call/return_call_indirect.wast:534: assert_invalid passed:
+ out/test/spec/tail-call/return_call_indirect/return_call_indirect.27.wasm:0000018: error: function variable out of range: 0 (max 0)
+ 0000018: error: OnElemSegmentElemExpr_RefFunc callback failed
+75/75 tests passed.
+;;; STDOUT ;;)