Debian Codegraph @

js/src/jit-test/tests/wasm/spec/exception-handling/table-sub.wast.js

raw
1 /* Copyright 2021 Mozilla Foundation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 // ./test/core/table-sub.wast
17
18 // ./test/core/table-sub.wast:1
19 assert_invalid(
20 () => instantiate(`(module
21 (table $$t1 10 funcref)
22 (table $$t2 10 externref)
23 (func $$f
24 (table.copy $$t1 $$t2 (i32.const 0) (i32.const 1) (i32.const 2))
25 )
26 )`),
27 `type mismatch`,
28 );
29
30 // ./test/core/table-sub.wast:12
31 assert_invalid(
32 () => instantiate(`(module
33 (table $$t 10 funcref)
34 (elem $$el externref)
35 (func $$f
36 (table.init $$t $$el (i32.const 0) (i32.const 1) (i32.const 2))
37 )
38 )`),
39 `type mismatch`,
40 );