зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1703105 - wasm: Update spec/reftypes/bulk-memory pinned version for spec tests. r=lth
This commit updates the pinned version of the spec repo to the latest version. This allows us to remove the separate reftypes/bulk-memory repo's, as they are no merged in 'spec'. Differential Revision: https://phabricator.services.mozilla.com/D111228
This commit is contained in:
Родитель
856ac1d5aa
Коммит
d3d34743b3
|
@ -2,14 +2,6 @@
|
|||
name = 'threads'
|
||||
commit = 'dfdcb81a'
|
||||
|
||||
[[repos]]
|
||||
name = 'bulk-memory-operations'
|
||||
commit = '66d90a7d'
|
||||
|
||||
[[repos]]
|
||||
name = 'reference-types'
|
||||
commit = '9df8a3e3'
|
||||
|
||||
[[repos]]
|
||||
name = 'spec'
|
||||
commit = '7c4cbf32'
|
||||
commit = 'c9ed6580'
|
||||
|
|
|
@ -48,21 +48,3 @@ excluded_tests = [
|
|||
skip_wpt = true
|
||||
# Skip in jit-test when it's not enabled
|
||||
directive = "; skip-if: !wasmThreadsEnabled()"
|
||||
|
||||
[[repos]]
|
||||
name = "bulk-memory-operations"
|
||||
url = "https://github.com/WebAssembly/bulk-memory-operations"
|
||||
parent = "spec"
|
||||
excluded_tests = []
|
||||
# Skip in WPT where we can't guard on features being enabled
|
||||
skip_wpt = true
|
||||
|
||||
[[repos]]
|
||||
name = "reference-types"
|
||||
url = "https://github.com/WebAssembly/reference-types"
|
||||
parent = "spec"
|
||||
excluded_tests = []
|
||||
# Skip in WPT where we can't guard on features being enabled
|
||||
skip_wpt = true
|
||||
# Skip in jit-test when it's not enabled
|
||||
directive = "; skip-if: !wasmReftypesEnabled()"
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,141 +0,0 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/custom.wast
|
||||
|
||||
// ./test/core/custom.wast:1
|
||||
let $0 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\24\\10" "a custom section" "this is the payload"
|
||||
"\\00\\20\\10" "a custom section" "this is payload"
|
||||
"\\00\\11\\10" "a custom section" ""
|
||||
"\\00\\10\\00" "" "this is payload"
|
||||
"\\00\\01\\00" "" ""
|
||||
"\\00\\24\\10" "\\00\\00custom sectio\\00" "this is the payload"
|
||||
"\\00\\24\\10" "\\ef\\bb\\bfa custom sect" "this is the payload"
|
||||
"\\00\\24\\10" "a custom sect\\e2\\8c\\a3" "this is the payload"
|
||||
"\\00\\1f\\16" "module within a module" "\\00asm" "\\01\\00\\00\\00"
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:14
|
||||
let $1 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\01\\01\\00" ;; type section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\02\\01\\00" ;; import section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\03\\01\\00" ;; function section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\04\\01\\00" ;; table section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\05\\01\\00" ;; memory section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\06\\01\\00" ;; global section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\07\\01\\00" ;; export section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\09\\01\\00" ;; element section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\0a\\01\\00" ;; code section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\0b\\01\\00" ;; data section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:50
|
||||
let $2 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\07\\01\\60\\02\\7f\\7f\\01\\7f" ;; type section
|
||||
"\\00\\1a\\06" "custom" "this is the payload" ;; custom section
|
||||
"\\03\\02\\01\\00" ;; function section
|
||||
"\\07\\0a\\01\\06\\61\\64\\64\\54\\77\\6f\\00\\00" ;; export section
|
||||
"\\0a\\09\\01\\07\\00\\20\\00\\20\\01\\6a\\0b" ;; code section
|
||||
"\\00\\1b\\07" "custom2" "this is the payload" ;; custom section
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:60
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:68
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:76
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\00\\00\\05\\01\\00\\07\\00\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:84
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\26\\10" "a custom section" "this is the payload"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:92
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\25\\10" "a custom section" "this is the payload"
|
||||
"\\00\\24\\10" "a custom section" "this is the payload"
|
||||
)`), `malformed section id`);
|
||||
|
||||
// ./test/core/custom.wast:101
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\07\\01\\60\\02\\7f\\7f\\01\\7f" ;; type section
|
||||
"\\00\\25\\10" "a custom section" "this is the payload" ;; wrong length!
|
||||
"\\03\\02\\01\\00" ;; function section
|
||||
"\\0a\\09\\01\\07\\00\\20\\00\\20\\01\\6a\\0b" ;; code section
|
||||
"\\00\\1b\\07" "custom2" "this is the payload" ;; custom section
|
||||
)`), `function and code section have inconsistent lengths`);
|
||||
|
||||
// ./test/core/custom.wast:114
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm\\01\\00\\00\\00"
|
||||
"\\00asm\\01\\00\\00\\00"
|
||||
)`), `length out of bounds`);
|
||||
|
||||
// ./test/core/custom.wast:122
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\05\\03\\01\\00\\01" ;; memory section
|
||||
"\\0c\\01\\02" ;; data count section (2 segments)
|
||||
"\\0b\\06\\01\\00\\41\\00\\0b\\00" ;; data section (1 segment)
|
||||
)`), `data count and data section have inconsistent lengths`);
|
|
@ -1 +0,0 @@
|
|||
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js
|
|
@ -1 +0,0 @@
|
|||
|jit-test| skip-if: true
|
|
@ -1,336 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
if (!wasmIsSupported()) {
|
||||
quit();
|
||||
}
|
||||
|
||||
function bytes(type, bytes) {
|
||||
var typedBuffer = new Uint8Array(bytes);
|
||||
return wasmGlobalFromArrayBuffer(type, typedBuffer.buffer);
|
||||
}
|
||||
function value(type, value) {
|
||||
return new WebAssembly.Global({
|
||||
value: type,
|
||||
mutable: false,
|
||||
}, value);
|
||||
}
|
||||
|
||||
function i8x16(elements) {
|
||||
let typedBuffer = new Uint8Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i16x8(elements) {
|
||||
let typedBuffer = new Uint16Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i32x4(elements) {
|
||||
let typedBuffer = new Uint32Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i64x2(elements) {
|
||||
let typedBuffer = new BigUint64Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function f32x4(elements) {
|
||||
let typedBuffer = new Float32Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function f64x2(elements) {
|
||||
let typedBuffer = new Float64Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
|
||||
class F32x4Pattern {
|
||||
constructor(x, y, z, w) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
}
|
||||
|
||||
class F64x2Pattern {
|
||||
constructor(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
|
||||
let externrefs = {};
|
||||
let externsym = Symbol("externref");
|
||||
function externref(s) {
|
||||
if (!(s in externrefs)) externrefs[s] = { [externsym]: s };
|
||||
return externrefs[s];
|
||||
}
|
||||
function is_externref(x) {
|
||||
return (x !== null && externsym in x) ? 1 : 0;
|
||||
}
|
||||
function is_funcref(x) {
|
||||
return typeof x === "function" ? 1 : 0;
|
||||
}
|
||||
function eq_externref(x, y) {
|
||||
return x === y ? 1 : 0;
|
||||
}
|
||||
function eq_funcref(x, y) {
|
||||
return x === y ? 1 : 0;
|
||||
}
|
||||
|
||||
let spectest = {
|
||||
externref: externref,
|
||||
is_externref: is_externref,
|
||||
is_funcref: is_funcref,
|
||||
eq_externref: eq_externref,
|
||||
eq_funcref: eq_funcref,
|
||||
print: console.log.bind(console),
|
||||
print_i32: console.log.bind(console),
|
||||
print_i32_f32: console.log.bind(console),
|
||||
print_f64_f64: console.log.bind(console),
|
||||
print_f32: console.log.bind(console),
|
||||
print_f64: console.log.bind(console),
|
||||
global_i32: 666,
|
||||
global_i64: 666n,
|
||||
global_f32: 666,
|
||||
global_f64: 666,
|
||||
table: new WebAssembly.Table({
|
||||
initial: 10,
|
||||
maximum: 20,
|
||||
element: "anyfunc",
|
||||
}),
|
||||
memory: new WebAssembly.Memory({ initial: 1, maximum: 2 }),
|
||||
};
|
||||
|
||||
let linkage = {
|
||||
spectest,
|
||||
};
|
||||
|
||||
function getInstance(instanceish) {
|
||||
if (typeof instanceish === "string") {
|
||||
assertEq(
|
||||
instanceish in linkage,
|
||||
true,
|
||||
`'${instanceish}'' must be registered`,
|
||||
);
|
||||
return linkage[instanceish];
|
||||
}
|
||||
return instanceish;
|
||||
}
|
||||
|
||||
function instantiate(source) {
|
||||
let bytecode = wasmTextToBinary(source);
|
||||
let module = new WebAssembly.Module(bytecode);
|
||||
let instance = new WebAssembly.Instance(module, linkage);
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
function register(instanceish, name) {
|
||||
linkage[name] = getInstance(instanceish);
|
||||
}
|
||||
|
||||
function invoke(instanceish, field, params) {
|
||||
let func = getInstance(instanceish)[field];
|
||||
assertEq(func instanceof Function, true, "expected a function");
|
||||
return wasmLosslessInvoke(func, ...params);
|
||||
}
|
||||
|
||||
function get(instanceish, field) {
|
||||
let global = getInstance(instanceish)[field];
|
||||
assertEq(
|
||||
global instanceof WebAssembly.Global,
|
||||
true,
|
||||
"expected a WebAssembly.Global",
|
||||
);
|
||||
return global;
|
||||
}
|
||||
|
||||
function assert_trap(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("normal return", "trap");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.RuntimeError,
|
||||
true,
|
||||
"expected trap",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let StackOverflow;
|
||||
try {
|
||||
(function f() {
|
||||
1 + f();
|
||||
})();
|
||||
} catch (e) {
|
||||
StackOverflow = e.constructor;
|
||||
}
|
||||
function assert_exhaustion(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("normal return", "exhaustion");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof StackOverflow,
|
||||
true,
|
||||
"expected exhaustion",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_invalid(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("valid module", "invalid module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.LinkError ||
|
||||
err instanceof WebAssembly.CompileError,
|
||||
true,
|
||||
"expected an invalid module",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_unlinkable(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq(true, false, "expected an unlinkable module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.LinkError ||
|
||||
err instanceof WebAssembly.CompileError,
|
||||
true,
|
||||
"expected an unlinkable module",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_malformed(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("valid module", "malformed module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof TypeError ||
|
||||
err instanceof SyntaxError ||
|
||||
err instanceof WebAssembly.CompileError ||
|
||||
err instanceof WebAssembly.LinkError,
|
||||
true,
|
||||
`expected a malformed module`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_return(thunk, expected) {
|
||||
let results = thunk();
|
||||
|
||||
if (results === undefined) {
|
||||
results = [];
|
||||
} else if (!Array.isArray(results)) {
|
||||
results = [results];
|
||||
}
|
||||
if (!Array.isArray(expected)) {
|
||||
expected = [expected];
|
||||
}
|
||||
|
||||
if (!compareResults(results, expected)) {
|
||||
let got = results.map((x) => formatResult(x)).join(", ");
|
||||
let wanted = expected.map((x) => formatExpected(x)).join(", ");
|
||||
assertEq(
|
||||
`[${got}]`,
|
||||
`[${wanted}]`,
|
||||
);
|
||||
assertEq(true, false, `${got} !== ${wanted}`);
|
||||
}
|
||||
}
|
||||
|
||||
function formatResult(result) {
|
||||
if (typeof (result) === "object") {
|
||||
return wasmGlobalToString(result);
|
||||
} else {
|
||||
return `${result}`;
|
||||
}
|
||||
}
|
||||
|
||||
function formatExpected(expected) {
|
||||
if (
|
||||
expected === `f32_canonical_nan` ||
|
||||
expected === `f32_arithmetic_nan` ||
|
||||
expected === `f64_canonical_nan` ||
|
||||
expected === `f64_arithmetic_nan`
|
||||
) {
|
||||
return expected;
|
||||
} else if (expected instanceof F32x4Pattern) {
|
||||
return `f32x4(${formatExpected(expected.x)}, ${
|
||||
formatExpected(expected.y)
|
||||
}, ${formatExpected(expected.z)}, ${formatExpected(expected.w)})`;
|
||||
} else if (expected instanceof F64x2Pattern) {
|
||||
return `f64x2(${formatExpected(expected.x)}, ${
|
||||
formatExpected(expected.y)
|
||||
})`;
|
||||
} else if (typeof (expected) === "object") {
|
||||
return wasmGlobalToString(expected);
|
||||
} else {
|
||||
throw new Error("unknown expected result");
|
||||
}
|
||||
}
|
||||
|
||||
function compareResults(results, expected) {
|
||||
if (results.length !== expected.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i in results) {
|
||||
if (!compareResult(results[i], expected[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function compareResult(result, expected) {
|
||||
if (
|
||||
expected === `f32_canonical_nan` ||
|
||||
expected === `f32_arithmetic_nan`
|
||||
) {
|
||||
// TODO: compare exact NaN bits
|
||||
return wasmGlobalsEqual(result, value("f32", NaN));
|
||||
} else if (
|
||||
expected === `f64_canonical_nan` ||
|
||||
expected === `f64_arithmetic_nan`
|
||||
) {
|
||||
// TODO: compare exact NaN bits
|
||||
return wasmGlobalsEqual(result, value("f64", NaN));
|
||||
} else if (expected instanceof F32x4Pattern) {
|
||||
return compareResult(
|
||||
wasmGlobalExtractLane(result, "f32x4", 0),
|
||||
expected.x,
|
||||
) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 1), expected.y) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 2), expected.z) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 3), expected.w);
|
||||
} else if (expected instanceof F64x2Pattern) {
|
||||
return compareResult(
|
||||
wasmGlobalExtractLane(result, "f64x2", 0),
|
||||
expected.x,
|
||||
) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f64x2", 1), expected.y);
|
||||
} else if (typeof (expected) === "object") {
|
||||
return wasmGlobalsEqual(result, expected);
|
||||
} else {
|
||||
throw new Error("unknown expected result");
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,943 +0,0 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/memory_fill.wast
|
||||
|
||||
// ./test/core/memory_fill.wast:5
|
||||
let $0 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 256))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:21
|
||||
invoke($0, `test`, []);
|
||||
|
||||
// ./test/core/memory_fill.wast:23
|
||||
assert_return(() => invoke($0, `checkRange`, [0, 65280, 0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:25
|
||||
assert_return(() => invoke($0, `checkRange`, [65280, 65536, 85]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:27
|
||||
let $1 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:43
|
||||
assert_trap(() => invoke($1, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_fill.wast:45
|
||||
let $2 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0xFFFFFF00) (i32.const 0x55) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:61
|
||||
assert_trap(() => invoke($2, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_fill.wast:63
|
||||
let $3 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:79
|
||||
invoke($3, `test`, []);
|
||||
|
||||
// ./test/core/memory_fill.wast:81
|
||||
assert_return(() => invoke($3, `checkRange`, [0, 65536, 0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:83
|
||||
let $4 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0x10000) (i32.const 0x55) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:99
|
||||
invoke($4, `test`, []);
|
||||
|
||||
// ./test/core/memory_fill.wast:101
|
||||
let $5 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0x20000) (i32.const 0x55) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:117
|
||||
assert_trap(() => invoke($5, `test`, []), `out of bounds`);
|
||||
|
||||
// ./test/core/memory_fill.wast:119
|
||||
let $6 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0x1) (i32.const 0xAA) (i32.const 0xFFFE))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:135
|
||||
invoke($6, `test`, []);
|
||||
|
||||
// ./test/core/memory_fill.wast:137
|
||||
assert_return(() => invoke($6, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:139
|
||||
assert_return(() => invoke($6, `checkRange`, [1, 65535, 170]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:141
|
||||
assert_return(() => invoke($6, `checkRange`, [65535, 65536, 0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:144
|
||||
let $7 = instantiate(`(module
|
||||
(memory 1 1)
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "test")
|
||||
(memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 10))
|
||||
(memory.fill (i32.const 0x15) (i32.const 0xAA) (i32.const 4))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:161
|
||||
invoke($7, `test`, []);
|
||||
|
||||
// ./test/core/memory_fill.wast:163
|
||||
assert_return(() => invoke($7, `checkRange`, [0, 18, 0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:165
|
||||
assert_return(() => invoke($7, `checkRange`, [18, 21, 85]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:167
|
||||
assert_return(() => invoke($7, `checkRange`, [21, 25, 170]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:169
|
||||
assert_return(() => invoke($7, `checkRange`, [25, 28, 85]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:171
|
||||
assert_return(() => invoke($7, `checkRange`, [28, 65536, 0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/memory_fill.wast:173
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))`),
|
||||
`unknown memory 0`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:179
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:186
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:193
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:200
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:207
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:214
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:221
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:228
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:235
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:242
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:249
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:256
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:263
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:270
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:277
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:284
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:291
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:298
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:305
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:312
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:319
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:326
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:333
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:340
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:347
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:354
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:361
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:368
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:375
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:382
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:389
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:396
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:403
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:410
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:417
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:424
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:431
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:438
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:445
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:452
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:459
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:466
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:473
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:480
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:487
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:494
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:501
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:508
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:515
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:522
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:529
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:536
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:543
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:550
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:557
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:564
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:571
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:578
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:585
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:592
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:599
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:606
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:613
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module
|
||||
(memory 1 1)
|
||||
(func (export "testfn")
|
||||
(memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:620
|
||||
let $8 = instantiate(`(module
|
||||
(memory 1 1 )
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
|
||||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:637
|
||||
assert_trap(() => invoke($8, `run`, [65280, 37, 512]), `out of bounds`);
|
||||
|
||||
// ./test/core/memory_fill.wast:640
|
||||
assert_return(() => invoke($8, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:642
|
||||
let $9 = instantiate(`(module
|
||||
(memory 1 1 )
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
|
||||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:659
|
||||
assert_trap(() => invoke($9, `run`, [65279, 37, 514]), `out of bounds`);
|
||||
|
||||
// ./test/core/memory_fill.wast:662
|
||||
assert_return(() => invoke($9, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/memory_fill.wast:664
|
||||
let $10 = instantiate(`(module
|
||||
(memory 1 1 )
|
||||
|
||||
(func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
|
||||
(loop $$cont
|
||||
(if (i32.eq (local.get $$from) (local.get $$to))
|
||||
(then
|
||||
(return (i32.const -1))))
|
||||
(if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
|
||||
(then
|
||||
(local.set $$from (i32.add (local.get $$from) (i32.const 1)))
|
||||
(br $$cont))))
|
||||
(return (local.get $$from)))
|
||||
|
||||
(func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
|
||||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:681
|
||||
assert_trap(() => invoke($10, `run`, [65279, 37, -1]), `out of bounds`);
|
||||
|
||||
// ./test/core/memory_fill.wast:684
|
||||
assert_return(() => invoke($10, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,519 +0,0 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/bulk.wast
|
||||
|
||||
// ./test/core/bulk.wast:2
|
||||
let $0 = instantiate(`(module
|
||||
(memory 1)
|
||||
(data "foo"))`);
|
||||
|
||||
// ./test/core/bulk.wast:6
|
||||
let $1 = instantiate(`(module
|
||||
(table 3 funcref)
|
||||
(elem funcref (ref.func 0) (ref.null func) (ref.func 1))
|
||||
(func)
|
||||
(func))`);
|
||||
|
||||
// ./test/core/bulk.wast:13
|
||||
let $2 = instantiate(`(module
|
||||
(memory 1)
|
||||
|
||||
(func (export "fill") (param i32 i32 i32)
|
||||
(memory.fill
|
||||
(local.get 0)
|
||||
(local.get 1)
|
||||
(local.get 2)))
|
||||
|
||||
(func (export "load8_u") (param i32) (result i32)
|
||||
(i32.load8_u (local.get 0)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:27
|
||||
invoke($2, `fill`, [1, 255, 3]);
|
||||
|
||||
// ./test/core/bulk.wast:28
|
||||
assert_return(() => invoke($2, `load8_u`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:29
|
||||
assert_return(() => invoke($2, `load8_u`, [1]), [value("i32", 255)]);
|
||||
|
||||
// ./test/core/bulk.wast:30
|
||||
assert_return(() => invoke($2, `load8_u`, [2]), [value("i32", 255)]);
|
||||
|
||||
// ./test/core/bulk.wast:31
|
||||
assert_return(() => invoke($2, `load8_u`, [3]), [value("i32", 255)]);
|
||||
|
||||
// ./test/core/bulk.wast:32
|
||||
assert_return(() => invoke($2, `load8_u`, [4]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:35
|
||||
invoke($2, `fill`, [0, 48042, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:36
|
||||
assert_return(() => invoke($2, `load8_u`, [0]), [value("i32", 170)]);
|
||||
|
||||
// ./test/core/bulk.wast:37
|
||||
assert_return(() => invoke($2, `load8_u`, [1]), [value("i32", 170)]);
|
||||
|
||||
// ./test/core/bulk.wast:40
|
||||
invoke($2, `fill`, [0, 0, 65536]);
|
||||
|
||||
// ./test/core/bulk.wast:43
|
||||
assert_trap(
|
||||
() => invoke($2, `fill`, [65280, 1, 257]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:45
|
||||
assert_return(() => invoke($2, `load8_u`, [65280]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:46
|
||||
assert_return(() => invoke($2, `load8_u`, [65535]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:49
|
||||
invoke($2, `fill`, [65536, 0, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:52
|
||||
assert_trap(
|
||||
() => invoke($2, `fill`, [65537, 0, 0]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:57
|
||||
let $3 = instantiate(`(module
|
||||
(memory (data "\\aa\\bb\\cc\\dd"))
|
||||
|
||||
(func (export "copy") (param i32 i32 i32)
|
||||
(memory.copy
|
||||
(local.get 0)
|
||||
(local.get 1)
|
||||
(local.get 2)))
|
||||
|
||||
(func (export "load8_u") (param i32) (result i32)
|
||||
(i32.load8_u (local.get 0)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:71
|
||||
invoke($3, `copy`, [10, 0, 4]);
|
||||
|
||||
// ./test/core/bulk.wast:73
|
||||
assert_return(() => invoke($3, `load8_u`, [9]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:74
|
||||
assert_return(() => invoke($3, `load8_u`, [10]), [value("i32", 170)]);
|
||||
|
||||
// ./test/core/bulk.wast:75
|
||||
assert_return(() => invoke($3, `load8_u`, [11]), [value("i32", 187)]);
|
||||
|
||||
// ./test/core/bulk.wast:76
|
||||
assert_return(() => invoke($3, `load8_u`, [12]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:77
|
||||
assert_return(() => invoke($3, `load8_u`, [13]), [value("i32", 221)]);
|
||||
|
||||
// ./test/core/bulk.wast:78
|
||||
assert_return(() => invoke($3, `load8_u`, [14]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:81
|
||||
invoke($3, `copy`, [8, 10, 4]);
|
||||
|
||||
// ./test/core/bulk.wast:82
|
||||
assert_return(() => invoke($3, `load8_u`, [8]), [value("i32", 170)]);
|
||||
|
||||
// ./test/core/bulk.wast:83
|
||||
assert_return(() => invoke($3, `load8_u`, [9]), [value("i32", 187)]);
|
||||
|
||||
// ./test/core/bulk.wast:84
|
||||
assert_return(() => invoke($3, `load8_u`, [10]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:85
|
||||
assert_return(() => invoke($3, `load8_u`, [11]), [value("i32", 221)]);
|
||||
|
||||
// ./test/core/bulk.wast:86
|
||||
assert_return(() => invoke($3, `load8_u`, [12]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:87
|
||||
assert_return(() => invoke($3, `load8_u`, [13]), [value("i32", 221)]);
|
||||
|
||||
// ./test/core/bulk.wast:90
|
||||
invoke($3, `copy`, [10, 7, 6]);
|
||||
|
||||
// ./test/core/bulk.wast:91
|
||||
assert_return(() => invoke($3, `load8_u`, [10]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:92
|
||||
assert_return(() => invoke($3, `load8_u`, [11]), [value("i32", 170)]);
|
||||
|
||||
// ./test/core/bulk.wast:93
|
||||
assert_return(() => invoke($3, `load8_u`, [12]), [value("i32", 187)]);
|
||||
|
||||
// ./test/core/bulk.wast:94
|
||||
assert_return(() => invoke($3, `load8_u`, [13]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:95
|
||||
assert_return(() => invoke($3, `load8_u`, [14]), [value("i32", 221)]);
|
||||
|
||||
// ./test/core/bulk.wast:96
|
||||
assert_return(() => invoke($3, `load8_u`, [15]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:97
|
||||
assert_return(() => invoke($3, `load8_u`, [16]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:100
|
||||
invoke($3, `copy`, [65280, 0, 256]);
|
||||
|
||||
// ./test/core/bulk.wast:101
|
||||
invoke($3, `copy`, [65024, 65280, 256]);
|
||||
|
||||
// ./test/core/bulk.wast:104
|
||||
invoke($3, `copy`, [65536, 0, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:105
|
||||
invoke($3, `copy`, [0, 65536, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:108
|
||||
assert_trap(
|
||||
() => invoke($3, `copy`, [65537, 0, 0]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:110
|
||||
assert_trap(
|
||||
() => invoke($3, `copy`, [0, 65537, 0]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:115
|
||||
let $4 = instantiate(`(module
|
||||
(memory 1)
|
||||
(data "\\aa\\bb\\cc\\dd")
|
||||
|
||||
(func (export "init") (param i32 i32 i32)
|
||||
(memory.init 0
|
||||
(local.get 0)
|
||||
(local.get 1)
|
||||
(local.get 2)))
|
||||
|
||||
(func (export "load8_u") (param i32) (result i32)
|
||||
(i32.load8_u (local.get 0)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:129
|
||||
invoke($4, `init`, [0, 1, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:130
|
||||
assert_return(() => invoke($4, `load8_u`, [0]), [value("i32", 187)]);
|
||||
|
||||
// ./test/core/bulk.wast:131
|
||||
assert_return(() => invoke($4, `load8_u`, [1]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:132
|
||||
assert_return(() => invoke($4, `load8_u`, [2]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:135
|
||||
invoke($4, `init`, [65532, 0, 4]);
|
||||
|
||||
// ./test/core/bulk.wast:138
|
||||
assert_trap(
|
||||
() => invoke($4, `init`, [65534, 0, 3]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:140
|
||||
assert_return(() => invoke($4, `load8_u`, [65534]), [value("i32", 204)]);
|
||||
|
||||
// ./test/core/bulk.wast:141
|
||||
assert_return(() => invoke($4, `load8_u`, [65535]), [value("i32", 221)]);
|
||||
|
||||
// ./test/core/bulk.wast:144
|
||||
invoke($4, `init`, [65536, 0, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:145
|
||||
invoke($4, `init`, [0, 4, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:148
|
||||
assert_trap(
|
||||
() => invoke($4, `init`, [65537, 0, 0]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:150
|
||||
assert_trap(() => invoke($4, `init`, [0, 5, 0]), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/bulk.wast:154
|
||||
let $5 = instantiate(`(module
|
||||
(memory 1)
|
||||
(data $$p "x")
|
||||
(data $$a (memory 0) (i32.const 0) "x")
|
||||
|
||||
(func (export "drop_passive") (data.drop $$p))
|
||||
(func (export "init_passive") (param $$len i32)
|
||||
(memory.init $$p (i32.const 0) (i32.const 0) (local.get $$len)))
|
||||
|
||||
(func (export "drop_active") (data.drop $$a))
|
||||
(func (export "init_active") (param $$len i32)
|
||||
(memory.init $$a (i32.const 0) (i32.const 0) (local.get $$len)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:168
|
||||
invoke($5, `init_passive`, [1]);
|
||||
|
||||
// ./test/core/bulk.wast:169
|
||||
invoke($5, `drop_passive`, []);
|
||||
|
||||
// ./test/core/bulk.wast:170
|
||||
invoke($5, `drop_passive`, []);
|
||||
|
||||
// ./test/core/bulk.wast:171
|
||||
assert_return(() => invoke($5, `init_passive`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:172
|
||||
assert_trap(() => invoke($5, `init_passive`, [1]), `out of bounds`);
|
||||
|
||||
// ./test/core/bulk.wast:173
|
||||
invoke($5, `init_passive`, [0]);
|
||||
|
||||
// ./test/core/bulk.wast:174
|
||||
invoke($5, `drop_active`, []);
|
||||
|
||||
// ./test/core/bulk.wast:175
|
||||
assert_return(() => invoke($5, `init_active`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:176
|
||||
assert_trap(() => invoke($5, `init_active`, [1]), `out of bounds`);
|
||||
|
||||
// ./test/core/bulk.wast:177
|
||||
invoke($5, `init_active`, [0]);
|
||||
|
||||
// ./test/core/bulk.wast:181
|
||||
let $6 = instantiate(`(module
|
||||
;; 65 data segments. 64 is the smallest positive number that is encoded
|
||||
;; differently as a signed LEB.
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
|
||||
(data "")
|
||||
(func (data.drop 64)))`);
|
||||
|
||||
// ./test/core/bulk.wast:196
|
||||
let $7 = instantiate(`(module (data "goodbye") (func (data.drop 0)))`);
|
||||
|
||||
// ./test/core/bulk.wast:199
|
||||
let $8 = instantiate(`(module
|
||||
(table 3 funcref)
|
||||
(elem funcref
|
||||
(ref.func $$zero) (ref.func $$one) (ref.func $$zero) (ref.func $$one))
|
||||
|
||||
(func $$zero (result i32) (i32.const 0))
|
||||
(func $$one (result i32) (i32.const 1))
|
||||
|
||||
(func (export "init") (param i32 i32 i32)
|
||||
(table.init 0
|
||||
(local.get 0)
|
||||
(local.get 1)
|
||||
(local.get 2)))
|
||||
|
||||
(func (export "call") (param i32) (result i32)
|
||||
(call_indirect (result i32)
|
||||
(local.get 0)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:219
|
||||
assert_trap(() => invoke($8, `init`, [2, 0, 2]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/bulk.wast:221
|
||||
assert_trap(() => invoke($8, `call`, [2]), `uninitialized element 2`);
|
||||
|
||||
// ./test/core/bulk.wast:224
|
||||
invoke($8, `init`, [0, 1, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:225
|
||||
assert_return(() => invoke($8, `call`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/bulk.wast:226
|
||||
assert_return(() => invoke($8, `call`, [1]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:227
|
||||
assert_trap(() => invoke($8, `call`, [2]), `uninitialized element`);
|
||||
|
||||
// ./test/core/bulk.wast:230
|
||||
invoke($8, `init`, [1, 2, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:233
|
||||
invoke($8, `init`, [3, 0, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:234
|
||||
invoke($8, `init`, [0, 4, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:237
|
||||
assert_trap(() => invoke($8, `init`, [4, 0, 0]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/bulk.wast:239
|
||||
assert_trap(() => invoke($8, `init`, [0, 5, 0]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/bulk.wast:244
|
||||
let $9 = instantiate(`(module
|
||||
(table 1 funcref)
|
||||
(func $$f)
|
||||
(elem $$p funcref (ref.func $$f))
|
||||
(elem $$a (table 0) (i32.const 0) func $$f)
|
||||
|
||||
(func (export "drop_passive") (elem.drop $$p))
|
||||
(func (export "init_passive") (param $$len i32)
|
||||
(table.init $$p (i32.const 0) (i32.const 0) (local.get $$len))
|
||||
)
|
||||
|
||||
(func (export "drop_active") (elem.drop $$a))
|
||||
(func (export "init_active") (param $$len i32)
|
||||
(table.init $$a (i32.const 0) (i32.const 0) (local.get $$len))
|
||||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:261
|
||||
invoke($9, `init_passive`, [1]);
|
||||
|
||||
// ./test/core/bulk.wast:262
|
||||
invoke($9, `drop_passive`, []);
|
||||
|
||||
// ./test/core/bulk.wast:263
|
||||
invoke($9, `drop_passive`, []);
|
||||
|
||||
// ./test/core/bulk.wast:264
|
||||
assert_return(() => invoke($9, `init_passive`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:265
|
||||
assert_trap(() => invoke($9, `init_passive`, [1]), `out of bounds`);
|
||||
|
||||
// ./test/core/bulk.wast:266
|
||||
invoke($9, `init_passive`, [0]);
|
||||
|
||||
// ./test/core/bulk.wast:267
|
||||
invoke($9, `drop_active`, []);
|
||||
|
||||
// ./test/core/bulk.wast:268
|
||||
assert_return(() => invoke($9, `init_active`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:269
|
||||
assert_trap(() => invoke($9, `init_active`, [1]), `out of bounds`);
|
||||
|
||||
// ./test/core/bulk.wast:270
|
||||
invoke($9, `init_active`, [0]);
|
||||
|
||||
// ./test/core/bulk.wast:274
|
||||
let $10 = instantiate(`(module
|
||||
;; 65 elem segments. 64 is the smallest positive number that is encoded
|
||||
;; differently as a signed LEB.
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
|
||||
(elem funcref)
|
||||
(func (elem.drop 64)))`);
|
||||
|
||||
// ./test/core/bulk.wast:297
|
||||
let $11 = instantiate(
|
||||
`(module (elem funcref (ref.func 0)) (func (elem.drop 0)))`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:300
|
||||
let $12 = instantiate(`(module
|
||||
(table 10 funcref)
|
||||
(elem (i32.const 0) $$zero $$one $$two)
|
||||
(func $$zero (result i32) (i32.const 0))
|
||||
(func $$one (result i32) (i32.const 1))
|
||||
(func $$two (result i32) (i32.const 2))
|
||||
|
||||
(func (export "copy") (param i32 i32 i32)
|
||||
(table.copy
|
||||
(local.get 0)
|
||||
(local.get 1)
|
||||
(local.get 2)))
|
||||
|
||||
(func (export "call") (param i32) (result i32)
|
||||
(call_indirect (result i32)
|
||||
(local.get 0)))
|
||||
)`);
|
||||
|
||||
// ./test/core/bulk.wast:319
|
||||
invoke($12, `copy`, [3, 0, 3]);
|
||||
|
||||
// ./test/core/bulk.wast:321
|
||||
assert_return(() => invoke($12, `call`, [3]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:322
|
||||
assert_return(() => invoke($12, `call`, [4]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/bulk.wast:323
|
||||
assert_return(() => invoke($12, `call`, [5]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/bulk.wast:326
|
||||
invoke($12, `copy`, [0, 1, 3]);
|
||||
|
||||
// ./test/core/bulk.wast:328
|
||||
assert_return(() => invoke($12, `call`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/bulk.wast:329
|
||||
assert_return(() => invoke($12, `call`, [1]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/bulk.wast:330
|
||||
assert_return(() => invoke($12, `call`, [2]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:333
|
||||
invoke($12, `copy`, [2, 0, 3]);
|
||||
|
||||
// ./test/core/bulk.wast:335
|
||||
assert_return(() => invoke($12, `call`, [2]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/bulk.wast:336
|
||||
assert_return(() => invoke($12, `call`, [3]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/bulk.wast:337
|
||||
assert_return(() => invoke($12, `call`, [4]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/bulk.wast:340
|
||||
invoke($12, `copy`, [6, 8, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:341
|
||||
invoke($12, `copy`, [8, 6, 2]);
|
||||
|
||||
// ./test/core/bulk.wast:344
|
||||
invoke($12, `copy`, [10, 0, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:345
|
||||
invoke($12, `copy`, [0, 10, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:348
|
||||
assert_trap(() => invoke($12, `copy`, [11, 0, 0]), `out of bounds`);
|
||||
|
||||
// ./test/core/bulk.wast:350
|
||||
assert_trap(() => invoke($12, `copy`, [0, 11, 0]), `out of bounds`);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,141 +0,0 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/custom.wast
|
||||
|
||||
// ./test/core/custom.wast:1
|
||||
let $0 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\24\\10" "a custom section" "this is the payload"
|
||||
"\\00\\20\\10" "a custom section" "this is payload"
|
||||
"\\00\\11\\10" "a custom section" ""
|
||||
"\\00\\10\\00" "" "this is payload"
|
||||
"\\00\\01\\00" "" ""
|
||||
"\\00\\24\\10" "\\00\\00custom sectio\\00" "this is the payload"
|
||||
"\\00\\24\\10" "\\ef\\bb\\bfa custom sect" "this is the payload"
|
||||
"\\00\\24\\10" "a custom sect\\e2\\8c\\a3" "this is the payload"
|
||||
"\\00\\1f\\16" "module within a module" "\\00asm" "\\01\\00\\00\\00"
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:14
|
||||
let $1 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\01\\01\\00" ;; type section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\02\\01\\00" ;; import section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\03\\01\\00" ;; function section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\04\\01\\00" ;; table section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\05\\01\\00" ;; memory section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\06\\01\\00" ;; global section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\07\\01\\00" ;; export section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\09\\01\\00" ;; element section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\0a\\01\\00" ;; code section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\0b\\01\\00" ;; data section
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
"\\00\\0e\\06" "custom" "payload"
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:50
|
||||
let $2 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\07\\01\\60\\02\\7f\\7f\\01\\7f" ;; type section
|
||||
"\\00\\1a\\06" "custom" "this is the payload" ;; custom section
|
||||
"\\03\\02\\01\\00" ;; function section
|
||||
"\\07\\0a\\01\\06\\61\\64\\64\\54\\77\\6f\\00\\00" ;; export section
|
||||
"\\0a\\09\\01\\07\\00\\20\\00\\20\\01\\6a\\0b" ;; code section
|
||||
"\\00\\1b\\07" "custom2" "this is the payload" ;; custom section
|
||||
)`);
|
||||
|
||||
// ./test/core/custom.wast:60
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:68
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:76
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\00\\00\\05\\01\\00\\07\\00\\00"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:84
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\26\\10" "a custom section" "this is the payload"
|
||||
)`), `unexpected end`);
|
||||
|
||||
// ./test/core/custom.wast:92
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00\\25\\10" "a custom section" "this is the payload"
|
||||
"\\00\\24\\10" "a custom section" "this is the payload"
|
||||
)`), `malformed section id`);
|
||||
|
||||
// ./test/core/custom.wast:101
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\07\\01\\60\\02\\7f\\7f\\01\\7f" ;; type section
|
||||
"\\00\\25\\10" "a custom section" "this is the payload" ;; wrong length!
|
||||
"\\03\\02\\01\\00" ;; function section
|
||||
"\\0a\\09\\01\\07\\00\\20\\00\\20\\01\\6a\\0b" ;; code section
|
||||
"\\00\\1b\\07" "custom2" "this is the payload" ;; custom section
|
||||
)`), `function and code section have inconsistent lengths`);
|
||||
|
||||
// ./test/core/custom.wast:114
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm\\01\\00\\00\\00"
|
||||
"\\00asm\\01\\00\\00\\00"
|
||||
)`), `length out of bounds`);
|
||||
|
||||
// ./test/core/custom.wast:122
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\05\\03\\01\\00\\01" ;; memory section
|
||||
"\\0c\\01\\02" ;; data count section (2 segments)
|
||||
"\\0b\\06\\01\\00\\41\\00\\0b\\00" ;; data section (1 segment)
|
||||
)`), `data count and data section have inconsistent lengths`);
|
|
@ -1 +0,0 @@
|
|||
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js
|
|
@ -1,641 +0,0 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/global.wast
|
||||
|
||||
// ./test/core/global.wast:3
|
||||
let $0 = instantiate(`(module
|
||||
(global $$a i32 (i32.const -2))
|
||||
(global (;1;) f32 (f32.const -3))
|
||||
(global (;2;) f64 (f64.const -4))
|
||||
(global $$b i64 (i64.const -5))
|
||||
|
||||
(global $$x (mut i32) (i32.const -12))
|
||||
(global (;5;) (mut f32) (f32.const -13))
|
||||
(global (;6;) (mut f64) (f64.const -14))
|
||||
(global $$y (mut i64) (i64.const -15))
|
||||
|
||||
(global $$r externref (ref.null extern))
|
||||
(global funcref (ref.null func))
|
||||
|
||||
(func (export "get-a") (result i32) (global.get $$a))
|
||||
(func (export "get-b") (result i64) (global.get $$b))
|
||||
(func (export "get-r") (result externref) (global.get $$r))
|
||||
(func (export "get-x") (result i32) (global.get $$x))
|
||||
(func (export "get-y") (result i64) (global.get $$y))
|
||||
(func (export "set-x") (param i32) (global.set $$x (local.get 0)))
|
||||
(func (export "set-y") (param i64) (global.set $$y (local.get 0)))
|
||||
|
||||
(func (export "get-1") (result f32) (global.get 1))
|
||||
(func (export "get-2") (result f64) (global.get 2))
|
||||
(func (export "get-5") (result f32) (global.get 5))
|
||||
(func (export "get-6") (result f64) (global.get 6))
|
||||
(func (export "set-5") (param f32) (global.set 5 (local.get 0)))
|
||||
(func (export "set-6") (param f64) (global.set 6 (local.get 0)))
|
||||
|
||||
;; As the argument of control constructs and instructions
|
||||
|
||||
(memory 1)
|
||||
|
||||
(func $$dummy)
|
||||
|
||||
(func (export "as-select-first") (result i32)
|
||||
(select (global.get $$x) (i32.const 2) (i32.const 3))
|
||||
)
|
||||
(func (export "as-select-mid") (result i32)
|
||||
(select (i32.const 2) (global.get $$x) (i32.const 3))
|
||||
)
|
||||
(func (export "as-select-last") (result i32)
|
||||
(select (i32.const 2) (i32.const 3) (global.get $$x))
|
||||
)
|
||||
|
||||
(func (export "as-loop-first") (result i32)
|
||||
(loop (result i32)
|
||||
(global.get $$x) (call $$dummy) (call $$dummy)
|
||||
)
|
||||
)
|
||||
(func (export "as-loop-mid") (result i32)
|
||||
(loop (result i32)
|
||||
(call $$dummy) (global.get $$x) (call $$dummy)
|
||||
)
|
||||
)
|
||||
(func (export "as-loop-last") (result i32)
|
||||
(loop (result i32)
|
||||
(call $$dummy) (call $$dummy) (global.get $$x)
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-if-condition") (result i32)
|
||||
(if (result i32) (global.get $$x)
|
||||
(then (call $$dummy) (i32.const 2))
|
||||
(else (call $$dummy) (i32.const 3))
|
||||
)
|
||||
)
|
||||
(func (export "as-if-then") (result i32)
|
||||
(if (result i32) (i32.const 1)
|
||||
(then (global.get $$x)) (else (i32.const 2))
|
||||
)
|
||||
)
|
||||
(func (export "as-if-else") (result i32)
|
||||
(if (result i32) (i32.const 0)
|
||||
(then (i32.const 2)) (else (global.get $$x))
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-br_if-first") (result i32)
|
||||
(block (result i32)
|
||||
(br_if 0 (global.get $$x) (i32.const 2))
|
||||
(return (i32.const 3))
|
||||
)
|
||||
)
|
||||
(func (export "as-br_if-last") (result i32)
|
||||
(block (result i32)
|
||||
(br_if 0 (i32.const 2) (global.get $$x))
|
||||
(return (i32.const 3))
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-br_table-first") (result i32)
|
||||
(block (result i32)
|
||||
(global.get $$x) (i32.const 2) (br_table 0 0)
|
||||
)
|
||||
)
|
||||
(func (export "as-br_table-last") (result i32)
|
||||
(block (result i32)
|
||||
(i32.const 2) (global.get $$x) (br_table 0 0)
|
||||
)
|
||||
)
|
||||
|
||||
(func $$func (param i32 i32) (result i32) (local.get 0))
|
||||
(type $$check (func (param i32 i32) (result i32)))
|
||||
(table funcref (elem $$func))
|
||||
(func (export "as-call_indirect-first") (result i32)
|
||||
(block (result i32)
|
||||
(call_indirect (type $$check)
|
||||
(global.get $$x) (i32.const 2) (i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func (export "as-call_indirect-mid") (result i32)
|
||||
(block (result i32)
|
||||
(call_indirect (type $$check)
|
||||
(i32.const 2) (global.get $$x) (i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func (export "as-call_indirect-last") (result i32)
|
||||
(block (result i32)
|
||||
(call_indirect (type $$check)
|
||||
(i32.const 2) (i32.const 0) (global.get $$x)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-store-first")
|
||||
(global.get $$x) (i32.const 1) (i32.store)
|
||||
)
|
||||
(func (export "as-store-last")
|
||||
(i32.const 0) (global.get $$x) (i32.store)
|
||||
)
|
||||
(func (export "as-load-operand") (result i32)
|
||||
(i32.load (global.get $$x))
|
||||
)
|
||||
(func (export "as-memory.grow-value") (result i32)
|
||||
(memory.grow (global.get $$x))
|
||||
)
|
||||
|
||||
(func $$f (param i32) (result i32) (local.get 0))
|
||||
(func (export "as-call-value") (result i32)
|
||||
(call $$f (global.get $$x))
|
||||
)
|
||||
|
||||
(func (export "as-return-value") (result i32)
|
||||
(global.get $$x) (return)
|
||||
)
|
||||
(func (export "as-drop-operand")
|
||||
(drop (global.get $$x))
|
||||
)
|
||||
(func (export "as-br-value") (result i32)
|
||||
(block (result i32) (br 0 (global.get $$x)))
|
||||
)
|
||||
|
||||
(func (export "as-local.set-value") (param i32) (result i32)
|
||||
(local.set 0 (global.get $$x))
|
||||
(local.get 0)
|
||||
)
|
||||
(func (export "as-local.tee-value") (param i32) (result i32)
|
||||
(local.tee 0 (global.get $$x))
|
||||
)
|
||||
(func (export "as-global.set-value") (result i32)
|
||||
(global.set $$x (global.get $$x))
|
||||
(global.get $$x)
|
||||
)
|
||||
|
||||
(func (export "as-unary-operand") (result i32)
|
||||
(i32.eqz (global.get $$x))
|
||||
)
|
||||
(func (export "as-binary-operand") (result i32)
|
||||
(i32.mul
|
||||
(global.get $$x) (global.get $$x)
|
||||
)
|
||||
)
|
||||
(func (export "as-compare-operand") (result i32)
|
||||
(i32.gt_u
|
||||
(global.get 0) (i32.const 1)
|
||||
)
|
||||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:185
|
||||
assert_return(() => invoke($0, `get-a`, []), [value("i32", -2)]);
|
||||
|
||||
// ./test/core/global.wast:186
|
||||
assert_return(() => invoke($0, `get-b`, []), [value("i64", -5n)]);
|
||||
|
||||
// ./test/core/global.wast:187
|
||||
assert_return(() => invoke($0, `get-r`, []), [value("externref", null)]);
|
||||
|
||||
// ./test/core/global.wast:188
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", -12)]);
|
||||
|
||||
// ./test/core/global.wast:189
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", -15n)]);
|
||||
|
||||
// ./test/core/global.wast:191
|
||||
assert_return(() => invoke($0, `get-1`, []), [value("f32", -3)]);
|
||||
|
||||
// ./test/core/global.wast:192
|
||||
assert_return(() => invoke($0, `get-2`, []), [value("f64", -4)]);
|
||||
|
||||
// ./test/core/global.wast:193
|
||||
assert_return(() => invoke($0, `get-5`, []), [value("f32", -13)]);
|
||||
|
||||
// ./test/core/global.wast:194
|
||||
assert_return(() => invoke($0, `get-6`, []), [value("f64", -14)]);
|
||||
|
||||
// ./test/core/global.wast:196
|
||||
assert_return(() => invoke($0, `set-x`, [6]), []);
|
||||
|
||||
// ./test/core/global.wast:197
|
||||
assert_return(() => invoke($0, `set-y`, [7n]), []);
|
||||
|
||||
// ./test/core/global.wast:198
|
||||
assert_return(() => invoke($0, `set-5`, [value("f32", 8)]), []);
|
||||
|
||||
// ./test/core/global.wast:199
|
||||
assert_return(() => invoke($0, `set-6`, [value("f64", 9)]), []);
|
||||
|
||||
// ./test/core/global.wast:201
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:202
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", 7n)]);
|
||||
|
||||
// ./test/core/global.wast:203
|
||||
assert_return(() => invoke($0, `get-5`, []), [value("f32", 8)]);
|
||||
|
||||
// ./test/core/global.wast:204
|
||||
assert_return(() => invoke($0, `get-6`, []), [value("f64", 9)]);
|
||||
|
||||
// ./test/core/global.wast:206
|
||||
assert_return(() => invoke($0, `as-select-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:207
|
||||
assert_return(() => invoke($0, `as-select-mid`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:208
|
||||
assert_return(() => invoke($0, `as-select-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:210
|
||||
assert_return(() => invoke($0, `as-loop-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:211
|
||||
assert_return(() => invoke($0, `as-loop-mid`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:212
|
||||
assert_return(() => invoke($0, `as-loop-last`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:214
|
||||
assert_return(() => invoke($0, `as-if-condition`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:215
|
||||
assert_return(() => invoke($0, `as-if-then`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:216
|
||||
assert_return(() => invoke($0, `as-if-else`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:218
|
||||
assert_return(() => invoke($0, `as-br_if-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:219
|
||||
assert_return(() => invoke($0, `as-br_if-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:221
|
||||
assert_return(() => invoke($0, `as-br_table-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:222
|
||||
assert_return(() => invoke($0, `as-br_table-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:224
|
||||
assert_return(() => invoke($0, `as-call_indirect-first`, []), [
|
||||
value("i32", 6),
|
||||
]);
|
||||
|
||||
// ./test/core/global.wast:225
|
||||
assert_return(() => invoke($0, `as-call_indirect-mid`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:226
|
||||
assert_trap(() => invoke($0, `as-call_indirect-last`, []), `undefined element`);
|
||||
|
||||
// ./test/core/global.wast:228
|
||||
assert_return(() => invoke($0, `as-store-first`, []), []);
|
||||
|
||||
// ./test/core/global.wast:229
|
||||
assert_return(() => invoke($0, `as-store-last`, []), []);
|
||||
|
||||
// ./test/core/global.wast:230
|
||||
assert_return(() => invoke($0, `as-load-operand`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:231
|
||||
assert_return(() => invoke($0, `as-memory.grow-value`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:233
|
||||
assert_return(() => invoke($0, `as-call-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:235
|
||||
assert_return(() => invoke($0, `as-return-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:236
|
||||
assert_return(() => invoke($0, `as-drop-operand`, []), []);
|
||||
|
||||
// ./test/core/global.wast:237
|
||||
assert_return(() => invoke($0, `as-br-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:239
|
||||
assert_return(() => invoke($0, `as-local.set-value`, [1]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:240
|
||||
assert_return(() => invoke($0, `as-local.tee-value`, [1]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:241
|
||||
assert_return(() => invoke($0, `as-global.set-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:243
|
||||
assert_return(() => invoke($0, `as-unary-operand`, []), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/global.wast:244
|
||||
assert_return(() => invoke($0, `as-binary-operand`, []), [value("i32", 36)]);
|
||||
|
||||
// ./test/core/global.wast:245
|
||||
assert_return(() => invoke($0, `as-compare-operand`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:247
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global f32 (f32.const 0)) (func (global.set 0 (f32.const 1))))`,
|
||||
),
|
||||
`global is immutable`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:253
|
||||
let $1 = instantiate(
|
||||
`(module (global (mut f32) (f32.const 0)) (export "a" (global 0)))`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:254
|
||||
let $2 = instantiate(`(module (global (export "a") (mut f32) (f32.const 0)))`);
|
||||
|
||||
// ./test/core/global.wast:256
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (f32.neg (f32.const 0))))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:261
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (local.get 0)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:266
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (f32.neg (f32.const 1))))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:271
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (i32.const 0) (nop)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:276
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (nop)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:281
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (f32.const 0)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:286
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (i32.const 0) (i32.const 0)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:291
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (;empty instruction sequence;)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:296
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "" "") externref) (global funcref (global.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:301
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (global.get 0)))`),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:306
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global i32 (global.get 1)) (global i32 (i32.const 0)))`,
|
||||
),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:311
|
||||
let $3 = instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:314
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\02\\98\\80\\80\\80\\00" ;; import section
|
||||
"\\01" ;; length 1
|
||||
"\\08\\73\\70\\65\\63\\74\\65\\73\\74" ;; "spectest"
|
||||
"\\0a\\67\\6c\\6f\\62\\61\\6c\\5f\\69\\33\\32" ;; "global_i32"
|
||||
"\\03" ;; GlobalImport
|
||||
"\\7f" ;; i32
|
||||
"\\02" ;; malformed mutability
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:327
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\02\\98\\80\\80\\80\\00" ;; import section
|
||||
"\\01" ;; length 1
|
||||
"\\08\\73\\70\\65\\63\\74\\65\\73\\74" ;; "spectest"
|
||||
"\\0a\\67\\6c\\6f\\62\\61\\6c\\5f\\69\\33\\32" ;; "global_i32"
|
||||
"\\03" ;; GlobalImport
|
||||
"\\7f" ;; i32
|
||||
"\\ff" ;; malformed mutability
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:341
|
||||
let $4 = instantiate(`(module
|
||||
(global i32 (i32.const 0))
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:344
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\86\\80\\80\\80\\00" ;; global section
|
||||
"\\01" ;; length 1
|
||||
"\\7f" ;; i32
|
||||
"\\02" ;; malformed mutability
|
||||
"\\41\\00" ;; i32.const 0
|
||||
"\\0b" ;; end
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:356
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\86\\80\\80\\80\\00" ;; global section
|
||||
"\\01" ;; length 1
|
||||
"\\7f" ;; i32
|
||||
"\\ff" ;; malformed mutability
|
||||
"\\41\\00" ;; i32.const 0
|
||||
"\\0b" ;; end
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:370
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty
|
||||
(global.set $$x)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:379
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-block
|
||||
(i32.const 0)
|
||||
(block (global.set $$x))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:389
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-loop
|
||||
(i32.const 0)
|
||||
(loop (global.set $$x))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:399
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-then
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (then (global.set $$x)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:409
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-else
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (result i32) (then (i32.const 0)) (else (global.set $$x)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:419
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-br
|
||||
(i32.const 0)
|
||||
(block (br 0 (global.set $$x)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:429
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-br_if
|
||||
(i32.const 0)
|
||||
(block (br_if 0 (global.set $$x)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:439
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-br_table
|
||||
(i32.const 0)
|
||||
(block (br_table 0 (global.set $$x)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:449
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-return
|
||||
(return (global.set $$x))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:458
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-select
|
||||
(select (global.set $$x) (i32.const 1) (i32.const 2))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:467
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-global.set-value-empty-in-call
|
||||
(call 1 (global.set $$x))
|
||||
)
|
||||
(func (param i32) (result i32) (local.get 0))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:477
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$f (param i32) (result i32) (local.get 0))
|
||||
(type $$sig (func (param i32) (result i32)))
|
||||
(table funcref (elem $$f))
|
||||
(func $$type-global.set-value-empty-in-call_indirect
|
||||
(block (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(global.set $$x) (i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:496
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
`(global $$foo i32 (i32.const 0)) (global $$foo i32 (i32.const 0)) `,
|
||||
),
|
||||
`duplicate global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:500
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
`(import "" "" (global $$foo i32)) (global $$foo i32 (i32.const 0)) `,
|
||||
),
|
||||
`duplicate global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:504
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
`(import "" "" (global $$foo i32)) (import "" "" (global $$foo i32)) `,
|
||||
),
|
||||
`duplicate global`,
|
||||
);
|
|
@ -1 +0,0 @@
|
|||
|jit-test| skip-if: true
|
|
@ -1,336 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
if (!wasmIsSupported()) {
|
||||
quit();
|
||||
}
|
||||
|
||||
function bytes(type, bytes) {
|
||||
var typedBuffer = new Uint8Array(bytes);
|
||||
return wasmGlobalFromArrayBuffer(type, typedBuffer.buffer);
|
||||
}
|
||||
function value(type, value) {
|
||||
return new WebAssembly.Global({
|
||||
value: type,
|
||||
mutable: false,
|
||||
}, value);
|
||||
}
|
||||
|
||||
function i8x16(elements) {
|
||||
let typedBuffer = new Uint8Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i16x8(elements) {
|
||||
let typedBuffer = new Uint16Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i32x4(elements) {
|
||||
let typedBuffer = new Uint32Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function i64x2(elements) {
|
||||
let typedBuffer = new BigUint64Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function f32x4(elements) {
|
||||
let typedBuffer = new Float32Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
function f64x2(elements) {
|
||||
let typedBuffer = new Float64Array(elements);
|
||||
return wasmGlobalFromArrayBuffer("v128", typedBuffer.buffer);
|
||||
}
|
||||
|
||||
class F32x4Pattern {
|
||||
constructor(x, y, z, w) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
}
|
||||
|
||||
class F64x2Pattern {
|
||||
constructor(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
|
||||
let externrefs = {};
|
||||
let externsym = Symbol("externref");
|
||||
function externref(s) {
|
||||
if (!(s in externrefs)) externrefs[s] = { [externsym]: s };
|
||||
return externrefs[s];
|
||||
}
|
||||
function is_externref(x) {
|
||||
return (x !== null && externsym in x) ? 1 : 0;
|
||||
}
|
||||
function is_funcref(x) {
|
||||
return typeof x === "function" ? 1 : 0;
|
||||
}
|
||||
function eq_externref(x, y) {
|
||||
return x === y ? 1 : 0;
|
||||
}
|
||||
function eq_funcref(x, y) {
|
||||
return x === y ? 1 : 0;
|
||||
}
|
||||
|
||||
let spectest = {
|
||||
externref: externref,
|
||||
is_externref: is_externref,
|
||||
is_funcref: is_funcref,
|
||||
eq_externref: eq_externref,
|
||||
eq_funcref: eq_funcref,
|
||||
print: console.log.bind(console),
|
||||
print_i32: console.log.bind(console),
|
||||
print_i32_f32: console.log.bind(console),
|
||||
print_f64_f64: console.log.bind(console),
|
||||
print_f32: console.log.bind(console),
|
||||
print_f64: console.log.bind(console),
|
||||
global_i32: 666,
|
||||
global_i64: 666n,
|
||||
global_f32: 666,
|
||||
global_f64: 666,
|
||||
table: new WebAssembly.Table({
|
||||
initial: 10,
|
||||
maximum: 20,
|
||||
element: "anyfunc",
|
||||
}),
|
||||
memory: new WebAssembly.Memory({ initial: 1, maximum: 2 }),
|
||||
};
|
||||
|
||||
let linkage = {
|
||||
spectest,
|
||||
};
|
||||
|
||||
function getInstance(instanceish) {
|
||||
if (typeof instanceish === "string") {
|
||||
assertEq(
|
||||
instanceish in linkage,
|
||||
true,
|
||||
`'${instanceish}'' must be registered`,
|
||||
);
|
||||
return linkage[instanceish];
|
||||
}
|
||||
return instanceish;
|
||||
}
|
||||
|
||||
function instantiate(source) {
|
||||
let bytecode = wasmTextToBinary(source);
|
||||
let module = new WebAssembly.Module(bytecode);
|
||||
let instance = new WebAssembly.Instance(module, linkage);
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
function register(instanceish, name) {
|
||||
linkage[name] = getInstance(instanceish);
|
||||
}
|
||||
|
||||
function invoke(instanceish, field, params) {
|
||||
let func = getInstance(instanceish)[field];
|
||||
assertEq(func instanceof Function, true, "expected a function");
|
||||
return wasmLosslessInvoke(func, ...params);
|
||||
}
|
||||
|
||||
function get(instanceish, field) {
|
||||
let global = getInstance(instanceish)[field];
|
||||
assertEq(
|
||||
global instanceof WebAssembly.Global,
|
||||
true,
|
||||
"expected a WebAssembly.Global",
|
||||
);
|
||||
return global;
|
||||
}
|
||||
|
||||
function assert_trap(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("normal return", "trap");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.RuntimeError,
|
||||
true,
|
||||
"expected trap",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let StackOverflow;
|
||||
try {
|
||||
(function f() {
|
||||
1 + f();
|
||||
})();
|
||||
} catch (e) {
|
||||
StackOverflow = e.constructor;
|
||||
}
|
||||
function assert_exhaustion(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("normal return", "exhaustion");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof StackOverflow,
|
||||
true,
|
||||
"expected exhaustion",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_invalid(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("valid module", "invalid module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.LinkError ||
|
||||
err instanceof WebAssembly.CompileError,
|
||||
true,
|
||||
"expected an invalid module",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_unlinkable(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq(true, false, "expected an unlinkable module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof WebAssembly.LinkError ||
|
||||
err instanceof WebAssembly.CompileError,
|
||||
true,
|
||||
"expected an unlinkable module",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_malformed(thunk, message) {
|
||||
try {
|
||||
thunk();
|
||||
assertEq("valid module", "malformed module");
|
||||
} catch (err) {
|
||||
assertEq(
|
||||
err instanceof TypeError ||
|
||||
err instanceof SyntaxError ||
|
||||
err instanceof WebAssembly.CompileError ||
|
||||
err instanceof WebAssembly.LinkError,
|
||||
true,
|
||||
`expected a malformed module`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assert_return(thunk, expected) {
|
||||
let results = thunk();
|
||||
|
||||
if (results === undefined) {
|
||||
results = [];
|
||||
} else if (!Array.isArray(results)) {
|
||||
results = [results];
|
||||
}
|
||||
if (!Array.isArray(expected)) {
|
||||
expected = [expected];
|
||||
}
|
||||
|
||||
if (!compareResults(results, expected)) {
|
||||
let got = results.map((x) => formatResult(x)).join(", ");
|
||||
let wanted = expected.map((x) => formatExpected(x)).join(", ");
|
||||
assertEq(
|
||||
`[${got}]`,
|
||||
`[${wanted}]`,
|
||||
);
|
||||
assertEq(true, false, `${got} !== ${wanted}`);
|
||||
}
|
||||
}
|
||||
|
||||
function formatResult(result) {
|
||||
if (typeof (result) === "object") {
|
||||
return wasmGlobalToString(result);
|
||||
} else {
|
||||
return `${result}`;
|
||||
}
|
||||
}
|
||||
|
||||
function formatExpected(expected) {
|
||||
if (
|
||||
expected === `f32_canonical_nan` ||
|
||||
expected === `f32_arithmetic_nan` ||
|
||||
expected === `f64_canonical_nan` ||
|
||||
expected === `f64_arithmetic_nan`
|
||||
) {
|
||||
return expected;
|
||||
} else if (expected instanceof F32x4Pattern) {
|
||||
return `f32x4(${formatExpected(expected.x)}, ${
|
||||
formatExpected(expected.y)
|
||||
}, ${formatExpected(expected.z)}, ${formatExpected(expected.w)})`;
|
||||
} else if (expected instanceof F64x2Pattern) {
|
||||
return `f64x2(${formatExpected(expected.x)}, ${
|
||||
formatExpected(expected.y)
|
||||
})`;
|
||||
} else if (typeof (expected) === "object") {
|
||||
return wasmGlobalToString(expected);
|
||||
} else {
|
||||
throw new Error("unknown expected result");
|
||||
}
|
||||
}
|
||||
|
||||
function compareResults(results, expected) {
|
||||
if (results.length !== expected.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i in results) {
|
||||
if (!compareResult(results[i], expected[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function compareResult(result, expected) {
|
||||
if (
|
||||
expected === `f32_canonical_nan` ||
|
||||
expected === `f32_arithmetic_nan`
|
||||
) {
|
||||
// TODO: compare exact NaN bits
|
||||
return wasmGlobalsEqual(result, value("f32", NaN));
|
||||
} else if (
|
||||
expected === `f64_canonical_nan` ||
|
||||
expected === `f64_arithmetic_nan`
|
||||
) {
|
||||
// TODO: compare exact NaN bits
|
||||
return wasmGlobalsEqual(result, value("f64", NaN));
|
||||
} else if (expected instanceof F32x4Pattern) {
|
||||
return compareResult(
|
||||
wasmGlobalExtractLane(result, "f32x4", 0),
|
||||
expected.x,
|
||||
) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 1), expected.y) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 2), expected.z) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f32x4", 3), expected.w);
|
||||
} else if (expected instanceof F64x2Pattern) {
|
||||
return compareResult(
|
||||
wasmGlobalExtractLane(result, "f64x2", 0),
|
||||
expected.x,
|
||||
) &&
|
||||
compareResult(wasmGlobalExtractLane(result, "f64x2", 1), expected.y);
|
||||
} else if (typeof (expected) === "object") {
|
||||
return wasmGlobalsEqual(result, expected);
|
||||
} else {
|
||||
throw new Error("unknown expected result");
|
||||
}
|
||||
}
|
|
@ -60,12 +60,13 @@ let $5 = instantiate(`(module binary
|
|||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\04\\04\\01" ;; Table section with 1 entry
|
||||
"\\70\\00\\00" ;; no max, minimum 0, funcref
|
||||
"\\09\\07\\01" ;; Element section with 1 entry
|
||||
"\\09\\09\\01" ;; Element section with 1 entry
|
||||
"\\02" ;; Element with explicit table index
|
||||
"\\80\\00" ;; Table index 0, encoded with 2 bytes
|
||||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
"\\41\\00\\0b\\00\\00" ;; (i32.const 0) with no elements
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:40
|
||||
// ./test/core/binary-leb128.wast:41
|
||||
let $6 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00" ;; custom section
|
||||
|
@ -75,7 +76,7 @@ let $6 = instantiate(`(module binary
|
|||
"23456789" ;; sequence of bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:48
|
||||
// ./test/core/binary-leb128.wast:49
|
||||
let $7 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00" ;; custom section
|
||||
|
@ -85,7 +86,7 @@ let $7 = instantiate(`(module binary
|
|||
"9" ;; sequence of bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:56
|
||||
// ./test/core/binary-leb128.wast:57
|
||||
let $8 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\08\\01" ;; type section
|
||||
|
@ -96,7 +97,7 @@ let $8 = instantiate(`(module binary
|
|||
"\\7f" ;; result type
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:65
|
||||
// ./test/core/binary-leb128.wast:66
|
||||
let $9 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\08\\01" ;; type section
|
||||
|
@ -107,7 +108,7 @@ let $9 = instantiate(`(module binary
|
|||
"\\7f" ;; result type
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:74
|
||||
// ./test/core/binary-leb128.wast:75
|
||||
let $10 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -121,7 +122,7 @@ let $10 = instantiate(`(module binary
|
|||
"\\00" ;; import signature index
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:86
|
||||
// ./test/core/binary-leb128.wast:87
|
||||
let $11 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -135,7 +136,7 @@ let $11 = instantiate(`(module binary
|
|||
"\\00" ;; import signature index
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:98
|
||||
// ./test/core/binary-leb128.wast:99
|
||||
let $12 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -149,7 +150,7 @@ let $12 = instantiate(`(module binary
|
|||
"\\80\\00" ;; import signature index, encoded with 2 bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:110
|
||||
// ./test/core/binary-leb128.wast:111
|
||||
let $13 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -160,7 +161,7 @@ let $13 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:119
|
||||
// ./test/core/binary-leb128.wast:120
|
||||
let $14 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -175,7 +176,7 @@ let $14 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:132
|
||||
// ./test/core/binary-leb128.wast:133
|
||||
let $15 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -190,7 +191,7 @@ let $15 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:145
|
||||
// ./test/core/binary-leb128.wast:146
|
||||
let $16 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -202,7 +203,7 @@ let $16 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:157
|
||||
// ./test/core/binary-leb128.wast:158
|
||||
let $17 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -211,7 +212,7 @@ let $17 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:164
|
||||
// ./test/core/binary-leb128.wast:165
|
||||
let $18 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -220,7 +221,7 @@ let $18 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:171
|
||||
// ./test/core/binary-leb128.wast:172
|
||||
let $19 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0a\\01" ;; Global section with 1 entry
|
||||
|
@ -229,7 +230,7 @@ let $19 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:178
|
||||
// ./test/core/binary-leb128.wast:179
|
||||
let $20 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0a\\01" ;; Global section with 1 entry
|
||||
|
@ -238,7 +239,7 @@ let $20 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:186
|
||||
// ./test/core/binary-leb128.wast:187
|
||||
let $21 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -247,7 +248,7 @@ let $21 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:193
|
||||
// ./test/core/binary-leb128.wast:194
|
||||
let $22 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -256,7 +257,7 @@ let $22 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:200
|
||||
// ./test/core/binary-leb128.wast:201
|
||||
let $23 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0f\\01" ;; Global section with 1 entry
|
||||
|
@ -265,7 +266,7 @@ let $23 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:207
|
||||
// ./test/core/binary-leb128.wast:208
|
||||
let $24 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0f\\01" ;; Global section with 1 entry
|
||||
|
@ -274,7 +275,7 @@ let $24 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:216
|
||||
// ./test/core/binary-leb128.wast:217
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -282,7 +283,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\80\\00" ;; no max, minimum 2 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:224
|
||||
// ./test/core/binary-leb128.wast:225
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -291,7 +292,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\80\\00" ;; max 2 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:233
|
||||
// ./test/core/binary-leb128.wast:234
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -302,7 +303,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with contents ""
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:244
|
||||
// ./test/core/binary-leb128.wast:245
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -313,7 +314,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:255
|
||||
// ./test/core/binary-leb128.wast:256
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -324,7 +325,7 @@ assert_malformed(() =>
|
|||
"2" ;; sequence of bytes
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:266
|
||||
// ./test/core/binary-leb128.wast:267
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -335,7 +336,7 @@ assert_malformed(() =>
|
|||
"4" ;; sequence of bytes
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:277
|
||||
// ./test/core/binary-leb128.wast:278
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -347,7 +348,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:289
|
||||
// ./test/core/binary-leb128.wast:290
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -359,7 +360,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:301
|
||||
// ./test/core/binary-leb128.wast:302
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -374,7 +375,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:316
|
||||
// ./test/core/binary-leb128.wast:317
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -389,7 +390,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:331
|
||||
// ./test/core/binary-leb128.wast:332
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -404,7 +405,7 @@ assert_malformed(() =>
|
|||
"\\80\\80\\80\\80\\80\\00" ;; import signature index 0 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:346
|
||||
// ./test/core/binary-leb128.wast:347
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -416,7 +417,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:358
|
||||
// ./test/core/binary-leb128.wast:359
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -432,7 +433,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:374
|
||||
// ./test/core/binary-leb128.wast:375
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -448,7 +449,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:390
|
||||
// ./test/core/binary-leb128.wast:391
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -461,7 +462,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:403
|
||||
// ./test/core/binary-leb128.wast:404
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -480,7 +481,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:422
|
||||
// ./test/core/binary-leb128.wast:423
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -499,7 +500,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:441
|
||||
// ./test/core/binary-leb128.wast:442
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -518,7 +519,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:460
|
||||
// ./test/core/binary-leb128.wast:461
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -537,7 +538,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:481
|
||||
// ./test/core/binary-leb128.wast:482
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -547,7 +548,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:491
|
||||
// ./test/core/binary-leb128.wast:492
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -557,7 +558,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:502
|
||||
// ./test/core/binary-leb128.wast:503
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -567,7 +568,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:512
|
||||
// ./test/core/binary-leb128.wast:513
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -577,7 +578,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:524
|
||||
// ./test/core/binary-leb128.wast:525
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -585,7 +586,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\70" ;; no max, minimum 2 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:532
|
||||
// ./test/core/binary-leb128.wast:533
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -593,7 +594,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\40" ;; no max, minimum 2 with some unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:540
|
||||
// ./test/core/binary-leb128.wast:541
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -602,7 +603,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\10" ;; max 2 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:549
|
||||
// ./test/core/binary-leb128.wast:550
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -611,7 +612,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\40" ;; max 2 with some unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:558
|
||||
// ./test/core/binary-leb128.wast:559
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -622,7 +623,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with contents ""
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:569
|
||||
// ./test/core/binary-leb128.wast:570
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -633,7 +634,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:580
|
||||
// ./test/core/binary-leb128.wast:581
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -644,7 +645,7 @@ assert_malformed(() =>
|
|||
"2" ;; sequence of bytes
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:591
|
||||
// ./test/core/binary-leb128.wast:592
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -655,7 +656,7 @@ assert_malformed(() =>
|
|||
"4" ;; sequence of bytes
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:602
|
||||
// ./test/core/binary-leb128.wast:603
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -667,7 +668,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:614
|
||||
// ./test/core/binary-leb128.wast:615
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -679,7 +680,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:626
|
||||
// ./test/core/binary-leb128.wast:627
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -694,7 +695,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:641
|
||||
// ./test/core/binary-leb128.wast:642
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -709,7 +710,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:656
|
||||
// ./test/core/binary-leb128.wast:657
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -724,7 +725,7 @@ assert_malformed(() =>
|
|||
"\\80\\80\\80\\80\\10" ;; import signature index 0 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:671
|
||||
// ./test/core/binary-leb128.wast:672
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -736,7 +737,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:684
|
||||
// ./test/core/binary-leb128.wast:685
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -752,7 +753,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:700
|
||||
// ./test/core/binary-leb128.wast:701
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -768,7 +769,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:716
|
||||
// ./test/core/binary-leb128.wast:717
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -781,7 +782,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:729
|
||||
// ./test/core/binary-leb128.wast:730
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -800,7 +801,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:748
|
||||
// ./test/core/binary-leb128.wast:749
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -819,7 +820,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:767
|
||||
// ./test/core/binary-leb128.wast:768
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -837,7 +838,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:785
|
||||
// ./test/core/binary-leb128.wast:786
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -856,7 +857,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:804
|
||||
// ./test/core/binary-leb128.wast:805
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -875,7 +876,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:823
|
||||
// ./test/core/binary-leb128.wast:824
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -894,7 +895,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:842
|
||||
// ./test/core/binary-leb128.wast:843
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -908,12 +909,12 @@ assert_malformed(() =>
|
|||
"\\41\\00" ;; i32.const 0
|
||||
"\\41\\03" ;; i32.const 3
|
||||
"\\36" ;; i32.store
|
||||
"\\03" ;; alignment 2
|
||||
"\\02" ;; alignment 2
|
||||
"\\82\\80\\80\\80\\10" ;; offset 2 with unused bits set
|
||||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:861
|
||||
// ./test/core/binary-leb128.wast:862
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -933,7 +934,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:883
|
||||
// ./test/core/binary-leb128.wast:884
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -943,7 +944,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:893
|
||||
// ./test/core/binary-leb128.wast:894
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -953,7 +954,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:903
|
||||
// ./test/core/binary-leb128.wast:904
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -963,7 +964,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:913
|
||||
// ./test/core/binary-leb128.wast:914
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -973,7 +974,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:924
|
||||
// ./test/core/binary-leb128.wast:925
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -983,7 +984,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:934
|
||||
// ./test/core/binary-leb128.wast:935
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -993,7 +994,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:944
|
||||
// ./test/core/binary-leb128.wast:945
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -1003,7 +1004,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:954
|
||||
// ./test/core/binary-leb128.wast:955
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -1012,3 +1013,40 @@ assert_malformed(() =>
|
|||
"\\42\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\41" ;; i64.const -1 with some unused bits unset
|
||||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:967
|
||||
let $25 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
"\\60\\00\\00" ;; empty function type
|
||||
"\\03\\02\\01" ;; function section
|
||||
"\\00" ;; function 0, type 0
|
||||
"\\0a\\1b\\01\\19" ;; code section
|
||||
"\\00" ;; no locals
|
||||
"\\00" ;; unreachable
|
||||
"\\fc\\80\\00" ;; i32_trunc_sat_f32_s with 2 bytes
|
||||
"\\00" ;; unreachable
|
||||
"\\fc\\81\\80\\00" ;; i32_trunc_sat_f32_u with 3 bytes
|
||||
"\\00" ;; unreachable
|
||||
"\\fc\\86\\80\\80\\00" ;; i64_trunc_sat_f64_s with 4 bytes
|
||||
"\\00" ;; unreachable
|
||||
"\\fc\\87\\80\\80\\80\\00" ;; i64_trunc_sat_f64_u with 5 bytes
|
||||
"\\00" ;; unreachable
|
||||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:987
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
"\\60\\00\\00" ;; empty function type
|
||||
"\\03\\02\\01" ;; function section
|
||||
"\\00" ;; function 0, type 0
|
||||
"\\0a\\0d\\01\\0b" ;; code section
|
||||
"\\00" ;; no locals
|
||||
"\\00" ;; unreachable
|
||||
"\\fc\\87\\80\\80\\80\\80\\00" ;; i64_trunc_sat_f64_u with 6 bytes
|
||||
"\\00" ;; unreachable
|
||||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -281,7 +281,10 @@ invoke($5, `drop_passive`, []);
|
|||
assert_return(() => invoke($5, `init_passive`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:172
|
||||
assert_trap(() => invoke($5, `init_passive`, [1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($5, `init_passive`, [1]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:173
|
||||
invoke($5, `init_passive`, [0]);
|
||||
|
@ -293,7 +296,10 @@ invoke($5, `drop_active`, []);
|
|||
assert_return(() => invoke($5, `init_active`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:176
|
||||
assert_trap(() => invoke($5, `init_active`, [1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($5, `init_active`, [1]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:177
|
||||
invoke($5, `init_active`, [0]);
|
||||
|
@ -400,7 +406,10 @@ invoke($9, `drop_passive`, []);
|
|||
assert_return(() => invoke($9, `init_passive`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:265
|
||||
assert_trap(() => invoke($9, `init_passive`, [1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($9, `init_passive`, [1]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:266
|
||||
invoke($9, `init_passive`, [0]);
|
||||
|
@ -412,7 +421,7 @@ invoke($9, `drop_active`, []);
|
|||
assert_return(() => invoke($9, `init_active`, [0]), []);
|
||||
|
||||
// ./test/core/bulk.wast:269
|
||||
assert_trap(() => invoke($9, `init_active`, [1]), `out of bounds`);
|
||||
assert_trap(() => invoke($9, `init_active`, [1]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/bulk.wast:270
|
||||
invoke($9, `init_active`, [0]);
|
||||
|
@ -513,7 +522,13 @@ invoke($12, `copy`, [10, 0, 0]);
|
|||
invoke($12, `copy`, [0, 10, 0]);
|
||||
|
||||
// ./test/core/bulk.wast:348
|
||||
assert_trap(() => invoke($12, `copy`, [11, 0, 0]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($12, `copy`, [11, 0, 0]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/bulk.wast:350
|
||||
assert_trap(() => invoke($12, `copy`, [0, 11, 0]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($12, `copy`, [0, 11, 0]),
|
||||
`out of bounds table access`,
|
||||
);
|
|
@ -968,7 +968,74 @@ assert_return(() => invoke($0, `as-compare-right`, []), [value("i32", 1)]);
|
|||
// ./test/core/call_indirect.wast:618
|
||||
assert_return(() => invoke($0, `as-convert-operand`, []), [value("i64", 1n)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:622
|
||||
// ./test/core/call_indirect.wast:623
|
||||
let $1 = instantiate(`(module
|
||||
(type $$ii-i (func (param i32 i32) (result i32)))
|
||||
|
||||
(table $$t1 funcref (elem $$f $$g))
|
||||
(table $$t2 funcref (elem $$h $$i $$j))
|
||||
(table $$t3 4 funcref)
|
||||
(elem (table $$t3) (i32.const 0) func $$g $$h)
|
||||
(elem (table $$t3) (i32.const 3) func $$z)
|
||||
|
||||
(func $$f (type $$ii-i) (i32.add (local.get 0) (local.get 1)))
|
||||
(func $$g (type $$ii-i) (i32.sub (local.get 0) (local.get 1)))
|
||||
(func $$h (type $$ii-i) (i32.mul (local.get 0) (local.get 1)))
|
||||
(func $$i (type $$ii-i) (i32.div_u (local.get 0) (local.get 1)))
|
||||
(func $$j (type $$ii-i) (i32.rem_u (local.get 0) (local.get 1)))
|
||||
(func $$z)
|
||||
|
||||
(func (export "call-1") (param i32 i32 i32) (result i32)
|
||||
(call_indirect $$t1 (type $$ii-i) (local.get 0) (local.get 1) (local.get 2))
|
||||
)
|
||||
(func (export "call-2") (param i32 i32 i32) (result i32)
|
||||
(call_indirect $$t2 (type $$ii-i) (local.get 0) (local.get 1) (local.get 2))
|
||||
)
|
||||
(func (export "call-3") (param i32 i32 i32) (result i32)
|
||||
(call_indirect $$t3 (type $$ii-i) (local.get 0) (local.get 1) (local.get 2))
|
||||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/call_indirect.wast:650
|
||||
assert_return(() => invoke($1, `call-1`, [2, 3, 0]), [value("i32", 5)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:651
|
||||
assert_return(() => invoke($1, `call-1`, [2, 3, 1]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:652
|
||||
assert_trap(() => invoke($1, `call-1`, [2, 3, 2]), `undefined element`);
|
||||
|
||||
// ./test/core/call_indirect.wast:654
|
||||
assert_return(() => invoke($1, `call-2`, [2, 3, 0]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:655
|
||||
assert_return(() => invoke($1, `call-2`, [2, 3, 1]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:656
|
||||
assert_return(() => invoke($1, `call-2`, [2, 3, 2]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:657
|
||||
assert_trap(() => invoke($1, `call-2`, [2, 3, 3]), `undefined element`);
|
||||
|
||||
// ./test/core/call_indirect.wast:659
|
||||
assert_return(() => invoke($1, `call-3`, [2, 3, 0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:660
|
||||
assert_return(() => invoke($1, `call-3`, [2, 3, 1]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/call_indirect.wast:661
|
||||
assert_trap(() => invoke($1, `call-3`, [2, 3, 2]), `uninitialized element`);
|
||||
|
||||
// ./test/core/call_indirect.wast:662
|
||||
assert_trap(
|
||||
() => invoke($1, `call-3`, [2, 3, 3]),
|
||||
`indirect call type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:663
|
||||
assert_trap(() => invoke($1, `call-3`, [2, 3, 4]), `undefined element`);
|
||||
|
||||
// ./test/core/call_indirect.wast:668
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -977,7 +1044,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:634
|
||||
// ./test/core/call_indirect.wast:680
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -986,7 +1053,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:646
|
||||
// ./test/core/call_indirect.wast:692
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -995,7 +1062,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:658
|
||||
// ./test/core/call_indirect.wast:704
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1004,7 +1071,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:670
|
||||
// ./test/core/call_indirect.wast:716
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1013,7 +1080,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:682
|
||||
// ./test/core/call_indirect.wast:728
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1022,7 +1089,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:692
|
||||
// ./test/core/call_indirect.wast:738
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1031,7 +1098,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:699
|
||||
// ./test/core/call_indirect.wast:745
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1040,7 +1107,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:709
|
||||
// ./test/core/call_indirect.wast:755
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1049,7 +1116,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:719
|
||||
// ./test/core/call_indirect.wast:765
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1058,7 +1125,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:729
|
||||
// ./test/core/call_indirect.wast:775
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1067,14 +1134,14 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/call_indirect.wast:744
|
||||
// ./test/core/call_indirect.wast:790
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func))
|
||||
(func $$no-table (call_indirect (type 0) (i32.const 0)))
|
||||
)`), `unknown table`);
|
||||
|
||||
// ./test/core/call_indirect.wast:752
|
||||
// ./test/core/call_indirect.wast:798
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func))
|
||||
|
@ -1082,7 +1149,7 @@ assert_invalid(() =>
|
|||
(func $$type-void-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:760
|
||||
// ./test/core/call_indirect.wast:806
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (result i64)))
|
||||
|
@ -1090,7 +1157,7 @@ assert_invalid(() =>
|
|||
(func $$type-num-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:769
|
||||
// ./test/core/call_indirect.wast:815
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32)))
|
||||
|
@ -1098,7 +1165,7 @@ assert_invalid(() =>
|
|||
(func $$arity-0-vs-1 (call_indirect (type 0) (i32.const 0)))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:777
|
||||
// ./test/core/call_indirect.wast:823
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param f64 i32)))
|
||||
|
@ -1106,7 +1173,7 @@ assert_invalid(() =>
|
|||
(func $$arity-0-vs-2 (call_indirect (type 0) (i32.const 0)))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:785
|
||||
// ./test/core/call_indirect.wast:831
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func))
|
||||
|
@ -1114,7 +1181,7 @@ assert_invalid(() =>
|
|||
(func $$arity-1-vs-0 (call_indirect (type 0) (i32.const 1) (i32.const 0)))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:793
|
||||
// ./test/core/call_indirect.wast:839
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func))
|
||||
|
@ -1124,7 +1191,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:804
|
||||
// ./test/core/call_indirect.wast:850
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32)))
|
||||
|
@ -1132,7 +1199,7 @@ assert_invalid(() =>
|
|||
(func $$type-func-void-vs-i32 (call_indirect (type 0) (i32.const 1) (nop)))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:812
|
||||
// ./test/core/call_indirect.wast:858
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32)))
|
||||
|
@ -1140,7 +1207,7 @@ assert_invalid(() =>
|
|||
(func $$type-func-num-vs-i32 (call_indirect (type 0) (i32.const 0) (i64.const 1)))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:821
|
||||
// ./test/core/call_indirect.wast:867
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32 i32)))
|
||||
|
@ -1150,7 +1217,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:831
|
||||
// ./test/core/call_indirect.wast:877
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32 i32)))
|
||||
|
@ -1160,7 +1227,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:841
|
||||
// ./test/core/call_indirect.wast:887
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param i32 f64)))
|
||||
|
@ -1170,7 +1237,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:851
|
||||
// ./test/core/call_indirect.wast:897
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(type (func (param f64 i32)))
|
||||
|
@ -1180,7 +1247,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:862
|
||||
// ./test/core/call_indirect.wast:908
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32))
|
||||
|
@ -1193,7 +1260,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:875
|
||||
// ./test/core/call_indirect.wast:921
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32 i32))
|
||||
|
@ -1206,7 +1273,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:888
|
||||
// ./test/core/call_indirect.wast:934
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32))
|
||||
|
@ -1219,7 +1286,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:901
|
||||
// ./test/core/call_indirect.wast:947
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32 i32))
|
||||
|
@ -1232,7 +1299,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:914
|
||||
// ./test/core/call_indirect.wast:960
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32))
|
||||
|
@ -1248,7 +1315,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:930
|
||||
// ./test/core/call_indirect.wast:976
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32 i32))
|
||||
|
@ -1264,21 +1331,21 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/call_indirect.wast:950
|
||||
// ./test/core/call_indirect.wast:996
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(table 0 funcref)
|
||||
(func $$unbound-type (call_indirect (type 1) (i32.const 0)))
|
||||
)`), `unknown type`);
|
||||
|
||||
// ./test/core/call_indirect.wast:957
|
||||
// ./test/core/call_indirect.wast:1003
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(table 0 funcref)
|
||||
(func $$large-type (call_indirect (type 1012321300) (i32.const 0)))
|
||||
)`), `unknown type`);
|
||||
|
||||
// ./test/core/call_indirect.wast:968
|
||||
// ./test/core/call_indirect.wast:1014
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (table funcref (elem 0 0)))`),
|
||||
`unknown function`,
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -130,3 +130,12 @@ assert_malformed(() =>
|
|||
"\\00asm\\01\\00\\00\\00"
|
||||
"\\00asm\\01\\00\\00\\00"
|
||||
)`), `length out of bounds`);
|
||||
|
||||
// ./test/core/custom.wast:122
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\05\\03\\01\\00\\01" ;; memory section
|
||||
"\\0c\\01\\02" ;; data count section (2 segments)
|
||||
"\\0b\\06\\01\\00\\41\\00\\0b\\00" ;; data section (1 segment)
|
||||
)`), `data count and data section have inconsistent lengths`);
|
||||
|
|
|
@ -686,8 +686,51 @@ assert_invalid(() =>
|
|||
(func (type 2)) ;; does not exist
|
||||
)`), `unknown type`);
|
||||
|
||||
// ./test/core/func.wast:448
|
||||
// ./test/core/func.wast:447
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
`(func $$f (result f64) (f64.const 0)) (func $$g (param i32)) (func $$h (result f64) (f64.const 1)) (type $$t (func (param i32))) (func (type 2) (param i32)) `,
|
||||
),
|
||||
`unknown type`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:459
|
||||
let $2 = instantiate(`(module
|
||||
(type $$proc (func (result i32)))
|
||||
(type $$sig (func (param i32) (result i32)))
|
||||
|
||||
(func (export "f") (type $$sig)
|
||||
(local $$var i32)
|
||||
(local.get $$var)
|
||||
)
|
||||
|
||||
(func $$g (type $$sig)
|
||||
(local $$var i32)
|
||||
(local.get $$var)
|
||||
)
|
||||
(func (export "g") (type $$sig)
|
||||
(call $$g (local.get 0))
|
||||
)
|
||||
|
||||
(func (export "p") (type $$proc)
|
||||
(local $$var i32)
|
||||
(local.set 0 (i32.const 42))
|
||||
(local.get $$var)
|
||||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/func.wast:483
|
||||
assert_return(() => invoke($2, `f`, [42]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/func.wast:484
|
||||
assert_return(() => invoke($2, `g`, [42]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/func.wast:485
|
||||
assert_return(() => invoke($2, `p`, []), [value("i32", 42)]);
|
||||
|
||||
// ./test/core/func.wast:488
|
||||
let $3 = instantiate(`(module
|
||||
(type $$sig (func))
|
||||
|
||||
(func $$empty-sig-1) ;; should be assigned type $$sig
|
||||
|
@ -750,19 +793,19 @@ let $2 = instantiate(`(module
|
|||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/func.wast:511
|
||||
assert_return(() => invoke($2, `signature-explicit-reused`, []), []);
|
||||
// ./test/core/func.wast:551
|
||||
assert_return(() => invoke($3, `signature-explicit-reused`, []), []);
|
||||
|
||||
// ./test/core/func.wast:512
|
||||
assert_return(() => invoke($2, `signature-implicit-reused`, []), []);
|
||||
// ./test/core/func.wast:552
|
||||
assert_return(() => invoke($3, `signature-implicit-reused`, []), []);
|
||||
|
||||
// ./test/core/func.wast:513
|
||||
assert_return(() => invoke($2, `signature-explicit-duplicate`, []), []);
|
||||
// ./test/core/func.wast:553
|
||||
assert_return(() => invoke($3, `signature-explicit-duplicate`, []), []);
|
||||
|
||||
// ./test/core/func.wast:514
|
||||
assert_return(() => invoke($2, `signature-implicit-duplicate`, []), []);
|
||||
// ./test/core/func.wast:554
|
||||
assert_return(() => invoke($3, `signature-implicit-duplicate`, []), []);
|
||||
|
||||
// ./test/core/func.wast:519
|
||||
// ./test/core/func.wast:559
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -771,7 +814,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:526
|
||||
// ./test/core/func.wast:566
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -780,7 +823,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:533
|
||||
// ./test/core/func.wast:573
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -789,7 +832,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:540
|
||||
// ./test/core/func.wast:580
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -798,7 +841,7 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:547
|
||||
// ./test/core/func.wast:587
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -807,13 +850,13 @@ assert_malformed(
|
|||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:554
|
||||
// ./test/core/func.wast:594
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (result i32) (param i32) (i32.const 0)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:561
|
||||
// ./test/core/func.wast:601
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -822,7 +865,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:568
|
||||
// ./test/core/func.wast:608
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -831,7 +874,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:575
|
||||
// ./test/core/func.wast:615
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -840,7 +883,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:582
|
||||
// ./test/core/func.wast:622
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -849,7 +892,7 @@ assert_malformed(
|
|||
`inline function type`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:593
|
||||
// ./test/core/func.wast:633
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -858,7 +901,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:597
|
||||
// ./test/core/func.wast:637
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -867,7 +910,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:601
|
||||
// ./test/core/func.wast:641
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -876,7 +919,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:609
|
||||
// ./test/core/func.wast:649
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -885,7 +928,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:613
|
||||
// ./test/core/func.wast:653
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -894,7 +937,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:617
|
||||
// ./test/core/func.wast:657
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -903,37 +946,37 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:625
|
||||
// ./test/core/func.wast:665
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func $$type-empty-i32 (result i32)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:629
|
||||
// ./test/core/func.wast:669
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func $$type-empty-i64 (result i64)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:633
|
||||
// ./test/core/func.wast:673
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func $$type-empty-f32 (result f32)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:637
|
||||
// ./test/core/func.wast:677
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func $$type-empty-f64 (result f64)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:641
|
||||
// ./test/core/func.wast:681
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func $$type-empty-f64-i32 (result f64 i32)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:646
|
||||
// ./test/core/func.wast:686
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-value-void-vs-num (result i32)
|
||||
|
@ -942,7 +985,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:652
|
||||
// ./test/core/func.wast:692
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-value-void-vs-nums (result i32 i32)
|
||||
|
@ -951,19 +994,19 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:658
|
||||
// ./test/core/func.wast:698
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module (func $$type-value-num-vs-void
|
||||
(i32.const 0)
|
||||
))`), `type mismatch`);
|
||||
|
||||
// ./test/core/func.wast:664
|
||||
// ./test/core/func.wast:704
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module (func $$type-value-nums-vs-void
|
||||
(i32.const 0) (i64.const 0)
|
||||
))`), `type mismatch`);
|
||||
|
||||
// ./test/core/func.wast:670
|
||||
// ./test/core/func.wast:710
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-value-num-vs-num (result i32)
|
||||
|
@ -972,7 +1015,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:676
|
||||
// ./test/core/func.wast:716
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-value-num-vs-nums (result f32 f32)
|
||||
|
@ -981,7 +1024,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:682
|
||||
// ./test/core/func.wast:722
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-value-nums-vs-num (result f32)
|
||||
|
@ -990,7 +1033,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:689
|
||||
// ./test/core/func.wast:729
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-empty-vs-num (result i32)
|
||||
|
@ -999,7 +1042,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:695
|
||||
// ./test/core/func.wast:735
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-empty-vs-nums (result i32 i32)
|
||||
|
@ -1008,7 +1051,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:701
|
||||
// ./test/core/func.wast:741
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-void-vs-num (result i32)
|
||||
|
@ -1017,7 +1060,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:707
|
||||
// ./test/core/func.wast:747
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-void-vs-nums (result i32 i64)
|
||||
|
@ -1026,7 +1069,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:713
|
||||
// ./test/core/func.wast:753
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-num-vs-num (result i32)
|
||||
|
@ -1035,7 +1078,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:719
|
||||
// ./test/core/func.wast:759
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-last-num-vs-nums (result i64 i64)
|
||||
|
@ -1044,7 +1087,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:726
|
||||
// ./test/core/func.wast:766
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-empty-vs-num (result i32)
|
||||
|
@ -1053,7 +1096,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:732
|
||||
// ./test/core/func.wast:772
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-empty-vs-nums (result i32 i32)
|
||||
|
@ -1062,7 +1105,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:738
|
||||
// ./test/core/func.wast:778
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-partial-vs-nums (result i32 i32)
|
||||
|
@ -1071,7 +1114,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:744
|
||||
// ./test/core/func.wast:784
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-void-vs-num (result i32)
|
||||
|
@ -1080,7 +1123,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:750
|
||||
// ./test/core/func.wast:790
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-void-vs-nums (result i32 i32)
|
||||
|
@ -1089,7 +1132,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:756
|
||||
// ./test/core/func.wast:796
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-num-vs-num (result i32)
|
||||
|
@ -1098,7 +1141,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:762
|
||||
// ./test/core/func.wast:802
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-num-vs-nums (result i32 i32)
|
||||
|
@ -1107,7 +1150,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:768
|
||||
// ./test/core/func.wast:808
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-first-num-vs-num (result i32)
|
||||
|
@ -1116,7 +1159,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:774
|
||||
// ./test/core/func.wast:814
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-return-first-num-vs-nums (result i32 i32)
|
||||
|
@ -1125,7 +1168,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:781
|
||||
// ./test/core/func.wast:821
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-last-void-vs-num (result i32)
|
||||
|
@ -1134,7 +1177,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:787
|
||||
// ./test/core/func.wast:827
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-last-void-vs-nums (result i32 i32)
|
||||
|
@ -1143,7 +1186,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:793
|
||||
// ./test/core/func.wast:833
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-last-num-vs-num (result i32)
|
||||
|
@ -1152,7 +1195,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:799
|
||||
// ./test/core/func.wast:839
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-last-num-vs-nums (result i32 i32)
|
||||
|
@ -1161,7 +1204,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:805
|
||||
// ./test/core/func.wast:845
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-void-vs-num (result i32)
|
||||
|
@ -1170,7 +1213,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:811
|
||||
// ./test/core/func.wast:851
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-void-vs-nums (result i32 i32)
|
||||
|
@ -1179,7 +1222,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:817
|
||||
// ./test/core/func.wast:857
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-num-vs-num (result i32)
|
||||
|
@ -1188,7 +1231,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:823
|
||||
// ./test/core/func.wast:863
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-num-vs-nums (result i32 i32)
|
||||
|
@ -1197,7 +1240,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:829
|
||||
// ./test/core/func.wast:869
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-first-num-vs-num (result i32)
|
||||
|
@ -1206,7 +1249,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:836
|
||||
// ./test/core/func.wast:876
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-nested-empty-vs-num (result i32)
|
||||
|
@ -1215,7 +1258,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:842
|
||||
// ./test/core/func.wast:882
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -1226,7 +1269,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:848
|
||||
// ./test/core/func.wast:888
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-nested-void-vs-num (result i32)
|
||||
|
@ -1235,7 +1278,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:854
|
||||
// ./test/core/func.wast:894
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-nested-void-vs-nums (result i32 i32)
|
||||
|
@ -1244,7 +1287,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:860
|
||||
// ./test/core/func.wast:900
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-nested-num-vs-num (result i32)
|
||||
|
@ -1253,7 +1296,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:866
|
||||
// ./test/core/func.wast:906
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(`(module (func $$type-break-nested-num-vs-nums (result i32 i32)
|
||||
|
@ -1262,73 +1305,73 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:876
|
||||
// ./test/core/func.wast:916
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (nop) (local i32)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:880
|
||||
// ./test/core/func.wast:920
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (nop) (param i32)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:884
|
||||
// ./test/core/func.wast:924
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (nop) (result i32)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:888
|
||||
// ./test/core/func.wast:928
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (local i32) (param i32)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:892
|
||||
// ./test/core/func.wast:932
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (local i32) (result i32) (local.get 0)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:896
|
||||
// ./test/core/func.wast:936
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (result i32) (param i32) (local.get 0)) `),
|
||||
`unexpected token`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:903
|
||||
// ./test/core/func.wast:943
|
||||
assert_malformed(
|
||||
() => instantiate(`(func $$foo) (func $$foo) `),
|
||||
`duplicate func`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:907
|
||||
// ./test/core/func.wast:947
|
||||
assert_malformed(
|
||||
() => instantiate(`(import "" "" (func $$foo)) (func $$foo) `),
|
||||
`duplicate func`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:911
|
||||
// ./test/core/func.wast:951
|
||||
assert_malformed(
|
||||
() => instantiate(`(import "" "" (func $$foo)) (import "" "" (func $$foo)) `),
|
||||
`duplicate func`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:916
|
||||
// ./test/core/func.wast:956
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (param $$foo i32) (param $$foo i32)) `),
|
||||
`duplicate local`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:918
|
||||
// ./test/core/func.wast:958
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (param $$foo i32) (local $$foo i32)) `),
|
||||
`duplicate local`,
|
||||
);
|
||||
|
||||
// ./test/core/func.wast:920
|
||||
// ./test/core/func.wast:960
|
||||
assert_malformed(
|
||||
() => instantiate(`(func (local $$foo i32) (local $$foo i32)) `),
|
||||
`duplicate local`,
|
||||
|
|
|
@ -17,29 +17,44 @@
|
|||
|
||||
// ./test/core/global.wast:3
|
||||
let $0 = instantiate(`(module
|
||||
(global (import "spectest" "global_i32") i32)
|
||||
(global (import "spectest" "global_i64") i64)
|
||||
|
||||
(global $$a i32 (i32.const -2))
|
||||
(global (;1;) f32 (f32.const -3))
|
||||
(global (;2;) f64 (f64.const -4))
|
||||
(global (;3;) f32 (f32.const -3))
|
||||
(global (;4;) f64 (f64.const -4))
|
||||
(global $$b i64 (i64.const -5))
|
||||
|
||||
(global $$x (mut i32) (i32.const -12))
|
||||
(global (;5;) (mut f32) (f32.const -13))
|
||||
(global (;6;) (mut f64) (f64.const -14))
|
||||
(global (;7;) (mut f32) (f32.const -13))
|
||||
(global (;8;) (mut f64) (f64.const -14))
|
||||
(global $$y (mut i64) (i64.const -15))
|
||||
|
||||
(global $$z1 i32 (global.get 0))
|
||||
(global $$z2 i64 (global.get 1))
|
||||
|
||||
(global $$r externref (ref.null extern))
|
||||
(global $$mr (mut externref) (ref.null extern))
|
||||
(global funcref (ref.null func))
|
||||
|
||||
(func (export "get-a") (result i32) (global.get $$a))
|
||||
(func (export "get-b") (result i64) (global.get $$b))
|
||||
(func (export "get-r") (result externref) (global.get $$r))
|
||||
(func (export "get-mr") (result externref) (global.get $$mr))
|
||||
(func (export "get-x") (result i32) (global.get $$x))
|
||||
(func (export "get-y") (result i64) (global.get $$y))
|
||||
(func (export "get-z1") (result i32) (global.get $$z1))
|
||||
(func (export "get-z2") (result i64) (global.get $$z2))
|
||||
(func (export "set-x") (param i32) (global.set $$x (local.get 0)))
|
||||
(func (export "set-y") (param i64) (global.set $$y (local.get 0)))
|
||||
(func (export "set-mr") (param externref) (global.set $$mr (local.get 0)))
|
||||
|
||||
(func (export "get-1") (result f32) (global.get 1))
|
||||
(func (export "get-2") (result f64) (global.get 2))
|
||||
(func (export "get-5") (result f32) (global.get 5))
|
||||
(func (export "get-6") (result f64) (global.get 6))
|
||||
(func (export "set-5") (param f32) (global.set 5 (local.get 0)))
|
||||
(func (export "set-6") (param f64) (global.set 6 (local.get 0)))
|
||||
(func (export "get-3") (result f32) (global.get 3))
|
||||
(func (export "get-4") (result f64) (global.get 4))
|
||||
(func (export "get-7") (result f32) (global.get 7))
|
||||
(func (export "get-8") (result f64) (global.get 8))
|
||||
(func (export "set-7") (param f32) (global.set 7 (local.get 0)))
|
||||
(func (export "set-8") (param f64) (global.set 8 (local.get 0)))
|
||||
|
||||
;; As the argument of control constructs and instructions
|
||||
|
||||
|
@ -194,147 +209,185 @@ let $0 = instantiate(`(module
|
|||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:181
|
||||
// ./test/core/global.wast:196
|
||||
assert_return(() => invoke($0, `get-a`, []), [value("i32", -2)]);
|
||||
|
||||
// ./test/core/global.wast:182
|
||||
// ./test/core/global.wast:197
|
||||
assert_return(() => invoke($0, `get-b`, []), [value("i64", -5n)]);
|
||||
|
||||
// ./test/core/global.wast:183
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", -12)]);
|
||||
|
||||
// ./test/core/global.wast:184
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", -15n)]);
|
||||
|
||||
// ./test/core/global.wast:186
|
||||
assert_return(() => invoke($0, `get-1`, []), [value("f32", -3)]);
|
||||
|
||||
// ./test/core/global.wast:187
|
||||
assert_return(() => invoke($0, `get-2`, []), [value("f64", -4)]);
|
||||
|
||||
// ./test/core/global.wast:188
|
||||
assert_return(() => invoke($0, `get-5`, []), [value("f32", -13)]);
|
||||
|
||||
// ./test/core/global.wast:189
|
||||
assert_return(() => invoke($0, `get-6`, []), [value("f64", -14)]);
|
||||
|
||||
// ./test/core/global.wast:191
|
||||
assert_return(() => invoke($0, `set-x`, [6]), []);
|
||||
|
||||
// ./test/core/global.wast:192
|
||||
assert_return(() => invoke($0, `set-y`, [7n]), []);
|
||||
|
||||
// ./test/core/global.wast:193
|
||||
assert_return(() => invoke($0, `set-5`, [value("f32", 8)]), []);
|
||||
|
||||
// ./test/core/global.wast:194
|
||||
assert_return(() => invoke($0, `set-6`, [value("f64", 9)]), []);
|
||||
|
||||
// ./test/core/global.wast:196
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:197
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", 7n)]);
|
||||
|
||||
// ./test/core/global.wast:198
|
||||
assert_return(() => invoke($0, `get-5`, []), [value("f32", 8)]);
|
||||
assert_return(() => invoke($0, `get-r`, []), [value("externref", null)]);
|
||||
|
||||
// ./test/core/global.wast:199
|
||||
assert_return(() => invoke($0, `get-6`, []), [value("f64", 9)]);
|
||||
assert_return(() => invoke($0, `get-mr`, []), [value("externref", null)]);
|
||||
|
||||
// ./test/core/global.wast:200
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", -12)]);
|
||||
|
||||
// ./test/core/global.wast:201
|
||||
assert_return(() => invoke($0, `as-select-first`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", -15n)]);
|
||||
|
||||
// ./test/core/global.wast:202
|
||||
assert_return(() => invoke($0, `as-select-mid`, []), [value("i32", 2)]);
|
||||
assert_return(() => invoke($0, `get-z1`, []), [value("i32", 666)]);
|
||||
|
||||
// ./test/core/global.wast:203
|
||||
assert_return(() => invoke($0, `as-select-last`, []), [value("i32", 2)]);
|
||||
assert_return(() => invoke($0, `get-z2`, []), [value("i64", 666n)]);
|
||||
|
||||
// ./test/core/global.wast:205
|
||||
assert_return(() => invoke($0, `as-loop-first`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `get-3`, []), [value("f32", -3)]);
|
||||
|
||||
// ./test/core/global.wast:206
|
||||
assert_return(() => invoke($0, `as-loop-mid`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `get-4`, []), [value("f64", -4)]);
|
||||
|
||||
// ./test/core/global.wast:207
|
||||
assert_return(() => invoke($0, `as-loop-last`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `get-7`, []), [value("f32", -13)]);
|
||||
|
||||
// ./test/core/global.wast:209
|
||||
assert_return(() => invoke($0, `as-if-condition`, []), [value("i32", 2)]);
|
||||
// ./test/core/global.wast:208
|
||||
assert_return(() => invoke($0, `get-8`, []), [value("f64", -14)]);
|
||||
|
||||
// ./test/core/global.wast:210
|
||||
assert_return(() => invoke($0, `as-if-then`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `set-x`, [6]), []);
|
||||
|
||||
// ./test/core/global.wast:211
|
||||
assert_return(() => invoke($0, `as-if-else`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `set-y`, [7n]), []);
|
||||
|
||||
// ./test/core/global.wast:213
|
||||
assert_return(() => invoke($0, `as-br_if-first`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `set-7`, [value("f32", 8)]), []);
|
||||
|
||||
// ./test/core/global.wast:214
|
||||
assert_return(() => invoke($0, `as-br_if-last`, []), [value("i32", 2)]);
|
||||
assert_return(() => invoke($0, `set-8`, [value("f64", 9)]), []);
|
||||
|
||||
// ./test/core/global.wast:216
|
||||
assert_return(() => invoke($0, `as-br_table-first`, []), [value("i32", 6)]);
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:217
|
||||
assert_return(() => invoke($0, `as-br_table-last`, []), [value("i32", 2)]);
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", 7n)]);
|
||||
|
||||
// ./test/core/global.wast:218
|
||||
assert_return(() => invoke($0, `get-7`, []), [value("f32", 8)]);
|
||||
|
||||
// ./test/core/global.wast:219
|
||||
assert_return(() => invoke($0, `get-8`, []), [value("f64", 9)]);
|
||||
|
||||
// ./test/core/global.wast:221
|
||||
assert_return(() => invoke($0, `set-7`, [value("f32", 8)]), []);
|
||||
|
||||
// ./test/core/global.wast:222
|
||||
assert_return(() => invoke($0, `set-8`, [value("f64", 9)]), []);
|
||||
|
||||
// ./test/core/global.wast:223
|
||||
assert_return(() => invoke($0, `set-mr`, [externref(10)]), []);
|
||||
|
||||
// ./test/core/global.wast:225
|
||||
assert_return(() => invoke($0, `get-x`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:226
|
||||
assert_return(() => invoke($0, `get-y`, []), [value("i64", 7n)]);
|
||||
|
||||
// ./test/core/global.wast:227
|
||||
assert_return(() => invoke($0, `get-7`, []), [value("f32", 8)]);
|
||||
|
||||
// ./test/core/global.wast:228
|
||||
assert_return(() => invoke($0, `get-8`, []), [value("f64", 9)]);
|
||||
|
||||
// ./test/core/global.wast:229
|
||||
assert_return(() => invoke($0, `get-mr`, []), [
|
||||
value("externref", externref(10)),
|
||||
]);
|
||||
|
||||
// ./test/core/global.wast:231
|
||||
assert_return(() => invoke($0, `as-select-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:232
|
||||
assert_return(() => invoke($0, `as-select-mid`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:233
|
||||
assert_return(() => invoke($0, `as-select-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:235
|
||||
assert_return(() => invoke($0, `as-loop-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:236
|
||||
assert_return(() => invoke($0, `as-loop-mid`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:237
|
||||
assert_return(() => invoke($0, `as-loop-last`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:239
|
||||
assert_return(() => invoke($0, `as-if-condition`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:240
|
||||
assert_return(() => invoke($0, `as-if-then`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:241
|
||||
assert_return(() => invoke($0, `as-if-else`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:243
|
||||
assert_return(() => invoke($0, `as-br_if-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:244
|
||||
assert_return(() => invoke($0, `as-br_if-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:246
|
||||
assert_return(() => invoke($0, `as-br_table-first`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:247
|
||||
assert_return(() => invoke($0, `as-br_table-last`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:249
|
||||
assert_return(() => invoke($0, `as-call_indirect-first`, []), [
|
||||
value("i32", 6),
|
||||
]);
|
||||
|
||||
// ./test/core/global.wast:220
|
||||
// ./test/core/global.wast:250
|
||||
assert_return(() => invoke($0, `as-call_indirect-mid`, []), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/global.wast:221
|
||||
// ./test/core/global.wast:251
|
||||
assert_trap(() => invoke($0, `as-call_indirect-last`, []), `undefined element`);
|
||||
|
||||
// ./test/core/global.wast:223
|
||||
// ./test/core/global.wast:253
|
||||
assert_return(() => invoke($0, `as-store-first`, []), []);
|
||||
|
||||
// ./test/core/global.wast:224
|
||||
// ./test/core/global.wast:254
|
||||
assert_return(() => invoke($0, `as-store-last`, []), []);
|
||||
|
||||
// ./test/core/global.wast:225
|
||||
// ./test/core/global.wast:255
|
||||
assert_return(() => invoke($0, `as-load-operand`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:226
|
||||
// ./test/core/global.wast:256
|
||||
assert_return(() => invoke($0, `as-memory.grow-value`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:228
|
||||
// ./test/core/global.wast:258
|
||||
assert_return(() => invoke($0, `as-call-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:230
|
||||
// ./test/core/global.wast:260
|
||||
assert_return(() => invoke($0, `as-return-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:231
|
||||
// ./test/core/global.wast:261
|
||||
assert_return(() => invoke($0, `as-drop-operand`, []), []);
|
||||
|
||||
// ./test/core/global.wast:232
|
||||
// ./test/core/global.wast:262
|
||||
assert_return(() => invoke($0, `as-br-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:234
|
||||
// ./test/core/global.wast:264
|
||||
assert_return(() => invoke($0, `as-local.set-value`, [1]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:235
|
||||
// ./test/core/global.wast:265
|
||||
assert_return(() => invoke($0, `as-local.tee-value`, [1]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:236
|
||||
// ./test/core/global.wast:266
|
||||
assert_return(() => invoke($0, `as-global.set-value`, []), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/global.wast:238
|
||||
// ./test/core/global.wast:268
|
||||
assert_return(() => invoke($0, `as-unary-operand`, []), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/global.wast:239
|
||||
// ./test/core/global.wast:269
|
||||
assert_return(() => invoke($0, `as-binary-operand`, []), [value("i32", 36)]);
|
||||
|
||||
// ./test/core/global.wast:240
|
||||
// ./test/core/global.wast:270
|
||||
assert_return(() => invoke($0, `as-compare-operand`, []), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/global.wast:242
|
||||
// ./test/core/global.wast:272
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -343,69 +396,111 @@ assert_invalid(
|
|||
`global is immutable`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:248
|
||||
// ./test/core/global.wast:277
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (import "spectest" "global_i32" (global i32)) (func (global.set 0 (i32.const 1))))`,
|
||||
),
|
||||
`global is immutable`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:283
|
||||
let $1 = instantiate(
|
||||
`(module (global (mut f32) (f32.const 0)) (export "a" (global 0)))`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:249
|
||||
// ./test/core/global.wast:284
|
||||
let $2 = instantiate(`(module (global (export "a") (mut f32) (f32.const 0)))`);
|
||||
|
||||
// ./test/core/global.wast:251
|
||||
// ./test/core/global.wast:286
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (f32.neg (f32.const 0))))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:256
|
||||
// ./test/core/global.wast:291
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (local.get 0)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:261
|
||||
// ./test/core/global.wast:296
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global f32 (f32.neg (f32.const 1))))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:266
|
||||
// ./test/core/global.wast:301
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (i32.const 0) (nop)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:271
|
||||
// ./test/core/global.wast:306
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (i32.ctz (i32.const 0))))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:311
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (nop)))`),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:276
|
||||
// ./test/core/global.wast:316
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (f32.const 0)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:281
|
||||
// ./test/core/global.wast:321
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (i32.const 0) (i32.const 0)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:286
|
||||
// ./test/core/global.wast:326
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (;empty instruction sequence;)))`),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:291
|
||||
// ./test/core/global.wast:331
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "" "") externref) (global funcref (global.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:336
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "test" "global-i32") i32) (global i32 (global.get 0) (global.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:341
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "test" "global-i32") i32) (global i32 (i32.const 0) (global.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:346
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (global i32 (global.get 0)))`),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:296
|
||||
// ./test/core/global.wast:351
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -414,12 +509,30 @@ assert_invalid(
|
|||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:301
|
||||
// ./test/core/global.wast:356
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "test" "global-i32") i32) (global i32 (global.get 2)))`,
|
||||
),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:361
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (global (import "test" "global-mut-i32") (mut i32)) (global i32 (global.get 0)))`,
|
||||
),
|
||||
`constant expression required`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:366
|
||||
let $3 = instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:304
|
||||
// ./test/core/global.wast:369
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -432,7 +545,7 @@ assert_malformed(() =>
|
|||
"\\02" ;; malformed mutability
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:317
|
||||
// ./test/core/global.wast:382
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -445,12 +558,12 @@ assert_malformed(() =>
|
|||
"\\ff" ;; malformed mutability
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:331
|
||||
// ./test/core/global.wast:396
|
||||
let $4 = instantiate(`(module
|
||||
(global i32 (i32.const 0))
|
||||
)`);
|
||||
|
||||
// ./test/core/global.wast:334
|
||||
// ./test/core/global.wast:399
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -462,7 +575,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:346
|
||||
// ./test/core/global.wast:411
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -474,7 +587,63 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `malformed mutability`);
|
||||
|
||||
// ./test/core/global.wast:360
|
||||
// ./test/core/global.wast:425
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func (result i32) (global.get 0)))`),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:430
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global i32 (i32.const 0))
|
||||
(func (result i32) (global.get 1))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:438
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
(func (result i32) (global.get 1))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:446
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
(global i32 (i32.const 0))
|
||||
(func (result i32) (global.get 2))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:456
|
||||
assert_invalid(
|
||||
() => instantiate(`(module (func (i32.const 0) (global.set 0)))`),
|
||||
`unknown global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:461
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global i32 (i32.const 0))
|
||||
(func (i32.const 0) (global.set 1))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:469
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
(func (i32.const 0) (global.set 1))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:477
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(import "spectest" "global_i32" (global i32))
|
||||
(global i32 (i32.const 0))
|
||||
(func (i32.const 0) (global.set 2))
|
||||
)`), `unknown global`);
|
||||
|
||||
// ./test/core/global.wast:487
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -483,7 +652,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:369
|
||||
// ./test/core/global.wast:496
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -493,7 +662,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:379
|
||||
// ./test/core/global.wast:506
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -503,7 +672,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:389
|
||||
// ./test/core/global.wast:516
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -513,7 +682,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:399
|
||||
// ./test/core/global.wast:526
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -523,7 +692,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:409
|
||||
// ./test/core/global.wast:536
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -533,7 +702,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:419
|
||||
// ./test/core/global.wast:546
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -543,7 +712,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:429
|
||||
// ./test/core/global.wast:556
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -553,7 +722,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:439
|
||||
// ./test/core/global.wast:566
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -562,7 +731,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:448
|
||||
// ./test/core/global.wast:575
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -571,7 +740,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:457
|
||||
// ./test/core/global.wast:584
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -581,7 +750,7 @@ assert_invalid(() =>
|
|||
(func (param i32) (result i32) (local.get 0))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:467
|
||||
// ./test/core/global.wast:594
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
|
@ -597,7 +766,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/global.wast:486
|
||||
// ./test/core/global.wast:613
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -606,7 +775,7 @@ assert_malformed(
|
|||
`duplicate global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:490
|
||||
// ./test/core/global.wast:617
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -615,7 +784,7 @@ assert_malformed(
|
|||
`duplicate global`,
|
||||
);
|
||||
|
||||
// ./test/core/global.wast:494
|
||||
// ./test/core/global.wast:621
|
||||
assert_malformed(
|
||||
() =>
|
||||
instantiate(
|
||||
|
|
|
@ -286,7 +286,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-local (local i32 i64) (local.get 3)))`,
|
||||
`(module (func $$unbound-local (local i32 i64) (local.get 3) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
@ -295,7 +295,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-local (local i32 i64) (local.get 14324343)))`,
|
||||
`(module (func $$large-local (local i32 i64) (local.get 14324343) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
@ -304,7 +304,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-param (param i32 i64) (local.get 2)))`,
|
||||
`(module (func $$unbound-param (param i32 i64) (local.get 2) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
@ -313,7 +313,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-param (param i32 i64) (local.get 714324343)))`,
|
||||
`(module (func $$large-param (param i32 i64) (local.get 714324343) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
@ -322,7 +322,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.get 3)))`,
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.get 3) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
@ -331,7 +331,7 @@ assert_invalid(
|
|||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.get 214324343)))`,
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.get 214324343) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
|
|
@ -775,61 +775,7 @@ assert_invalid(() =>
|
|||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:601
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-local (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:605
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-local (local i32 i64) (local.get 14324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:610
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-param (param i32 i64) (local.get 2)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:614
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-param (local i32 i64) (local.get 714324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:619
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:623
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.get 214324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:628
|
||||
// ./test/core/local_tee.wast:598
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -838,7 +784,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:632
|
||||
// ./test/core/local_tee.wast:602
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -847,7 +793,7 @@ assert_invalid(
|
|||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:636
|
||||
// ./test/core/local_tee.wast:606
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
|
@ -855,3 +801,57 @@ assert_invalid(
|
|||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:614
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-local (local i32 i64) (local.tee 3 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:618
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-local (local i32 i64) (local.tee 14324343 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:623
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-param (param i32 i64) (local.tee 2 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:627
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-param (param i32 i64) (local.tee 714324343 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:632
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.tee 3 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:636
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.tee 214324343 (i32.const 0)) drop))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
|
|
@ -849,7 +849,10 @@ let $8 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:350
|
||||
assert_trap(() => invoke($8, `run`, [65516, 0, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($8, `run`, [65516, 0, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:353
|
||||
assert_return(() => invoke($8, `load8_u`, [0]), [value("i32", 0)]);
|
||||
|
@ -1908,7 +1911,10 @@ let $9 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:711
|
||||
assert_trap(() => invoke($9, `run`, [65515, 0, 39]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($9, `run`, [65515, 0, 39]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:714
|
||||
assert_return(() => invoke($9, `load8_u`, [0]), [value("i32", 0)]);
|
||||
|
@ -2970,7 +2976,10 @@ let $10 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:1073
|
||||
assert_trap(() => invoke($10, `run`, [0, 65516, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($10, `run`, [0, 65516, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:1076
|
||||
assert_return(() => invoke($10, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -4029,7 +4038,10 @@ let $11 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:1434
|
||||
assert_trap(() => invoke($11, `run`, [0, 65515, 39]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($11, `run`, [0, 65515, 39]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:1437
|
||||
assert_return(() => invoke($11, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -5091,7 +5103,10 @@ let $12 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:1796
|
||||
assert_trap(() => invoke($12, `run`, [65516, 65486, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($12, `run`, [65516, 65486, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:1799
|
||||
assert_return(() => invoke($12, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -6150,7 +6165,10 @@ let $13 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:2157
|
||||
assert_trap(() => invoke($13, `run`, [65486, 65516, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($13, `run`, [65486, 65516, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:2160
|
||||
assert_return(() => invoke($13, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -7209,7 +7227,10 @@ let $14 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:2518
|
||||
assert_trap(() => invoke($14, `run`, [65516, 65506, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($14, `run`, [65516, 65506, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:2521
|
||||
assert_return(() => invoke($14, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -8268,7 +8289,10 @@ let $15 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:2879
|
||||
assert_trap(() => invoke($15, `run`, [65506, 65516, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($15, `run`, [65506, 65516, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:2882
|
||||
assert_return(() => invoke($15, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -9327,7 +9351,10 @@ let $16 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:3240
|
||||
assert_trap(() => invoke($16, `run`, [65516, 65516, 40]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($16, `run`, [65516, 65516, 40]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:3243
|
||||
assert_return(() => invoke($16, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -10386,7 +10413,10 @@ let $17 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:3601
|
||||
assert_trap(() => invoke($17, `run`, [0, 65516, -4096]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($17, `run`, [0, 65516, -4096]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:3604
|
||||
assert_return(() => invoke($17, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -11445,7 +11475,10 @@ let $18 = instantiate(`(module
|
|||
(i32.load8_u (local.get 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:3962
|
||||
assert_trap(() => invoke($18, `run`, [65516, 61440, -256]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($18, `run`, [65516, 61440, -256]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_copy.wast:3965
|
||||
assert_return(() => invoke($18, `load8_u`, [198]), [value("i32", 0)]);
|
||||
|
@ -13208,7 +13241,7 @@ let $21 = instantiate(`(module
|
|||
(memory.copy (i32.const 0xFF00) (i32.const 0x8000) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4819
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4821
|
||||
let $22 = instantiate(`(module
|
||||
|
@ -13217,7 +13250,7 @@ let $22 = instantiate(`(module
|
|||
(memory.copy (i32.const 0xFFFFFF00) (i32.const 0x4000) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4825
|
||||
assert_trap(() => invoke($22, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($22, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4827
|
||||
let $23 = instantiate(`(module
|
||||
|
@ -13226,7 +13259,7 @@ let $23 = instantiate(`(module
|
|||
(memory.copy (i32.const 0x8000) (i32.const 0xFF00) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4831
|
||||
assert_trap(() => invoke($23, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($23, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4833
|
||||
let $24 = instantiate(`(module
|
||||
|
@ -13235,7 +13268,7 @@ let $24 = instantiate(`(module
|
|||
(memory.copy (i32.const 0x4000) (i32.const 0xFFFFFF00) (i32.const 257))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4837
|
||||
assert_trap(() => invoke($24, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($24, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4839
|
||||
let $25 = instantiate(`(module
|
||||
|
@ -13286,7 +13319,7 @@ let $27 = instantiate(`(module
|
|||
(memory.copy (i32.const 0x20000) (i32.const 0x7000) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4873
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4875
|
||||
let $28 = instantiate(`(module
|
||||
|
@ -13304,7 +13337,7 @@ let $29 = instantiate(`(module
|
|||
(memory.copy (i32.const 0x9000) (i32.const 0x20000) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4885
|
||||
assert_trap(() => invoke($29, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($29, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4887
|
||||
let $30 = instantiate(`(module
|
||||
|
@ -13322,7 +13355,7 @@ let $31 = instantiate(`(module
|
|||
(memory.copy (i32.const 0x20000) (i32.const 0x20000) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4897
|
||||
assert_trap(() => invoke($31, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($31, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_copy.wast:4899
|
||||
let $32 = instantiate(`(module
|
|
@ -154,7 +154,7 @@ let $5 = instantiate(`(module
|
|||
(memory.fill (i32.const 0x20000) (i32.const 0x55) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:118
|
||||
assert_trap(() => invoke($5, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($5, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_fill.wast:120
|
||||
let $6 = instantiate(`(module
|
||||
|
@ -889,7 +889,10 @@ let $8 = instantiate(`(module
|
|||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:638
|
||||
assert_trap(() => invoke($8, `run`, [65280, 37, 512]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($8, `run`, [65280, 37, 512]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:641
|
||||
assert_return(() => invoke($8, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -913,7 +916,10 @@ let $9 = instantiate(`(module
|
|||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:660
|
||||
assert_trap(() => invoke($9, `run`, [65279, 37, 514]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($9, `run`, [65279, 37, 514]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:663
|
||||
assert_return(() => invoke($9, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -937,7 +943,10 @@ let $10 = instantiate(`(module
|
|||
(memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_fill.wast:682
|
||||
assert_trap(() => invoke($10, `run`, [65279, 37, -1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($10, `run`, [65279, 37, -1]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_fill.wast:685
|
||||
assert_return(() => invoke($10, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
|
@ -517,8 +517,8 @@ assert_return(() => invoke($4, `as-memory.grow-size`, []), [value("i32", 1)]);
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty
|
||||
(memory.grow) (drop)
|
||||
(func $$type-size-empty-vs-i32 (result i32)
|
||||
(memory.grow)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -526,9 +526,9 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-in-block
|
||||
(func $$type-size-empty-vs-i32-in-block (result i32)
|
||||
(i32.const 0)
|
||||
(block (memory.grow) (drop))
|
||||
(block (result i32) (memory.grow))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -536,9 +536,9 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-in-loop
|
||||
(func $$type-size-empty-vs-i32-in-loop (result i32)
|
||||
(i32.const 0)
|
||||
(loop (memory.grow) (drop))
|
||||
(loop (result i32) (memory.grow))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -546,17 +546,35 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-in-then
|
||||
(func $$type-size-empty-vs-i32-in-then (result i32)
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (then (memory.grow) (drop)))
|
||||
(if (result i32) (then (memory.grow)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:355
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (memory 1) (func (result i32) (memory.grow (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
// ./test/core/memory_grow.wast:352
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-size-f32-vs-i32 (result i32)
|
||||
(memory.grow (f32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:362
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-result-i32-vs-empty
|
||||
(memory.grow (i32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:371
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-result-i32-vs-f32 (result f32)
|
||||
(memory.grow (i32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
|
|
@ -477,7 +477,7 @@ let $5 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 1234) (i32.const 1) (i32.const 1))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:217
|
||||
assert_trap(() => invoke($5, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($5, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:219
|
||||
let $6 = instantiate(`(module
|
||||
|
@ -487,7 +487,7 @@ let $6 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 1234) (i32.const 1) (i32.const 1))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:224
|
||||
assert_trap(() => invoke($6, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($6, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:226
|
||||
assert_invalid(
|
||||
|
@ -528,7 +528,7 @@ let $8 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 1234) (i32.const 0) (i32.const 5))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:253
|
||||
assert_trap(() => invoke($8, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($8, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:255
|
||||
let $9 = instantiate(`(module
|
||||
|
@ -538,7 +538,7 @@ let $9 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 1234) (i32.const 2) (i32.const 3))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:260
|
||||
assert_trap(() => invoke($9, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($9, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:262
|
||||
let $10 = instantiate(`(module
|
||||
|
@ -548,7 +548,7 @@ let $10 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 0xFFFE) (i32.const 1) (i32.const 3))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:267
|
||||
assert_trap(() => invoke($10, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($10, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:269
|
||||
let $11 = instantiate(`(module
|
||||
|
@ -558,7 +558,7 @@ let $11 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 1234) (i32.const 4) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:274
|
||||
assert_trap(() => invoke($11, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($11, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:276
|
||||
let $12 = instantiate(`(module
|
||||
|
@ -578,7 +578,7 @@ let $13 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 0x10001) (i32.const 0) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:288
|
||||
assert_trap(() => invoke($13, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($13, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:290
|
||||
let $14 = instantiate(`(module
|
||||
|
@ -608,7 +608,7 @@ let $16 = instantiate(`(module
|
|||
(memory.init 0 (i32.const 0x10001) (i32.const 4) (i32.const 0))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:309
|
||||
assert_trap(() => invoke($16, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($16, `test`, []), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:311
|
||||
assert_invalid(
|
||||
|
@ -1323,7 +1323,10 @@ let $17 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:833
|
||||
assert_trap(() => invoke($17, `run`, [65528, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($17, `run`, [65528, 16]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_init.wast:836
|
||||
assert_return(() => invoke($17, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -1348,7 +1351,10 @@ let $18 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:856
|
||||
assert_trap(() => invoke($18, `run`, [65527, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($18, `run`, [65527, 16]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_init.wast:859
|
||||
assert_return(() => invoke($18, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -1373,7 +1379,10 @@ let $19 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:879
|
||||
assert_trap(() => invoke($19, `run`, [65472, 30]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($19, `run`, [65472, 30]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_init.wast:882
|
||||
assert_return(() => invoke($19, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -1398,7 +1407,10 @@ let $20 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:902
|
||||
assert_trap(() => invoke($20, `run`, [65473, 31]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($20, `run`, [65473, 31]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_init.wast:905
|
||||
assert_return(() => invoke($20, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -1423,7 +1435,10 @@ let $21 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:925
|
||||
assert_trap(() => invoke($21, `run`, [65528, -256]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($21, `run`, [65528, -256]),
|
||||
`out of bounds memory access`,
|
||||
);
|
||||
|
||||
// ./test/core/memory_init.wast:928
|
||||
assert_return(() => invoke($21, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
||||
|
@ -1448,7 +1463,7 @@ let $22 = instantiate(`(module
|
|||
(memory.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/memory_init.wast:948
|
||||
assert_trap(() => invoke($22, `run`, [0, -4]), `out of bounds`);
|
||||
assert_trap(() => invoke($22, `run`, [0, -4]), `out of bounds memory access`);
|
||||
|
||||
// ./test/core/memory_init.wast:951
|
||||
assert_return(() => invoke($22, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -3904,7 +3904,7 @@ let $19 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1694
|
||||
assert_trap(() => invoke($19, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($19, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1696
|
||||
let $20 = instantiate(`(module
|
||||
|
@ -3931,7 +3931,7 @@ let $20 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1719
|
||||
assert_trap(() => invoke($20, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($20, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1721
|
||||
let $21 = instantiate(`(module
|
||||
|
@ -3958,7 +3958,7 @@ let $21 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1744
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1746
|
||||
let $22 = instantiate(`(module
|
||||
|
@ -3985,7 +3985,7 @@ let $22 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1769
|
||||
assert_trap(() => invoke($22, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($22, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1771
|
||||
let $23 = instantiate(`(module
|
||||
|
@ -4066,7 +4066,7 @@ let $25 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1844
|
||||
assert_trap(() => invoke($25, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($25, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1846
|
||||
let $26 = instantiate(`(module
|
||||
|
@ -4120,7 +4120,7 @@ let $27 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1894
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1896
|
||||
let $28 = instantiate(`(module
|
||||
|
@ -4174,7 +4174,7 @@ let $29 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1944
|
||||
assert_trap(() => invoke($29, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($29, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1946
|
||||
let $30 = instantiate(`(module
|
||||
|
@ -4201,7 +4201,7 @@ let $30 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1969
|
||||
assert_trap(() => invoke($30, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($30, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1971
|
||||
let $31 = instantiate(`(module
|
||||
|
@ -4228,7 +4228,7 @@ let $31 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:1994
|
||||
assert_trap(() => invoke($31, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($31, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:1996
|
||||
let $32 = instantiate(`(module
|
||||
|
@ -4255,7 +4255,7 @@ let $32 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2019
|
||||
assert_trap(() => invoke($32, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($32, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:2021
|
||||
let $33 = instantiate(`(module
|
||||
|
@ -4282,7 +4282,7 @@ let $33 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2044
|
||||
assert_trap(() => invoke($33, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($33, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:2046
|
||||
let $34 = instantiate(`(module
|
||||
|
@ -4363,7 +4363,7 @@ let $36 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2119
|
||||
assert_trap(() => invoke($36, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($36, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:2121
|
||||
let $37 = instantiate(`(module
|
||||
|
@ -4417,7 +4417,7 @@ let $38 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2169
|
||||
assert_trap(() => invoke($38, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($38, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:2171
|
||||
let $39 = instantiate(`(module
|
||||
|
@ -4471,7 +4471,7 @@ let $40 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2219
|
||||
assert_trap(() => invoke($40, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($40, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_copy.wast:2221
|
||||
let $41 = instantiate(`(module
|
||||
|
@ -4501,7 +4501,10 @@ let $41 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2247
|
||||
assert_trap(() => invoke($41, `run`, [24, 0, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($41, `run`, [24, 0, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2249
|
||||
assert_return(() => invoke($41, `test`, [0]), [value("i32", 0)]);
|
||||
|
@ -4627,7 +4630,10 @@ let $42 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2308
|
||||
assert_trap(() => invoke($42, `run`, [23, 0, 15]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($42, `run`, [23, 0, 15]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2310
|
||||
assert_return(() => invoke($42, `test`, [0]), [value("i32", 0)]);
|
||||
|
@ -4753,7 +4759,10 @@ let $43 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2369
|
||||
assert_trap(() => invoke($43, `run`, [0, 24, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($43, `run`, [0, 24, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2371
|
||||
assert_trap(() => invoke($43, `test`, [0]), `uninitialized element`);
|
||||
|
@ -4879,7 +4888,10 @@ let $44 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2430
|
||||
assert_trap(() => invoke($44, `run`, [0, 23, 15]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($44, `run`, [0, 23, 15]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2432
|
||||
assert_trap(() => invoke($44, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5005,7 +5017,10 @@ let $45 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2491
|
||||
assert_trap(() => invoke($45, `run`, [24, 11, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($45, `run`, [24, 11, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2493
|
||||
assert_trap(() => invoke($45, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5131,7 +5146,10 @@ let $46 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2552
|
||||
assert_trap(() => invoke($46, `run`, [11, 24, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($46, `run`, [11, 24, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2554
|
||||
assert_trap(() => invoke($46, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5257,7 +5275,10 @@ let $47 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2613
|
||||
assert_trap(() => invoke($47, `run`, [24, 21, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($47, `run`, [24, 21, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2615
|
||||
assert_trap(() => invoke($47, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5383,7 +5404,10 @@ let $48 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2674
|
||||
assert_trap(() => invoke($48, `run`, [21, 24, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($48, `run`, [21, 24, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2676
|
||||
assert_trap(() => invoke($48, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5509,7 +5533,10 @@ let $49 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2735
|
||||
assert_trap(() => invoke($49, `run`, [21, 21, 16]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($49, `run`, [21, 21, 16]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2737
|
||||
assert_trap(() => invoke($49, `test`, [0]), `uninitialized element`);
|
||||
|
@ -5635,7 +5662,10 @@ let $50 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2796
|
||||
assert_trap(() => invoke($50, `run`, [0, 112, -32]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($50, `run`, [0, 112, -32]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2798
|
||||
assert_trap(() => invoke($50, `test`, [0]), `uninitialized element`);
|
||||
|
@ -6049,7 +6079,10 @@ let $51 = instantiate(`(module
|
|||
(table.copy (local.get $$targetOffs) (local.get $$srcOffs) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_copy.wast:2953
|
||||
assert_trap(() => invoke($51, `run`, [112, 0, -32]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($51, `run`, [112, 0, -32]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_copy.wast:2955
|
||||
assert_return(() => invoke($51, `test`, [0]), [value("i32", 0)]);
|
|
@ -116,7 +116,10 @@ assert_return(() => invoke($0, `fill`, [10, externref(5), 0]), []);
|
|||
assert_return(() => invoke($0, `get`, [9]), [value("externref", null)]);
|
||||
|
||||
// ./test/core/table_fill.wast:49
|
||||
assert_trap(() => invoke($0, `fill`, [8, externref(6), 3]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `fill`, [8, externref(6), 3]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_fill.wast:53
|
||||
assert_return(() => invoke($0, `get`, [7]), [value("externref", null)]);
|
||||
|
@ -128,10 +131,16 @@ assert_return(() => invoke($0, `get`, [8]), [value("externref", externref(4))]);
|
|||
assert_return(() => invoke($0, `get`, [9]), [value("externref", null)]);
|
||||
|
||||
// ./test/core/table_fill.wast:57
|
||||
assert_trap(() => invoke($0, `fill`, [11, null, 0]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `fill`, [11, null, 0]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_fill.wast:62
|
||||
assert_trap(() => invoke($0, `fill`, [11, null, 10]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `fill`, [11, null, 10]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_fill.wast:70
|
||||
assert_invalid(() =>
|
|
@ -62,16 +62,25 @@ assert_return(() => invoke($0, `is_null-funcref`, [1]), [value("i32", 0)]);
|
|||
assert_return(() => invoke($0, `is_null-funcref`, [2]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/table_get.wast:33
|
||||
assert_trap(() => invoke($0, `get-externref`, [2]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `get-externref`, [2]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_get.wast:34
|
||||
assert_trap(() => invoke($0, `get-funcref`, [3]), `out of bounds`);
|
||||
assert_trap(() => invoke($0, `get-funcref`, [3]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_get.wast:35
|
||||
assert_trap(() => invoke($0, `get-externref`, [-1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `get-externref`, [-1]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_get.wast:36
|
||||
assert_trap(() => invoke($0, `get-funcref`, [-1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `get-funcref`, [-1]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_get.wast:41
|
||||
assert_invalid(() =>
|
|
@ -849,7 +849,7 @@ let $8 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:453
|
||||
assert_trap(() => invoke($8, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($8, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:455
|
||||
let $9 = instantiate(`(module
|
||||
|
@ -930,7 +930,7 @@ let $11 = instantiate(`(module
|
|||
(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))))`);
|
||||
|
||||
// ./test/core/table_init.wast:525
|
||||
assert_trap(() => invoke($11, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($11, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:527
|
||||
let $12 = instantiate(`(module
|
||||
|
@ -957,7 +957,7 @@ let $12 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:549
|
||||
assert_trap(() => invoke($12, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($12, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:551
|
||||
let $13 = instantiate(`(module
|
||||
|
@ -984,7 +984,7 @@ let $13 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:573
|
||||
assert_trap(() => invoke($13, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($13, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:575
|
||||
let $14 = instantiate(`(module
|
||||
|
@ -1011,7 +1011,7 @@ let $14 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:597
|
||||
assert_trap(() => invoke($14, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($14, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:599
|
||||
let $15 = instantiate(`(module
|
||||
|
@ -1065,7 +1065,7 @@ let $16 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:645
|
||||
assert_trap(() => invoke($16, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($16, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:647
|
||||
let $17 = instantiate(`(module
|
||||
|
@ -1119,7 +1119,7 @@ let $18 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:693
|
||||
assert_trap(() => invoke($18, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($18, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:695
|
||||
let $19 = instantiate(`(module
|
||||
|
@ -1173,7 +1173,7 @@ let $20 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:741
|
||||
assert_trap(() => invoke($20, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($20, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:743
|
||||
let $21 = instantiate(`(module
|
||||
|
@ -1200,7 +1200,7 @@ let $21 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:765
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($21, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:767
|
||||
let $22 = instantiate(`(module
|
||||
|
@ -1254,7 +1254,7 @@ let $23 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:813
|
||||
assert_trap(() => invoke($23, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($23, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:815
|
||||
let $24 = instantiate(`(module
|
||||
|
@ -1308,7 +1308,7 @@ let $25 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:861
|
||||
assert_trap(() => invoke($25, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($25, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:863
|
||||
let $26 = instantiate(`(module
|
||||
|
@ -1362,7 +1362,7 @@ let $27 = instantiate(`(module
|
|||
))`);
|
||||
|
||||
// ./test/core/table_init.wast:909
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds`);
|
||||
assert_trap(() => invoke($27, `test`, []), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:911
|
||||
assert_invalid(
|
||||
|
@ -2151,7 +2151,7 @@ let $28 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:1506
|
||||
assert_trap(() => invoke($28, `run`, [24, 16]), `out of bounds`);
|
||||
assert_trap(() => invoke($28, `run`, [24, 16]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:1507
|
||||
assert_trap(() => invoke($28, `test`, [0]), `uninitialized element`);
|
||||
|
@ -2280,7 +2280,7 @@ let $29 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:1568
|
||||
assert_trap(() => invoke($29, `run`, [25, 16]), `out of bounds`);
|
||||
assert_trap(() => invoke($29, `run`, [25, 16]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:1569
|
||||
assert_trap(() => invoke($29, `test`, [0]), `uninitialized element`);
|
||||
|
@ -2409,7 +2409,7 @@ let $30 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:1630
|
||||
assert_trap(() => invoke($30, `run`, [96, 32]), `out of bounds`);
|
||||
assert_trap(() => invoke($30, `run`, [96, 32]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:1631
|
||||
assert_trap(() => invoke($30, `test`, [0]), `uninitialized element`);
|
||||
|
@ -2922,7 +2922,7 @@ let $31 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:1820
|
||||
assert_trap(() => invoke($31, `run`, [97, 31]), `out of bounds`);
|
||||
assert_trap(() => invoke($31, `run`, [97, 31]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:1821
|
||||
assert_trap(() => invoke($31, `test`, [0]), `uninitialized element`);
|
||||
|
@ -3435,7 +3435,7 @@ let $32 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:2010
|
||||
assert_trap(() => invoke($32, `run`, [48, -16]), `out of bounds`);
|
||||
assert_trap(() => invoke($32, `run`, [48, -16]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:2011
|
||||
assert_trap(() => invoke($32, `test`, [0]), `uninitialized element`);
|
||||
|
@ -3660,7 +3660,7 @@ let $33 = instantiate(`(module
|
|||
(table.init 0 (local.get $$offs) (i32.const 8) (local.get $$len))))`);
|
||||
|
||||
// ./test/core/table_init.wast:2104
|
||||
assert_trap(() => invoke($33, `run`, [0, -4]), `out of bounds`);
|
||||
assert_trap(() => invoke($33, `run`, [0, -4]), `out of bounds table access`);
|
||||
|
||||
// ./test/core/table_init.wast:2105
|
||||
assert_trap(() => invoke($33, `test`, [0]), `uninitialized element`);
|
|
@ -81,34 +81,52 @@ assert_return(() => invoke($0, `set-funcref`, [0, null]), []);
|
|||
assert_return(() => invoke($0, `get-funcref`, [0]), [value("funcref", null)]);
|
||||
|
||||
// ./test/core/table_set.wast:41
|
||||
assert_trap(() => invoke($0, `set-externref`, [2, null]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-externref`, [2, null]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:42
|
||||
assert_trap(() => invoke($0, `set-funcref`, [3, null]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-funcref`, [3, null]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:43
|
||||
assert_trap(() => invoke($0, `set-externref`, [-1, null]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-externref`, [-1, null]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:44
|
||||
assert_trap(() => invoke($0, `set-funcref`, [-1, null]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-funcref`, [-1, null]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:46
|
||||
assert_trap(
|
||||
() => invoke($0, `set-externref`, [2, externref(0)]),
|
||||
`out of bounds`,
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:47
|
||||
assert_trap(() => invoke($0, `set-funcref-from`, [3, 1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-funcref-from`, [3, 1]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:48
|
||||
assert_trap(
|
||||
() => invoke($0, `set-externref`, [-1, externref(0)]),
|
||||
`out of bounds`,
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:49
|
||||
assert_trap(() => invoke($0, `set-funcref-from`, [-1, 1]), `out of bounds`);
|
||||
assert_trap(
|
||||
() => invoke($0, `set-funcref-from`, [-1, 1]),
|
||||
`out of bounds table access`,
|
||||
);
|
||||
|
||||
// ./test/core/table_set.wast:54
|
||||
assert_invalid(() =>
|
|
@ -60,13 +60,12 @@ let $5 = instantiate(`(module binary
|
|||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\04\\04\\01" ;; Table section with 1 entry
|
||||
"\\70\\00\\00" ;; no max, minimum 0, funcref
|
||||
"\\09\\09\\01" ;; Element section with 1 entry
|
||||
"\\02" ;; Element with explicit table index
|
||||
"\\09\\07\\01" ;; Element section with 1 entry
|
||||
"\\80\\00" ;; Table index 0, encoded with 2 bytes
|
||||
"\\41\\00\\0b\\00\\00" ;; (i32.const 0) with no elements
|
||||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:41
|
||||
// ./test/core/binary-leb128.wast:40
|
||||
let $6 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00" ;; custom section
|
||||
|
@ -76,7 +75,7 @@ let $6 = instantiate(`(module binary
|
|||
"23456789" ;; sequence of bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:49
|
||||
// ./test/core/binary-leb128.wast:48
|
||||
let $7 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\00" ;; custom section
|
||||
|
@ -86,7 +85,7 @@ let $7 = instantiate(`(module binary
|
|||
"9" ;; sequence of bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:57
|
||||
// ./test/core/binary-leb128.wast:56
|
||||
let $8 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\08\\01" ;; type section
|
||||
|
@ -97,7 +96,7 @@ let $8 = instantiate(`(module binary
|
|||
"\\7f" ;; result type
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:66
|
||||
// ./test/core/binary-leb128.wast:65
|
||||
let $9 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\08\\01" ;; type section
|
||||
|
@ -108,7 +107,7 @@ let $9 = instantiate(`(module binary
|
|||
"\\7f" ;; result type
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:75
|
||||
// ./test/core/binary-leb128.wast:74
|
||||
let $10 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -122,7 +121,7 @@ let $10 = instantiate(`(module binary
|
|||
"\\00" ;; import signature index
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:87
|
||||
// ./test/core/binary-leb128.wast:86
|
||||
let $11 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -136,7 +135,7 @@ let $11 = instantiate(`(module binary
|
|||
"\\00" ;; import signature index
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:99
|
||||
// ./test/core/binary-leb128.wast:98
|
||||
let $12 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\05\\01" ;; type section
|
||||
|
@ -150,7 +149,7 @@ let $12 = instantiate(`(module binary
|
|||
"\\80\\00" ;; import signature index, encoded with 2 bytes
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:111
|
||||
// ./test/core/binary-leb128.wast:110
|
||||
let $13 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -161,7 +160,7 @@ let $13 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:120
|
||||
// ./test/core/binary-leb128.wast:119
|
||||
let $14 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -176,7 +175,7 @@ let $14 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:133
|
||||
// ./test/core/binary-leb128.wast:132
|
||||
let $15 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -191,7 +190,7 @@ let $15 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:146
|
||||
// ./test/core/binary-leb128.wast:145
|
||||
let $16 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\01\\04\\01" ;; type section
|
||||
|
@ -203,7 +202,7 @@ let $16 = instantiate(`(module binary
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:158
|
||||
// ./test/core/binary-leb128.wast:157
|
||||
let $17 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -212,7 +211,7 @@ let $17 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:165
|
||||
// ./test/core/binary-leb128.wast:164
|
||||
let $18 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -221,7 +220,7 @@ let $18 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:172
|
||||
// ./test/core/binary-leb128.wast:171
|
||||
let $19 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0a\\01" ;; Global section with 1 entry
|
||||
|
@ -230,7 +229,7 @@ let $19 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:179
|
||||
// ./test/core/binary-leb128.wast:178
|
||||
let $20 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0a\\01" ;; Global section with 1 entry
|
||||
|
@ -239,7 +238,7 @@ let $20 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:187
|
||||
// ./test/core/binary-leb128.wast:186
|
||||
let $21 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -248,7 +247,7 @@ let $21 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:194
|
||||
// ./test/core/binary-leb128.wast:193
|
||||
let $22 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\07\\01" ;; Global section with 1 entry
|
||||
|
@ -257,7 +256,7 @@ let $22 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:201
|
||||
// ./test/core/binary-leb128.wast:200
|
||||
let $23 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0f\\01" ;; Global section with 1 entry
|
||||
|
@ -266,7 +265,7 @@ let $23 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:208
|
||||
// ./test/core/binary-leb128.wast:207
|
||||
let $24 = instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
"\\06\\0f\\01" ;; Global section with 1 entry
|
||||
|
@ -275,7 +274,7 @@ let $24 = instantiate(`(module binary
|
|||
"\\0b" ;; end
|
||||
)`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:217
|
||||
// ./test/core/binary-leb128.wast:216
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -283,7 +282,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\80\\00" ;; no max, minimum 2 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:225
|
||||
// ./test/core/binary-leb128.wast:224
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -292,7 +291,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\80\\00" ;; max 2 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:234
|
||||
// ./test/core/binary-leb128.wast:233
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -303,7 +302,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with contents ""
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:245
|
||||
// ./test/core/binary-leb128.wast:244
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -314,7 +313,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:256
|
||||
// ./test/core/binary-leb128.wast:255
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -325,7 +324,7 @@ assert_malformed(() =>
|
|||
"2" ;; sequence of bytes
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:267
|
||||
// ./test/core/binary-leb128.wast:266
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -336,7 +335,7 @@ assert_malformed(() =>
|
|||
"4" ;; sequence of bytes
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:278
|
||||
// ./test/core/binary-leb128.wast:277
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -348,7 +347,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:290
|
||||
// ./test/core/binary-leb128.wast:289
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -360,7 +359,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:302
|
||||
// ./test/core/binary-leb128.wast:301
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -375,7 +374,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:317
|
||||
// ./test/core/binary-leb128.wast:316
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -390,7 +389,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:332
|
||||
// ./test/core/binary-leb128.wast:331
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -405,7 +404,7 @@ assert_malformed(() =>
|
|||
"\\80\\80\\80\\80\\80\\00" ;; import signature index 0 with one byte too many
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:347
|
||||
// ./test/core/binary-leb128.wast:346
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -417,7 +416,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:359
|
||||
// ./test/core/binary-leb128.wast:358
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -433,7 +432,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:375
|
||||
// ./test/core/binary-leb128.wast:374
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -449,7 +448,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:391
|
||||
// ./test/core/binary-leb128.wast:390
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -462,7 +461,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:404
|
||||
// ./test/core/binary-leb128.wast:403
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -481,7 +480,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:423
|
||||
// ./test/core/binary-leb128.wast:422
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -500,7 +499,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:442
|
||||
// ./test/core/binary-leb128.wast:441
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -519,7 +518,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:461
|
||||
// ./test/core/binary-leb128.wast:460
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -538,7 +537,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:482
|
||||
// ./test/core/binary-leb128.wast:481
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -548,7 +547,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:492
|
||||
// ./test/core/binary-leb128.wast:491
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -558,7 +557,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:503
|
||||
// ./test/core/binary-leb128.wast:502
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -568,7 +567,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:513
|
||||
// ./test/core/binary-leb128.wast:512
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -578,7 +577,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer representation too long`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:525
|
||||
// ./test/core/binary-leb128.wast:524
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -586,7 +585,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\70" ;; no max, minimum 2 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:533
|
||||
// ./test/core/binary-leb128.wast:532
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -594,7 +593,7 @@ assert_malformed(() =>
|
|||
"\\00\\82\\80\\80\\80\\40" ;; no max, minimum 2 with some unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:541
|
||||
// ./test/core/binary-leb128.wast:540
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -603,7 +602,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\10" ;; max 2 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:550
|
||||
// ./test/core/binary-leb128.wast:549
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -612,7 +611,7 @@ assert_malformed(() =>
|
|||
"\\82\\80\\80\\80\\40" ;; max 2 with some unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:559
|
||||
// ./test/core/binary-leb128.wast:558
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -623,7 +622,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with contents ""
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:570
|
||||
// ./test/core/binary-leb128.wast:569
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -634,7 +633,7 @@ assert_malformed(() =>
|
|||
"\\41\\00\\0b\\00" ;; (i32.const 0) with no elements
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:581
|
||||
// ./test/core/binary-leb128.wast:580
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -645,7 +644,7 @@ assert_malformed(() =>
|
|||
"2" ;; sequence of bytes
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:592
|
||||
// ./test/core/binary-leb128.wast:591
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -656,7 +655,7 @@ assert_malformed(() =>
|
|||
"4" ;; sequence of bytes
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:603
|
||||
// ./test/core/binary-leb128.wast:602
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -668,7 +667,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:615
|
||||
// ./test/core/binary-leb128.wast:614
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -680,7 +679,7 @@ assert_malformed(() =>
|
|||
"\\7f" ;; result type
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:627
|
||||
// ./test/core/binary-leb128.wast:626
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -695,7 +694,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:642
|
||||
// ./test/core/binary-leb128.wast:641
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -710,7 +709,7 @@ assert_malformed(() =>
|
|||
"\\00" ;; import signature index
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:657
|
||||
// ./test/core/binary-leb128.wast:656
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -725,7 +724,7 @@ assert_malformed(() =>
|
|||
"\\80\\80\\80\\80\\10" ;; import signature index 0 with unused bits set
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:672
|
||||
// ./test/core/binary-leb128.wast:671
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -737,7 +736,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:685
|
||||
// ./test/core/binary-leb128.wast:684
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -753,7 +752,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:701
|
||||
// ./test/core/binary-leb128.wast:700
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -769,7 +768,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:717
|
||||
// ./test/core/binary-leb128.wast:716
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -782,7 +781,7 @@ assert_malformed(() =>
|
|||
"\\02\\00\\0b" ;; function body
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:730
|
||||
// ./test/core/binary-leb128.wast:729
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -801,7 +800,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:749
|
||||
// ./test/core/binary-leb128.wast:748
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -820,7 +819,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:768
|
||||
// ./test/core/binary-leb128.wast:767
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -838,7 +837,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:786
|
||||
// ./test/core/binary-leb128.wast:785
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -857,7 +856,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:805
|
||||
// ./test/core/binary-leb128.wast:804
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -876,7 +875,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:824
|
||||
// ./test/core/binary-leb128.wast:823
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -895,7 +894,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:843
|
||||
// ./test/core/binary-leb128.wast:842
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -914,7 +913,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:862
|
||||
// ./test/core/binary-leb128.wast:861
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -934,7 +933,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:884
|
||||
// ./test/core/binary-leb128.wast:883
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -944,7 +943,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:894
|
||||
// ./test/core/binary-leb128.wast:893
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -954,7 +953,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:904
|
||||
// ./test/core/binary-leb128.wast:903
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -964,7 +963,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:914
|
||||
// ./test/core/binary-leb128.wast:913
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -974,7 +973,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:925
|
||||
// ./test/core/binary-leb128.wast:924
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -984,7 +983,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:935
|
||||
// ./test/core/binary-leb128.wast:934
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -994,7 +993,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:945
|
||||
// ./test/core/binary-leb128.wast:944
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
||||
|
@ -1004,7 +1003,7 @@ assert_malformed(() =>
|
|||
"\\0b" ;; end
|
||||
)`), `integer too large`);
|
||||
|
||||
// ./test/core/binary-leb128.wast:955
|
||||
// ./test/core/binary-leb128.wast:954
|
||||
assert_malformed(() =>
|
||||
instantiate(`(module binary
|
||||
"\\00asm" "\\01\\00\\00\\00"
|
|
@ -0,0 +1,337 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/local_get.wast
|
||||
|
||||
// ./test/core/local_get.wast:3
|
||||
let $0 = instantiate(`(module
|
||||
;; Typing
|
||||
|
||||
(func (export "type-local-i32") (result i32) (local i32) (local.get 0))
|
||||
(func (export "type-local-i64") (result i64) (local i64) (local.get 0))
|
||||
(func (export "type-local-f32") (result f32) (local f32) (local.get 0))
|
||||
(func (export "type-local-f64") (result f64) (local f64) (local.get 0))
|
||||
|
||||
(func (export "type-param-i32") (param i32) (result i32) (local.get 0))
|
||||
(func (export "type-param-i64") (param i64) (result i64) (local.get 0))
|
||||
(func (export "type-param-f32") (param f32) (result f32) (local.get 0))
|
||||
(func (export "type-param-f64") (param f64) (result f64) (local.get 0))
|
||||
|
||||
(func (export "type-mixed") (param i64 f32 f64 i32 i32)
|
||||
(local f32 i64 i64 f64)
|
||||
(drop (i64.eqz (local.get 0)))
|
||||
(drop (f32.neg (local.get 1)))
|
||||
(drop (f64.neg (local.get 2)))
|
||||
(drop (i32.eqz (local.get 3)))
|
||||
(drop (i32.eqz (local.get 4)))
|
||||
(drop (f32.neg (local.get 5)))
|
||||
(drop (i64.eqz (local.get 6)))
|
||||
(drop (i64.eqz (local.get 7)))
|
||||
(drop (f64.neg (local.get 8)))
|
||||
)
|
||||
|
||||
;; Reading
|
||||
|
||||
(func (export "read") (param i64 f32 f64 i32 i32) (result f64)
|
||||
(local f32 i64 i64 f64)
|
||||
(local.set 5 (f32.const 5.5))
|
||||
(local.set 6 (i64.const 6))
|
||||
(local.set 8 (f64.const 8))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 0))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.get 1))
|
||||
(f64.add
|
||||
(local.get 2)
|
||||
(f64.add
|
||||
(f64.convert_i32_u (local.get 3))
|
||||
(f64.add
|
||||
(f64.convert_i32_s (local.get 4))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.get 5))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 6))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 7))
|
||||
(local.get 8)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; As parameter of control constructs and instructions
|
||||
|
||||
(func (export "as-block-value") (param i32) (result i32)
|
||||
(block (result i32) (local.get 0))
|
||||
)
|
||||
(func (export "as-loop-value") (param i32) (result i32)
|
||||
(loop (result i32) (local.get 0))
|
||||
)
|
||||
(func (export "as-br-value") (param i32) (result i32)
|
||||
(block (result i32) (br 0 (local.get 0)))
|
||||
)
|
||||
(func (export "as-br_if-value") (param i32) (result i32)
|
||||
(block $$l0 (result i32) (br_if $$l0 (local.get 0) (i32.const 1)))
|
||||
)
|
||||
|
||||
(func (export "as-br_if-value-cond") (param i32) (result i32)
|
||||
(block (result i32)
|
||||
(br_if 0 (local.get 0) (local.get 0))
|
||||
)
|
||||
)
|
||||
(func (export "as-br_table-value") (param i32) (result i32)
|
||||
(block
|
||||
(block
|
||||
(block
|
||||
(br_table 0 1 2 (local.get 0))
|
||||
(return (i32.const 0))
|
||||
)
|
||||
(return (i32.const 1))
|
||||
)
|
||||
(return (i32.const 2))
|
||||
)
|
||||
(i32.const 3)
|
||||
)
|
||||
|
||||
(func (export "as-return-value") (param i32) (result i32)
|
||||
(return (local.get 0))
|
||||
)
|
||||
|
||||
(func (export "as-if-then") (param i32) (result i32)
|
||||
(if (result i32) (local.get 0) (then (local.get 0)) (else (i32.const 0)))
|
||||
)
|
||||
(func (export "as-if-else") (param i32) (result i32)
|
||||
(if (result i32) (local.get 0) (then (i32.const 1)) (else (local.get 0)))
|
||||
)
|
||||
)`);
|
||||
|
||||
// ./test/core/local_get.wast:109
|
||||
assert_return(() => invoke($0, `type-local-i32`, []), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_get.wast:110
|
||||
assert_return(() => invoke($0, `type-local-i64`, []), [value("i64", 0n)]);
|
||||
|
||||
// ./test/core/local_get.wast:111
|
||||
assert_return(() => invoke($0, `type-local-f32`, []), [value("f32", 0)]);
|
||||
|
||||
// ./test/core/local_get.wast:112
|
||||
assert_return(() => invoke($0, `type-local-f64`, []), [value("f64", 0)]);
|
||||
|
||||
// ./test/core/local_get.wast:114
|
||||
assert_return(() => invoke($0, `type-param-i32`, [2]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/local_get.wast:115
|
||||
assert_return(() => invoke($0, `type-param-i64`, [3n]), [value("i64", 3n)]);
|
||||
|
||||
// ./test/core/local_get.wast:116
|
||||
assert_return(() => invoke($0, `type-param-f32`, [value("f32", 4.4)]), [
|
||||
value("f32", 4.4),
|
||||
]);
|
||||
|
||||
// ./test/core/local_get.wast:117
|
||||
assert_return(() => invoke($0, `type-param-f64`, [value("f64", 5.5)]), [
|
||||
value("f64", 5.5),
|
||||
]);
|
||||
|
||||
// ./test/core/local_get.wast:119
|
||||
assert_return(() => invoke($0, `as-block-value`, [6]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/local_get.wast:120
|
||||
assert_return(() => invoke($0, `as-loop-value`, [7]), [value("i32", 7)]);
|
||||
|
||||
// ./test/core/local_get.wast:122
|
||||
assert_return(() => invoke($0, `as-br-value`, [8]), [value("i32", 8)]);
|
||||
|
||||
// ./test/core/local_get.wast:123
|
||||
assert_return(() => invoke($0, `as-br_if-value`, [9]), [value("i32", 9)]);
|
||||
|
||||
// ./test/core/local_get.wast:124
|
||||
assert_return(() => invoke($0, `as-br_if-value-cond`, [10]), [
|
||||
value("i32", 10),
|
||||
]);
|
||||
|
||||
// ./test/core/local_get.wast:125
|
||||
assert_return(() => invoke($0, `as-br_table-value`, [1]), [value("i32", 2)]);
|
||||
|
||||
// ./test/core/local_get.wast:127
|
||||
assert_return(() => invoke($0, `as-return-value`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_get.wast:129
|
||||
assert_return(() => invoke($0, `as-if-then`, [1]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_get.wast:130
|
||||
assert_return(() => invoke($0, `as-if-else`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_get.wast:132
|
||||
assert_return(
|
||||
() =>
|
||||
invoke($0, `type-mixed`, [1n, value("f32", 2.2), value("f64", 3.3), 4, 5]),
|
||||
[],
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:138
|
||||
assert_return(
|
||||
() => invoke($0, `read`, [1n, value("f32", 2), value("f64", 3.3), 4, 5]),
|
||||
[value("f64", 34.8)],
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:148
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (result i64) (local i32) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:152
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (result i32) (local f32) (i32.eqz (local.get 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:156
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (result f64) (local f64 i64) (f64.neg (local.get 1))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:164
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param i32) (result i64) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:168
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param f32) (result i32) (i32.eqz (local.get 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:172
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param f64 i64) (result f64) (f64.neg (local.get 1))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:180
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-empty-vs-i32 (local i32) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:184
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-empty-vs-i64 (local i64) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:188
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-empty-vs-f32 (local f32) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:192
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-empty-vs-f64 (local f64) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:200
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-local (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:204
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-local (local i32 i64) (local.get 14324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:209
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-param (param i32 i64) (local.get 2)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:213
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-param (param i32 i64) (local.get 714324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:218
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_get.wast:222
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.get 214324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
|
@ -0,0 +1,857 @@
|
|||
/* Copyright 2021 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// ./test/core/local_tee.wast
|
||||
|
||||
// ./test/core/local_tee.wast:3
|
||||
let $0 = instantiate(`(module
|
||||
;; Typing
|
||||
|
||||
(func (export "type-local-i32") (result i32) (local i32) (local.tee 0 (i32.const 0)))
|
||||
(func (export "type-local-i64") (result i64) (local i64) (local.tee 0 (i64.const 0)))
|
||||
(func (export "type-local-f32") (result f32) (local f32) (local.tee 0 (f32.const 0)))
|
||||
(func (export "type-local-f64") (result f64) (local f64) (local.tee 0 (f64.const 0)))
|
||||
|
||||
(func (export "type-param-i32") (param i32) (result i32) (local.tee 0 (i32.const 10)))
|
||||
(func (export "type-param-i64") (param i64) (result i64) (local.tee 0 (i64.const 11)))
|
||||
(func (export "type-param-f32") (param f32) (result f32) (local.tee 0 (f32.const 11.1)))
|
||||
(func (export "type-param-f64") (param f64) (result f64) (local.tee 0 (f64.const 12.2)))
|
||||
|
||||
(func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64)
|
||||
(drop (i64.eqz (local.tee 0 (i64.const 0))))
|
||||
(drop (f32.neg (local.tee 1 (f32.const 0))))
|
||||
(drop (f64.neg (local.tee 2 (f64.const 0))))
|
||||
(drop (i32.eqz (local.tee 3 (i32.const 0))))
|
||||
(drop (i32.eqz (local.tee 4 (i32.const 0))))
|
||||
(drop (f32.neg (local.tee 5 (f32.const 0))))
|
||||
(drop (i64.eqz (local.tee 6 (i64.const 0))))
|
||||
(drop (i64.eqz (local.tee 7 (i64.const 0))))
|
||||
(drop (f64.neg (local.tee 8 (f64.const 0))))
|
||||
)
|
||||
|
||||
;; Writing
|
||||
|
||||
(func (export "write") (param i64 f32 f64 i32 i32) (result i64) (local f32 i64 i64 f64)
|
||||
(drop (local.tee 1 (f32.const -0.3)))
|
||||
(drop (local.tee 3 (i32.const 40)))
|
||||
(drop (local.tee 4 (i32.const -7)))
|
||||
(drop (local.tee 5 (f32.const 5.5)))
|
||||
(drop (local.tee 6 (i64.const 6)))
|
||||
(drop (local.tee 8 (f64.const 8)))
|
||||
(i64.trunc_f64_s
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 0))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.get 1))
|
||||
(f64.add
|
||||
(local.get 2)
|
||||
(f64.add
|
||||
(f64.convert_i32_u (local.get 3))
|
||||
(f64.add
|
||||
(f64.convert_i32_s (local.get 4))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.get 5))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 6))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.get 7))
|
||||
(local.get 8)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; Result
|
||||
|
||||
(func (export "result") (param i64 f32 f64 i32 i32) (result f64)
|
||||
(local f32 i64 i64 f64)
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.tee 0 (i64.const 1)))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.tee 1 (f32.const 2)))
|
||||
(f64.add
|
||||
(local.tee 2 (f64.const 3.3))
|
||||
(f64.add
|
||||
(f64.convert_i32_u (local.tee 3 (i32.const 4)))
|
||||
(f64.add
|
||||
(f64.convert_i32_s (local.tee 4 (i32.const 5)))
|
||||
(f64.add
|
||||
(f64.promote_f32 (local.tee 5 (f32.const 5.5)))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.tee 6 (i64.const 6)))
|
||||
(f64.add
|
||||
(f64.convert_i64_u (local.tee 7 (i64.const 0)))
|
||||
(local.tee 8 (f64.const 8))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(func $$dummy)
|
||||
|
||||
(func (export "as-block-first") (param i32) (result i32)
|
||||
(block (result i32) (local.tee 0 (i32.const 1)) (call $$dummy))
|
||||
)
|
||||
(func (export "as-block-mid") (param i32) (result i32)
|
||||
(block (result i32) (call $$dummy) (local.tee 0 (i32.const 1)) (call $$dummy))
|
||||
)
|
||||
(func (export "as-block-last") (param i32) (result i32)
|
||||
(block (result i32) (call $$dummy) (call $$dummy) (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
|
||||
(func (export "as-loop-first") (param i32) (result i32)
|
||||
(loop (result i32) (local.tee 0 (i32.const 3)) (call $$dummy))
|
||||
)
|
||||
(func (export "as-loop-mid") (param i32) (result i32)
|
||||
(loop (result i32) (call $$dummy) (local.tee 0 (i32.const 4)) (call $$dummy))
|
||||
)
|
||||
(func (export "as-loop-last") (param i32) (result i32)
|
||||
(loop (result i32) (call $$dummy) (call $$dummy) (local.tee 0 (i32.const 5)))
|
||||
)
|
||||
|
||||
(func (export "as-br-value") (param i32) (result i32)
|
||||
(block (result i32) (br 0 (local.tee 0 (i32.const 9))))
|
||||
)
|
||||
|
||||
(func (export "as-br_if-cond") (param i32)
|
||||
(block (br_if 0 (local.tee 0 (i32.const 1))))
|
||||
)
|
||||
(func (export "as-br_if-value") (param i32) (result i32)
|
||||
(block (result i32)
|
||||
(drop (br_if 0 (local.tee 0 (i32.const 8)) (i32.const 1))) (i32.const 7)
|
||||
)
|
||||
)
|
||||
(func (export "as-br_if-value-cond") (param i32) (result i32)
|
||||
(block (result i32)
|
||||
(drop (br_if 0 (i32.const 6) (local.tee 0 (i32.const 9)))) (i32.const 7)
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-br_table-index") (param i32)
|
||||
(block (br_table 0 0 0 (local.tee 0 (i32.const 0))))
|
||||
)
|
||||
(func (export "as-br_table-value") (param i32) (result i32)
|
||||
(block (result i32)
|
||||
(br_table 0 0 0 (local.tee 0 (i32.const 10)) (i32.const 1)) (i32.const 7)
|
||||
)
|
||||
)
|
||||
(func (export "as-br_table-value-index") (param i32) (result i32)
|
||||
(block (result i32)
|
||||
(br_table 0 0 (i32.const 6) (local.tee 0 (i32.const 11))) (i32.const 7)
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-return-value") (param i32) (result i32)
|
||||
(return (local.tee 0 (i32.const 7)))
|
||||
)
|
||||
|
||||
(func (export "as-if-cond") (param i32) (result i32)
|
||||
(if (result i32) (local.tee 0 (i32.const 2))
|
||||
(then (i32.const 0)) (else (i32.const 1))
|
||||
)
|
||||
)
|
||||
(func (export "as-if-then") (param i32) (result i32)
|
||||
(if (result i32) (local.get 0)
|
||||
(then (local.tee 0 (i32.const 3))) (else (local.get 0))
|
||||
)
|
||||
)
|
||||
(func (export "as-if-else") (param i32) (result i32)
|
||||
(if (result i32) (local.get 0)
|
||||
(then (local.get 0)) (else (local.tee 0 (i32.const 4)))
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-select-first") (param i32 i32) (result i32)
|
||||
(select (local.tee 0 (i32.const 5)) (local.get 0) (local.get 1))
|
||||
)
|
||||
(func (export "as-select-second") (param i32 i32) (result i32)
|
||||
(select (local.get 0) (local.tee 0 (i32.const 6)) (local.get 1))
|
||||
)
|
||||
(func (export "as-select-cond") (param i32) (result i32)
|
||||
(select (i32.const 0) (i32.const 1) (local.tee 0 (i32.const 7)))
|
||||
)
|
||||
|
||||
(func $$f (param i32 i32 i32) (result i32) (i32.const -1))
|
||||
(func (export "as-call-first") (param i32) (result i32)
|
||||
(call $$f (local.tee 0 (i32.const 12)) (i32.const 2) (i32.const 3))
|
||||
)
|
||||
(func (export "as-call-mid") (param i32) (result i32)
|
||||
(call $$f (i32.const 1) (local.tee 0 (i32.const 13)) (i32.const 3))
|
||||
)
|
||||
(func (export "as-call-last") (param i32) (result i32)
|
||||
(call $$f (i32.const 1) (i32.const 2) (local.tee 0 (i32.const 14)))
|
||||
)
|
||||
|
||||
(type $$sig (func (param i32 i32 i32) (result i32)))
|
||||
(table funcref (elem $$f))
|
||||
(func (export "as-call_indirect-first") (param i32) (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(local.tee 0 (i32.const 1)) (i32.const 2) (i32.const 3) (i32.const 0)
|
||||
)
|
||||
)
|
||||
(func (export "as-call_indirect-mid") (param i32) (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(i32.const 1) (local.tee 0 (i32.const 2)) (i32.const 3) (i32.const 0)
|
||||
)
|
||||
)
|
||||
(func (export "as-call_indirect-last") (param i32) (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(i32.const 1) (i32.const 2) (local.tee 0 (i32.const 3)) (i32.const 0)
|
||||
)
|
||||
)
|
||||
(func (export "as-call_indirect-index") (param i32) (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(i32.const 1) (i32.const 2) (i32.const 3) (local.tee 0 (i32.const 0))
|
||||
)
|
||||
)
|
||||
|
||||
(func (export "as-local.set-value") (local i32)
|
||||
(local.set 0 (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
(func (export "as-local.tee-value") (param i32) (result i32)
|
||||
(local.tee 0 (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
(global $$g (mut i32) (i32.const 0))
|
||||
(func (export "as-global.set-value") (local i32)
|
||||
(global.set $$g (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
|
||||
(memory 1)
|
||||
(func (export "as-load-address") (param i32) (result i32)
|
||||
(i32.load (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
(func (export "as-loadN-address") (param i32) (result i32)
|
||||
(i32.load8_s (local.tee 0 (i32.const 3)))
|
||||
)
|
||||
|
||||
(func (export "as-store-address") (param i32)
|
||||
(i32.store (local.tee 0 (i32.const 30)) (i32.const 7))
|
||||
)
|
||||
(func (export "as-store-value") (param i32)
|
||||
(i32.store (i32.const 2) (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
|
||||
(func (export "as-storeN-address") (param i32)
|
||||
(i32.store8 (local.tee 0 (i32.const 1)) (i32.const 7))
|
||||
)
|
||||
(func (export "as-storeN-value") (param i32)
|
||||
(i32.store16 (i32.const 2) (local.tee 0 (i32.const 1)))
|
||||
)
|
||||
|
||||
(func (export "as-unary-operand") (param f32) (result f32)
|
||||
(f32.neg (local.tee 0 (f32.const nan:0x0f1e2)))
|
||||
)
|
||||
|
||||
(func (export "as-binary-left") (param i32) (result i32)
|
||||
(i32.add (local.tee 0 (i32.const 3)) (i32.const 10))
|
||||
)
|
||||
(func (export "as-binary-right") (param i32) (result i32)
|
||||
(i32.sub (i32.const 10) (local.tee 0 (i32.const 4)))
|
||||
)
|
||||
|
||||
(func (export "as-test-operand") (param i32) (result i32)
|
||||
(i32.eqz (local.tee 0 (i32.const 0)))
|
||||
)
|
||||
|
||||
(func (export "as-compare-left") (param i32) (result i32)
|
||||
(i32.le_s (local.tee 0 (i32.const 43)) (i32.const 10))
|
||||
)
|
||||
(func (export "as-compare-right") (param i32) (result i32)
|
||||
(i32.ne (i32.const 10) (local.tee 0 (i32.const 42)))
|
||||
)
|
||||
|
||||
(func (export "as-convert-operand") (param i64) (result i32)
|
||||
(i32.wrap_i64 (local.tee 0 (i64.const 41)))
|
||||
)
|
||||
|
||||
(func (export "as-memory.grow-size") (param i32) (result i32)
|
||||
(memory.grow (local.tee 0 (i32.const 40)))
|
||||
)
|
||||
|
||||
)`);
|
||||
|
||||
// ./test/core/local_tee.wast:280
|
||||
assert_return(() => invoke($0, `type-local-i32`, []), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:281
|
||||
assert_return(() => invoke($0, `type-local-i64`, []), [value("i64", 0n)]);
|
||||
|
||||
// ./test/core/local_tee.wast:282
|
||||
assert_return(() => invoke($0, `type-local-f32`, []), [value("f32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:283
|
||||
assert_return(() => invoke($0, `type-local-f64`, []), [value("f64", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:285
|
||||
assert_return(() => invoke($0, `type-param-i32`, [2]), [value("i32", 10)]);
|
||||
|
||||
// ./test/core/local_tee.wast:286
|
||||
assert_return(() => invoke($0, `type-param-i64`, [3n]), [value("i64", 11n)]);
|
||||
|
||||
// ./test/core/local_tee.wast:287
|
||||
assert_return(() => invoke($0, `type-param-f32`, [value("f32", 4.4)]), [
|
||||
value("f32", 11.1),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:288
|
||||
assert_return(() => invoke($0, `type-param-f64`, [value("f64", 5.5)]), [
|
||||
value("f64", 12.2),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:290
|
||||
assert_return(() => invoke($0, `as-block-first`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:291
|
||||
assert_return(() => invoke($0, `as-block-mid`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:292
|
||||
assert_return(() => invoke($0, `as-block-last`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:294
|
||||
assert_return(() => invoke($0, `as-loop-first`, [0]), [value("i32", 3)]);
|
||||
|
||||
// ./test/core/local_tee.wast:295
|
||||
assert_return(() => invoke($0, `as-loop-mid`, [0]), [value("i32", 4)]);
|
||||
|
||||
// ./test/core/local_tee.wast:296
|
||||
assert_return(() => invoke($0, `as-loop-last`, [0]), [value("i32", 5)]);
|
||||
|
||||
// ./test/core/local_tee.wast:298
|
||||
assert_return(() => invoke($0, `as-br-value`, [0]), [value("i32", 9)]);
|
||||
|
||||
// ./test/core/local_tee.wast:300
|
||||
assert_return(() => invoke($0, `as-br_if-cond`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:301
|
||||
assert_return(() => invoke($0, `as-br_if-value`, [0]), [value("i32", 8)]);
|
||||
|
||||
// ./test/core/local_tee.wast:302
|
||||
assert_return(() => invoke($0, `as-br_if-value-cond`, [0]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/local_tee.wast:304
|
||||
assert_return(() => invoke($0, `as-br_table-index`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:305
|
||||
assert_return(() => invoke($0, `as-br_table-value`, [0]), [value("i32", 10)]);
|
||||
|
||||
// ./test/core/local_tee.wast:306
|
||||
assert_return(() => invoke($0, `as-br_table-value-index`, [0]), [
|
||||
value("i32", 6),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:308
|
||||
assert_return(() => invoke($0, `as-return-value`, [0]), [value("i32", 7)]);
|
||||
|
||||
// ./test/core/local_tee.wast:310
|
||||
assert_return(() => invoke($0, `as-if-cond`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:311
|
||||
assert_return(() => invoke($0, `as-if-then`, [1]), [value("i32", 3)]);
|
||||
|
||||
// ./test/core/local_tee.wast:312
|
||||
assert_return(() => invoke($0, `as-if-else`, [0]), [value("i32", 4)]);
|
||||
|
||||
// ./test/core/local_tee.wast:314
|
||||
assert_return(() => invoke($0, `as-select-first`, [0, 1]), [value("i32", 5)]);
|
||||
|
||||
// ./test/core/local_tee.wast:315
|
||||
assert_return(() => invoke($0, `as-select-second`, [0, 0]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/local_tee.wast:316
|
||||
assert_return(() => invoke($0, `as-select-cond`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:318
|
||||
assert_return(() => invoke($0, `as-call-first`, [0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:319
|
||||
assert_return(() => invoke($0, `as-call-mid`, [0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:320
|
||||
assert_return(() => invoke($0, `as-call-last`, [0]), [value("i32", -1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:322
|
||||
assert_return(() => invoke($0, `as-call_indirect-first`, [0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:323
|
||||
assert_return(() => invoke($0, `as-call_indirect-mid`, [0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:324
|
||||
assert_return(() => invoke($0, `as-call_indirect-last`, [0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:325
|
||||
assert_return(() => invoke($0, `as-call_indirect-index`, [0]), [
|
||||
value("i32", -1),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:327
|
||||
assert_return(() => invoke($0, `as-local.set-value`, []), []);
|
||||
|
||||
// ./test/core/local_tee.wast:328
|
||||
assert_return(() => invoke($0, `as-local.tee-value`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:329
|
||||
assert_return(() => invoke($0, `as-global.set-value`, []), []);
|
||||
|
||||
// ./test/core/local_tee.wast:331
|
||||
assert_return(() => invoke($0, `as-load-address`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:332
|
||||
assert_return(() => invoke($0, `as-loadN-address`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:333
|
||||
assert_return(() => invoke($0, `as-store-address`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:334
|
||||
assert_return(() => invoke($0, `as-store-value`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:335
|
||||
assert_return(() => invoke($0, `as-storeN-address`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:336
|
||||
assert_return(() => invoke($0, `as-storeN-value`, [0]), []);
|
||||
|
||||
// ./test/core/local_tee.wast:338
|
||||
assert_return(() => invoke($0, `as-unary-operand`, [value("f32", 0)]), [
|
||||
bytes("f32", [0xe2, 0xf1, 0x80, 0xff]),
|
||||
]);
|
||||
|
||||
// ./test/core/local_tee.wast:339
|
||||
assert_return(() => invoke($0, `as-binary-left`, [0]), [value("i32", 13)]);
|
||||
|
||||
// ./test/core/local_tee.wast:340
|
||||
assert_return(() => invoke($0, `as-binary-right`, [0]), [value("i32", 6)]);
|
||||
|
||||
// ./test/core/local_tee.wast:341
|
||||
assert_return(() => invoke($0, `as-test-operand`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:342
|
||||
assert_return(() => invoke($0, `as-compare-left`, [0]), [value("i32", 0)]);
|
||||
|
||||
// ./test/core/local_tee.wast:343
|
||||
assert_return(() => invoke($0, `as-compare-right`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:344
|
||||
assert_return(() => invoke($0, `as-convert-operand`, [0n]), [value("i32", 41)]);
|
||||
|
||||
// ./test/core/local_tee.wast:345
|
||||
assert_return(() => invoke($0, `as-memory.grow-size`, [0]), [value("i32", 1)]);
|
||||
|
||||
// ./test/core/local_tee.wast:347
|
||||
assert_return(
|
||||
() =>
|
||||
invoke($0, `type-mixed`, [1n, value("f32", 2.2), value("f64", 3.3), 4, 5]),
|
||||
[],
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:353
|
||||
assert_return(
|
||||
() => invoke($0, `write`, [1n, value("f32", 2), value("f64", 3.3), 4, 5]),
|
||||
[value("i64", 56n)],
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:360
|
||||
assert_return(
|
||||
() =>
|
||||
invoke($0, `result`, [-1n, value("f32", -2), value("f64", -3.3), -4, -5]),
|
||||
[value("f64", 34.8)],
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:370
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (result i64) (local i32) (local.tee 0 (i32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:374
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (local f32) (i32.eqz (local.tee 0 (f32.const 0)))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:378
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-num-vs-num (local f64 i64) (f64.neg (local.tee 1 (i64.const 0)))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:383
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-arg-void-vs-num (local i32) (local.tee 0 (nop))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:387
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-arg-num-vs-num (local i32) (local.tee 0 (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:391
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-arg-num-vs-num (local f32) (local.tee 0 (f64.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:395
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-local-arg-num-vs-num (local f64 i64) (local.tee 1 (f64.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:403
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param i32) (result i64) (local.get 0)))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:407
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:411
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:416
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-arg-void-vs-num (param i32) (local.tee 0 (nop))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:420
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-arg-num-vs-num (param i32) (local.tee 0 (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:424
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-arg-num-vs-num (param f32) (local.tee 0 (f64.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:428
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-param-arg-num-vs-num (param f64 i64) (local.tee 1 (f64.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:433
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num (param i32)
|
||||
(local.tee 0) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:441
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-block (param i32)
|
||||
(i32.const 0)
|
||||
(block (local.tee 0) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:450
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-loop (param i32)
|
||||
(i32.const 0)
|
||||
(loop (local.tee 0) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:459
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-then (param i32)
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (then (local.tee 0) (drop)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:468
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-else (param i32)
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (result i32) (then (i32.const 0)) (else (local.tee 0))) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:477
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-br (param i32)
|
||||
(i32.const 0)
|
||||
(block (br 0 (local.tee 0)) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:486
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-br_if (param i32)
|
||||
(i32.const 0)
|
||||
(block (br_if 0 (local.tee 0) (i32.const 1)) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:495
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-br_table (param i32)
|
||||
(i32.const 0)
|
||||
(block (br_table 0 (local.tee 0)) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:504
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-return (param i32)
|
||||
(return (local.tee 0)) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:512
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-select (param i32)
|
||||
(select (local.tee 0) (i32.const 1) (i32.const 2)) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:520
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-call (param i32)
|
||||
(call 1 (local.tee 0)) (drop)
|
||||
)
|
||||
(func (param i32) (result i32) (local.get 0))
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:529
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$f (param i32) (result i32) (local.get 0))
|
||||
(type $$sig (func (param i32) (result i32)))
|
||||
(table funcref (elem $$f))
|
||||
(func $$type-param-arg-empty-vs-num-in-call_indirect (param i32)
|
||||
(block (result i32)
|
||||
(call_indirect (type $$sig)
|
||||
(local.tee 0) (i32.const 0)
|
||||
)
|
||||
(drop)
|
||||
)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:545
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-local.set (param i32)
|
||||
(local.set 0 (local.tee 0)) (local.get 0) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:553
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(func $$type-param-arg-empty-vs-num-in-local.tee (param i32)
|
||||
(local.tee 0 (local.tee 0)) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:561
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(global $$x (mut i32) (i32.const 0))
|
||||
(func $$type-param-arg-empty-vs-num-in-global.set (param i32)
|
||||
(global.set $$x (local.tee 0)) (global.get $$x) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:570
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-param-arg-empty-vs-num-in-memory.grow (param i32)
|
||||
(memory.grow (local.tee 0)) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:579
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-param-arg-empty-vs-num-in-load (param i32)
|
||||
(i32.load (local.tee 0)) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:588
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-param-arg-empty-vs-num-in-store (param i32)
|
||||
(i32.store (local.tee 0) (i32.const 1))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/local_tee.wast:601
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-local (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:605
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-local (local i32 i64) (local.get 14324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:610
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-param (param i32 i64) (local.get 2)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:614
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-param (local i32 i64) (local.get 714324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:619
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.get 3)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:623
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$large-mixed (param i64) (local i32 i64) (local.get 214324343)))`,
|
||||
),
|
||||
`unknown local`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:628
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-mixed-arg-num-vs-num (param f32) (local i32) (local.tee 1 (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:632
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.tee 1 (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
||||
|
||||
// ./test/core/local_tee.wast:636
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (func $$type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.tee 1 (i64.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
|
@ -517,8 +517,8 @@ assert_return(() => invoke($4, `as-memory.grow-size`, []), [value("i32", 1)]);
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-vs-i32 (result i32)
|
||||
(memory.grow)
|
||||
(func $$type-size-empty
|
||||
(memory.grow) (drop)
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -526,9 +526,9 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-vs-i32-in-block (result i32)
|
||||
(func $$type-size-empty-in-block
|
||||
(i32.const 0)
|
||||
(block (result i32) (memory.grow))
|
||||
(block (memory.grow) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -536,9 +536,9 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-vs-i32-in-loop (result i32)
|
||||
(func $$type-size-empty-in-loop
|
||||
(i32.const 0)
|
||||
(loop (result i32) (memory.grow))
|
||||
(loop (memory.grow) (drop))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
|
@ -546,35 +546,17 @@ assert_invalid(() =>
|
|||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 0)
|
||||
(func $$type-size-empty-vs-i32-in-then (result i32)
|
||||
(func $$type-size-empty-in-then
|
||||
(i32.const 0) (i32.const 0)
|
||||
(if (result i32) (then (memory.grow)))
|
||||
(if (then (memory.grow) (drop)))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:352
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-size-f32-vs-i32 (result i32)
|
||||
(memory.grow (f32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:362
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-result-i32-vs-empty
|
||||
(memory.grow (i32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
|
||||
// ./test/core/memory_grow.wast:371
|
||||
assert_invalid(() =>
|
||||
instantiate(`(module
|
||||
(memory 1)
|
||||
(func $$type-result-i32-vs-f32 (result f32)
|
||||
(memory.grow (i32.const 0))
|
||||
)
|
||||
)`), `type mismatch`);
|
||||
// ./test/core/memory_grow.wast:355
|
||||
assert_invalid(
|
||||
() =>
|
||||
instantiate(
|
||||
`(module (memory 1) (func (result i32) (memory.grow (f32.const 0))))`,
|
||||
),
|
||||
`type mismatch`,
|
||||
);
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче