summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/function-references/disabled.js
blob: 6e67d2ce7fc652254cc9d7969f1074f959fe459f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |jit-test| skip-if: wasmGcEnabled()

const { CompileError, validate } = WebAssembly;

const UNRECOGNIZED_OPCODE_OR_BAD_TYPE = /unrecognized opcode|bad type|gc not enabled/;

let simpleTests = [
    `(module (func (param (ref 0)) (unreachable)))`,
];

// Test that use of function-references fails when function-references is disabled.

for (let src of simpleTests) {
    let bin = wasmTextToBinary(src);
    assertEq(validate(bin), false);
    wasmCompilationShouldFail(bin, UNRECOGNIZED_OPCODE_OR_BAD_TYPE);
}