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

// Hello, future wasm dev. This test will start failing when you add casting
// for func and extern types. When that happens, remove the assertErrorMessage.

assertErrorMessage(() => {
  const { test } = wasmEvalText(`
    (module
      (type $f (func (result i32)))
      (func (export "test") (type $f)
        ref.null $f
        ref.test (ref null $f)
      )
    )
  `).exports;
  assertEq(test(), 1);
}, WebAssembly.CompileError, /ref.test only supports the any hierarchy/);