From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- js/src/jit-test/tests/wasm/import-export-sigs.js | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 js/src/jit-test/tests/wasm/import-export-sigs.js (limited to 'js/src/jit-test/tests/wasm/import-export-sigs.js') diff --git a/js/src/jit-test/tests/wasm/import-export-sigs.js b/js/src/jit-test/tests/wasm/import-export-sigs.js new file mode 100644 index 0000000000..8765d56b15 --- /dev/null +++ b/js/src/jit-test/tests/wasm/import-export-sigs.js @@ -0,0 +1,52 @@ +// |jit-test| skip-if: fuzzingSafe() + +// Tests that function imports and function exports descriptors have +// signatures, in the test mode only, for fuzzers. + +var module = new WebAssembly.Module(wasmTextToBinary(`(module + (import "env" "v_v" (func $vv)) + (export "v_v" (func $vv)) + + (import "env" "v_i" (func $vi (param i32))) + (export "v_i" (func $vi)) + + (import "env" "v_I" (func $vI (param i64))) + (export "v_I" (func $vI)) + + (import "env" "v_f" (func $vf (param f32))) + (export "v_f" (func $vf)) + + (import "env" "memory" (memory $mem 0)) + (export "mem" (memory $mem)) + + (import "env" "v_d" (func $vd (param f64))) + (export "v_d" (func $vd)) + + (import "env" "v_fd" (func $vfd (param f32) (param f64))) + (export "v_fd" (func $vfd)) + + (import "env" "v_Ififd" (func $vIfifd (param i64) (param f32) (param i32) (param f32) (param f64))) + (export "v_Ififd" (func $vIfifd)) + + (import "env" "i_v" (func $iv (result i32))) + (export "i_v" (func $iv)) + + (import "env" "I_i" (func $Ii (param i32) (result i64))) + (export "I_i" (func $Ii)) + + (import "env" "table" (table $table 0 funcref)) + (export "table" (table $table)) + + (import "env" "f_d" (func $fd (param f64) (result f32))) + (export "f_d" (func $fd)) + + (import "env" "d_ffd" (func $dffd (param f32) (param f32) (param f64) (result f64))) + (export "d_ffd" (func $dffd)) +)`)); + +for (let desc of WebAssembly.Module.imports(module)) { + assertEq(typeof desc.signature, 'undefined'); +} +for (let desc of WebAssembly.Module.exports(module)) { + assertEq(typeof desc.signature, 'undefined'); +} -- cgit v1.2.3