Debian Codegraph @

js/src/jit-test/tests/wasm/spec/memory64/table_init.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_init.wast
17
18 // ./test/core/table_init.wast:6
19 let $0 = instantiate(`(module
20 (func (export "ef0") (result i32) (i32.const 0))
21 (func (export "ef1") (result i32) (i32.const 1))
22 (func (export "ef2") (result i32) (i32.const 2))
23 (func (export "ef3") (result i32) (i32.const 3))
24 (func (export "ef4") (result i32) (i32.const 4))
25 )`);
26
27 // ./test/core/table_init.wast:13
28 register($0, `a`);
29
30 // ./test/core/table_init.wast:15
31 let $1 = instantiate(`(module
32 (type (func (result i32))) ;; type #0
33 (import "a" "ef0" (func (result i32))) ;; index 0
34 (import "a" "ef1" (func (result i32)))
35 (import "a" "ef2" (func (result i32)))
36 (import "a" "ef3" (func (result i32)))
37 (import "a" "ef4" (func (result i32))) ;; index 4
38 (table $$t0 30 30 funcref)
39 (table $$t1 30 30 funcref)
40 (table $$t2 i64 30 30 funcref)
41 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
42 (elem funcref
43 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
44 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
45 (elem funcref
46 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
47 (func (result i32) (i32.const 5)) ;; index 5
48 (func (result i32) (i32.const 6))
49 (func (result i32) (i32.const 7))
50 (func (result i32) (i32.const 8))
51 (func (result i32) (i32.const 9)) ;; index 9
52 (func (export "test")
53 (table.init $$t0 1 (i32.const 7) (i32.const 0) (i32.const 4)))
54 (func (export "check") (param i32) (result i32)
55 (call_indirect $$t0 (type 0) (local.get 0)))
56 )`);
57
58 // ./test/core/table_init.wast:42
59 invoke($1, `test`, []);
60
61 // ./test/core/table_init.wast:43
62 assert_trap(() => invoke($1, `check`, [0]), `uninitialized element`);
63
64 // ./test/core/table_init.wast:44
65 assert_trap(() => invoke($1, `check`, [1]), `uninitialized element`);
66
67 // ./test/core/table_init.wast:45
68 assert_return(() => invoke($1, `check`, [2]), [value("i32", 3)]);
69
70 // ./test/core/table_init.wast:46
71 assert_return(() => invoke($1, `check`, [3]), [value("i32", 1)]);
72
73 // ./test/core/table_init.wast:47
74 assert_return(() => invoke($1, `check`, [4]), [value("i32", 4)]);
75
76 // ./test/core/table_init.wast:48
77 assert_return(() => invoke($1, `check`, [5]), [value("i32", 1)]);
78
79 // ./test/core/table_init.wast:49
80 assert_trap(() => invoke($1, `check`, [6]), `uninitialized element`);
81
82 // ./test/core/table_init.wast:50
83 assert_return(() => invoke($1, `check`, [7]), [value("i32", 2)]);
84
85 // ./test/core/table_init.wast:51
86 assert_return(() => invoke($1, `check`, [8]), [value("i32", 7)]);
87
88 // ./test/core/table_init.wast:52
89 assert_return(() => invoke($1, `check`, [9]), [value("i32", 1)]);
90
91 // ./test/core/table_init.wast:53
92 assert_return(() => invoke($1, `check`, [10]), [value("i32", 8)]);
93
94 // ./test/core/table_init.wast:54
95 assert_trap(() => invoke($1, `check`, [11]), `uninitialized element`);
96
97 // ./test/core/table_init.wast:55
98 assert_return(() => invoke($1, `check`, [12]), [value("i32", 7)]);
99
100 // ./test/core/table_init.wast:56
101 assert_return(() => invoke($1, `check`, [13]), [value("i32", 5)]);
102
103 // ./test/core/table_init.wast:57
104 assert_return(() => invoke($1, `check`, [14]), [value("i32", 2)]);
105
106 // ./test/core/table_init.wast:58
107 assert_return(() => invoke($1, `check`, [15]), [value("i32", 3)]);
108
109 // ./test/core/table_init.wast:59
110 assert_return(() => invoke($1, `check`, [16]), [value("i32", 6)]);
111
112 // ./test/core/table_init.wast:60
113 assert_trap(() => invoke($1, `check`, [17]), `uninitialized element`);
114
115 // ./test/core/table_init.wast:61
116 assert_trap(() => invoke($1, `check`, [18]), `uninitialized element`);
117
118 // ./test/core/table_init.wast:62
119 assert_trap(() => invoke($1, `check`, [19]), `uninitialized element`);
120
121 // ./test/core/table_init.wast:63
122 assert_trap(() => invoke($1, `check`, [20]), `uninitialized element`);
123
124 // ./test/core/table_init.wast:64
125 assert_trap(() => invoke($1, `check`, [21]), `uninitialized element`);
126
127 // ./test/core/table_init.wast:65
128 assert_trap(() => invoke($1, `check`, [22]), `uninitialized element`);
129
130 // ./test/core/table_init.wast:66
131 assert_trap(() => invoke($1, `check`, [23]), `uninitialized element`);
132
133 // ./test/core/table_init.wast:67
134 assert_trap(() => invoke($1, `check`, [24]), `uninitialized element`);
135
136 // ./test/core/table_init.wast:68
137 assert_trap(() => invoke($1, `check`, [25]), `uninitialized element`);
138
139 // ./test/core/table_init.wast:69
140 assert_trap(() => invoke($1, `check`, [26]), `uninitialized element`);
141
142 // ./test/core/table_init.wast:70
143 assert_trap(() => invoke($1, `check`, [27]), `uninitialized element`);
144
145 // ./test/core/table_init.wast:71
146 assert_trap(() => invoke($1, `check`, [28]), `uninitialized element`);
147
148 // ./test/core/table_init.wast:72
149 assert_trap(() => invoke($1, `check`, [29]), `uninitialized element`);
150
151 // ./test/core/table_init.wast:74
152 let $2 = instantiate(`(module
153 (type (func (result i32))) ;; type #0
154 (import "a" "ef0" (func (result i32))) ;; index 0
155 (import "a" "ef1" (func (result i32)))
156 (import "a" "ef2" (func (result i32)))
157 (import "a" "ef3" (func (result i32)))
158 (import "a" "ef4" (func (result i32))) ;; index 4
159 (table $$t0 30 30 funcref)
160 (table $$t1 30 30 funcref)
161 (table $$t2 i64 30 30 funcref)
162 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
163 (elem funcref
164 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
165 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
166 (elem funcref
167 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
168 (func (result i32) (i32.const 5)) ;; index 5
169 (func (result i32) (i32.const 6))
170 (func (result i32) (i32.const 7))
171 (func (result i32) (i32.const 8))
172 (func (result i32) (i32.const 9)) ;; index 9
173 (func (export "test")
174 (table.init $$t0 3 (i32.const 15) (i32.const 1) (i32.const 3)))
175 (func (export "check") (param i32) (result i32)
176 (call_indirect $$t0 (type 0) (local.get 0)))
177 )`);
178
179 // ./test/core/table_init.wast:101
180 invoke($2, `test`, []);
181
182 // ./test/core/table_init.wast:102
183 assert_trap(() => invoke($2, `check`, [0]), `uninitialized element`);
184
185 // ./test/core/table_init.wast:103
186 assert_trap(() => invoke($2, `check`, [1]), `uninitialized element`);
187
188 // ./test/core/table_init.wast:104
189 assert_return(() => invoke($2, `check`, [2]), [value("i32", 3)]);
190
191 // ./test/core/table_init.wast:105
192 assert_return(() => invoke($2, `check`, [3]), [value("i32", 1)]);
193
194 // ./test/core/table_init.wast:106
195 assert_return(() => invoke($2, `check`, [4]), [value("i32", 4)]);
196
197 // ./test/core/table_init.wast:107
198 assert_return(() => invoke($2, `check`, [5]), [value("i32", 1)]);
199
200 // ./test/core/table_init.wast:108
201 assert_trap(() => invoke($2, `check`, [6]), `uninitialized element`);
202
203 // ./test/core/table_init.wast:109
204 assert_trap(() => invoke($2, `check`, [7]), `uninitialized element`);
205
206 // ./test/core/table_init.wast:110
207 assert_trap(() => invoke($2, `check`, [8]), `uninitialized element`);
208
209 // ./test/core/table_init.wast:111
210 assert_trap(() => invoke($2, `check`, [9]), `uninitialized element`);
211
212 // ./test/core/table_init.wast:112
213 assert_trap(() => invoke($2, `check`, [10]), `uninitialized element`);
214
215 // ./test/core/table_init.wast:113
216 assert_trap(() => invoke($2, `check`, [11]), `uninitialized element`);
217
218 // ./test/core/table_init.wast:114
219 assert_return(() => invoke($2, `check`, [12]), [value("i32", 7)]);
220
221 // ./test/core/table_init.wast:115
222 assert_return(() => invoke($2, `check`, [13]), [value("i32", 5)]);
223
224 // ./test/core/table_init.wast:116
225 assert_return(() => invoke($2, `check`, [14]), [value("i32", 2)]);
226
227 // ./test/core/table_init.wast:117
228 assert_return(() => invoke($2, `check`, [15]), [value("i32", 9)]);
229
230 // ./test/core/table_init.wast:118
231 assert_return(() => invoke($2, `check`, [16]), [value("i32", 2)]);
232
233 // ./test/core/table_init.wast:119
234 assert_return(() => invoke($2, `check`, [17]), [value("i32", 7)]);
235
236 // ./test/core/table_init.wast:120
237 assert_trap(() => invoke($2, `check`, [18]), `uninitialized element`);
238
239 // ./test/core/table_init.wast:121
240 assert_trap(() => invoke($2, `check`, [19]), `uninitialized element`);
241
242 // ./test/core/table_init.wast:122
243 assert_trap(() => invoke($2, `check`, [20]), `uninitialized element`);
244
245 // ./test/core/table_init.wast:123
246 assert_trap(() => invoke($2, `check`, [21]), `uninitialized element`);
247
248 // ./test/core/table_init.wast:124
249 assert_trap(() => invoke($2, `check`, [22]), `uninitialized element`);
250
251 // ./test/core/table_init.wast:125
252 assert_trap(() => invoke($2, `check`, [23]), `uninitialized element`);
253
254 // ./test/core/table_init.wast:126
255 assert_trap(() => invoke($2, `check`, [24]), `uninitialized element`);
256
257 // ./test/core/table_init.wast:127
258 assert_trap(() => invoke($2, `check`, [25]), `uninitialized element`);
259
260 // ./test/core/table_init.wast:128
261 assert_trap(() => invoke($2, `check`, [26]), `uninitialized element`);
262
263 // ./test/core/table_init.wast:129
264 assert_trap(() => invoke($2, `check`, [27]), `uninitialized element`);
265
266 // ./test/core/table_init.wast:130
267 assert_trap(() => invoke($2, `check`, [28]), `uninitialized element`);
268
269 // ./test/core/table_init.wast:131
270 assert_trap(() => invoke($2, `check`, [29]), `uninitialized element`);
271
272 // ./test/core/table_init.wast:133
273 let $3 = instantiate(`(module
274 (type (func (result i32))) ;; type #0
275 (import "a" "ef0" (func (result i32))) ;; index 0
276 (import "a" "ef1" (func (result i32)))
277 (import "a" "ef2" (func (result i32)))
278 (import "a" "ef3" (func (result i32)))
279 (import "a" "ef4" (func (result i32))) ;; index 4
280 (table $$t0 30 30 funcref)
281 (table $$t1 30 30 funcref)
282 (table $$t2 i64 30 30 funcref)
283 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
284 (elem funcref
285 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
286 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
287 (elem funcref
288 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
289 (func (result i32) (i32.const 5)) ;; index 5
290 (func (result i32) (i32.const 6))
291 (func (result i32) (i32.const 7))
292 (func (result i32) (i32.const 8))
293 (func (result i32) (i32.const 9)) ;; index 9
294 (func (export "test")
295 (table.init $$t0 1 (i32.const 7) (i32.const 0) (i32.const 4))
296 (elem.drop 1)
297 (table.init $$t0 3 (i32.const 15) (i32.const 1) (i32.const 3))
298 (elem.drop 3)
299 (table.copy $$t0 0 (i32.const 20) (i32.const 15) (i32.const 5))
300 (table.copy $$t0 0 (i32.const 21) (i32.const 29) (i32.const 1))
301 (table.copy $$t0 0 (i32.const 24) (i32.const 10) (i32.const 1))
302 (table.copy $$t0 0 (i32.const 13) (i32.const 11) (i32.const 4))
303 (table.copy $$t0 0 (i32.const 19) (i32.const 20) (i32.const 5)))
304 (func (export "check") (param i32) (result i32)
305 (call_indirect $$t0 (type 0) (local.get 0)))
306 )`);
307
308 // ./test/core/table_init.wast:168
309 invoke($3, `test`, []);
310
311 // ./test/core/table_init.wast:169
312 assert_trap(() => invoke($3, `check`, [0]), `uninitialized element`);
313
314 // ./test/core/table_init.wast:170
315 assert_trap(() => invoke($3, `check`, [1]), `uninitialized element`);
316
317 // ./test/core/table_init.wast:171
318 assert_return(() => invoke($3, `check`, [2]), [value("i32", 3)]);
319
320 // ./test/core/table_init.wast:172
321 assert_return(() => invoke($3, `check`, [3]), [value("i32", 1)]);
322
323 // ./test/core/table_init.wast:173
324 assert_return(() => invoke($3, `check`, [4]), [value("i32", 4)]);
325
326 // ./test/core/table_init.wast:174
327 assert_return(() => invoke($3, `check`, [5]), [value("i32", 1)]);
328
329 // ./test/core/table_init.wast:175
330 assert_trap(() => invoke($3, `check`, [6]), `uninitialized element`);
331
332 // ./test/core/table_init.wast:176
333 assert_return(() => invoke($3, `check`, [7]), [value("i32", 2)]);
334
335 // ./test/core/table_init.wast:177
336 assert_return(() => invoke($3, `check`, [8]), [value("i32", 7)]);
337
338 // ./test/core/table_init.wast:178
339 assert_return(() => invoke($3, `check`, [9]), [value("i32", 1)]);
340
341 // ./test/core/table_init.wast:179
342 assert_return(() => invoke($3, `check`, [10]), [value("i32", 8)]);
343
344 // ./test/core/table_init.wast:180
345 assert_trap(() => invoke($3, `check`, [11]), `uninitialized element`);
346
347 // ./test/core/table_init.wast:181
348 assert_return(() => invoke($3, `check`, [12]), [value("i32", 7)]);
349
350 // ./test/core/table_init.wast:182
351 assert_trap(() => invoke($3, `check`, [13]), `uninitialized element`);
352
353 // ./test/core/table_init.wast:183
354 assert_return(() => invoke($3, `check`, [14]), [value("i32", 7)]);
355
356 // ./test/core/table_init.wast:184
357 assert_return(() => invoke($3, `check`, [15]), [value("i32", 5)]);
358
359 // ./test/core/table_init.wast:185
360 assert_return(() => invoke($3, `check`, [16]), [value("i32", 2)]);
361
362 // ./test/core/table_init.wast:186
363 assert_return(() => invoke($3, `check`, [17]), [value("i32", 7)]);
364
365 // ./test/core/table_init.wast:187
366 assert_trap(() => invoke($3, `check`, [18]), `uninitialized element`);
367
368 // ./test/core/table_init.wast:188
369 assert_return(() => invoke($3, `check`, [19]), [value("i32", 9)]);
370
371 // ./test/core/table_init.wast:189
372 assert_trap(() => invoke($3, `check`, [20]), `uninitialized element`);
373
374 // ./test/core/table_init.wast:190
375 assert_return(() => invoke($3, `check`, [21]), [value("i32", 7)]);
376
377 // ./test/core/table_init.wast:191
378 assert_trap(() => invoke($3, `check`, [22]), `uninitialized element`);
379
380 // ./test/core/table_init.wast:192
381 assert_return(() => invoke($3, `check`, [23]), [value("i32", 8)]);
382
383 // ./test/core/table_init.wast:193
384 assert_return(() => invoke($3, `check`, [24]), [value("i32", 8)]);
385
386 // ./test/core/table_init.wast:194
387 assert_trap(() => invoke($3, `check`, [25]), `uninitialized element`);
388
389 // ./test/core/table_init.wast:195
390 assert_trap(() => invoke($3, `check`, [26]), `uninitialized element`);
391
392 // ./test/core/table_init.wast:196
393 assert_trap(() => invoke($3, `check`, [27]), `uninitialized element`);
394
395 // ./test/core/table_init.wast:197
396 assert_trap(() => invoke($3, `check`, [28]), `uninitialized element`);
397
398 // ./test/core/table_init.wast:198
399 assert_trap(() => invoke($3, `check`, [29]), `uninitialized element`);
400
401 // ./test/core/table_init.wast:200
402 let $4 = instantiate(`(module
403 (type (func (result i32))) ;; type #0
404 (import "a" "ef0" (func (result i32))) ;; index 0
405 (import "a" "ef1" (func (result i32)))
406 (import "a" "ef2" (func (result i32)))
407 (import "a" "ef3" (func (result i32)))
408 (import "a" "ef4" (func (result i32))) ;; index 4
409 (table $$t0 30 30 funcref)
410 (table $$t1 30 30 funcref)
411 (table $$t2 i64 30 30 funcref)
412 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
413 (elem funcref
414 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
415 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
416 (elem funcref
417 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
418 (func (result i32) (i32.const 5)) ;; index 5
419 (func (result i32) (i32.const 6))
420 (func (result i32) (i32.const 7))
421 (func (result i32) (i32.const 8))
422 (func (result i32) (i32.const 9)) ;; index 9
423 (func (export "test")
424 (table.init $$t1 1 (i32.const 7) (i32.const 0) (i32.const 4)))
425 (func (export "check") (param i32) (result i32)
426 (call_indirect $$t1 (type 0) (local.get 0)))
427 )`);
428
429 // ./test/core/table_init.wast:227
430 invoke($4, `test`, []);
431
432 // ./test/core/table_init.wast:228
433 assert_trap(() => invoke($4, `check`, [0]), `uninitialized element`);
434
435 // ./test/core/table_init.wast:229
436 assert_trap(() => invoke($4, `check`, [1]), `uninitialized element`);
437
438 // ./test/core/table_init.wast:230
439 assert_return(() => invoke($4, `check`, [2]), [value("i32", 3)]);
440
441 // ./test/core/table_init.wast:231
442 assert_return(() => invoke($4, `check`, [3]), [value("i32", 1)]);
443
444 // ./test/core/table_init.wast:232
445 assert_return(() => invoke($4, `check`, [4]), [value("i32", 4)]);
446
447 // ./test/core/table_init.wast:233
448 assert_return(() => invoke($4, `check`, [5]), [value("i32", 1)]);
449
450 // ./test/core/table_init.wast:234
451 assert_trap(() => invoke($4, `check`, [6]), `uninitialized element`);
452
453 // ./test/core/table_init.wast:235
454 assert_return(() => invoke($4, `check`, [7]), [value("i32", 2)]);
455
456 // ./test/core/table_init.wast:236
457 assert_return(() => invoke($4, `check`, [8]), [value("i32", 7)]);
458
459 // ./test/core/table_init.wast:237
460 assert_return(() => invoke($4, `check`, [9]), [value("i32", 1)]);
461
462 // ./test/core/table_init.wast:238
463 assert_return(() => invoke($4, `check`, [10]), [value("i32", 8)]);
464
465 // ./test/core/table_init.wast:239
466 assert_trap(() => invoke($4, `check`, [11]), `uninitialized element`);
467
468 // ./test/core/table_init.wast:240
469 assert_return(() => invoke($4, `check`, [12]), [value("i32", 7)]);
470
471 // ./test/core/table_init.wast:241
472 assert_return(() => invoke($4, `check`, [13]), [value("i32", 5)]);
473
474 // ./test/core/table_init.wast:242
475 assert_return(() => invoke($4, `check`, [14]), [value("i32", 2)]);
476
477 // ./test/core/table_init.wast:243
478 assert_return(() => invoke($4, `check`, [15]), [value("i32", 3)]);
479
480 // ./test/core/table_init.wast:244
481 assert_return(() => invoke($4, `check`, [16]), [value("i32", 6)]);
482
483 // ./test/core/table_init.wast:245
484 assert_trap(() => invoke($4, `check`, [17]), `uninitialized element`);
485
486 // ./test/core/table_init.wast:246
487 assert_trap(() => invoke($4, `check`, [18]), `uninitialized element`);
488
489 // ./test/core/table_init.wast:247
490 assert_trap(() => invoke($4, `check`, [19]), `uninitialized element`);
491
492 // ./test/core/table_init.wast:248
493 assert_trap(() => invoke($4, `check`, [20]), `uninitialized element`);
494
495 // ./test/core/table_init.wast:249
496 assert_trap(() => invoke($4, `check`, [21]), `uninitialized element`);
497
498 // ./test/core/table_init.wast:250
499 assert_trap(() => invoke($4, `check`, [22]), `uninitialized element`);
500
501 // ./test/core/table_init.wast:251
502 assert_trap(() => invoke($4, `check`, [23]), `uninitialized element`);
503
504 // ./test/core/table_init.wast:252
505 assert_trap(() => invoke($4, `check`, [24]), `uninitialized element`);
506
507 // ./test/core/table_init.wast:253
508 assert_trap(() => invoke($4, `check`, [25]), `uninitialized element`);
509
510 // ./test/core/table_init.wast:254
511 assert_trap(() => invoke($4, `check`, [26]), `uninitialized element`);
512
513 // ./test/core/table_init.wast:255
514 assert_trap(() => invoke($4, `check`, [27]), `uninitialized element`);
515
516 // ./test/core/table_init.wast:256
517 assert_trap(() => invoke($4, `check`, [28]), `uninitialized element`);
518
519 // ./test/core/table_init.wast:257
520 assert_trap(() => invoke($4, `check`, [29]), `uninitialized element`);
521
522 // ./test/core/table_init.wast:259
523 let $5 = instantiate(`(module
524 (type (func (result i32))) ;; type #0
525 (import "a" "ef0" (func (result i32))) ;; index 0
526 (import "a" "ef1" (func (result i32)))
527 (import "a" "ef2" (func (result i32)))
528 (import "a" "ef3" (func (result i32)))
529 (import "a" "ef4" (func (result i32))) ;; index 4
530 (table $$t0 30 30 funcref)
531 (table $$t1 30 30 funcref)
532 (table $$t2 i64 30 30 funcref)
533 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
534 (elem funcref
535 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
536 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
537 (elem funcref
538 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
539 (func (result i32) (i32.const 5)) ;; index 5
540 (func (result i32) (i32.const 6))
541 (func (result i32) (i32.const 7))
542 (func (result i32) (i32.const 8))
543 (func (result i32) (i32.const 9)) ;; index 9
544 (func (export "test")
545 (table.init $$t1 3 (i32.const 15) (i32.const 1) (i32.const 3)))
546 (func (export "check") (param i32) (result i32)
547 (call_indirect $$t1 (type 0) (local.get 0)))
548 )`);
549
550 // ./test/core/table_init.wast:286
551 invoke($5, `test`, []);
552
553 // ./test/core/table_init.wast:287
554 assert_trap(() => invoke($5, `check`, [0]), `uninitialized element`);
555
556 // ./test/core/table_init.wast:288
557 assert_trap(() => invoke($5, `check`, [1]), `uninitialized element`);
558
559 // ./test/core/table_init.wast:289
560 assert_return(() => invoke($5, `check`, [2]), [value("i32", 3)]);
561
562 // ./test/core/table_init.wast:290
563 assert_return(() => invoke($5, `check`, [3]), [value("i32", 1)]);
564
565 // ./test/core/table_init.wast:291
566 assert_return(() => invoke($5, `check`, [4]), [value("i32", 4)]);
567
568 // ./test/core/table_init.wast:292
569 assert_return(() => invoke($5, `check`, [5]), [value("i32", 1)]);
570
571 // ./test/core/table_init.wast:293
572 assert_trap(() => invoke($5, `check`, [6]), `uninitialized element`);
573
574 // ./test/core/table_init.wast:294
575 assert_trap(() => invoke($5, `check`, [7]), `uninitialized element`);
576
577 // ./test/core/table_init.wast:295
578 assert_trap(() => invoke($5, `check`, [8]), `uninitialized element`);
579
580 // ./test/core/table_init.wast:296
581 assert_trap(() => invoke($5, `check`, [9]), `uninitialized element`);
582
583 // ./test/core/table_init.wast:297
584 assert_trap(() => invoke($5, `check`, [10]), `uninitialized element`);
585
586 // ./test/core/table_init.wast:298
587 assert_trap(() => invoke($5, `check`, [11]), `uninitialized element`);
588
589 // ./test/core/table_init.wast:299
590 assert_return(() => invoke($5, `check`, [12]), [value("i32", 7)]);
591
592 // ./test/core/table_init.wast:300
593 assert_return(() => invoke($5, `check`, [13]), [value("i32", 5)]);
594
595 // ./test/core/table_init.wast:301
596 assert_return(() => invoke($5, `check`, [14]), [value("i32", 2)]);
597
598 // ./test/core/table_init.wast:302
599 assert_return(() => invoke($5, `check`, [15]), [value("i32", 9)]);
600
601 // ./test/core/table_init.wast:303
602 assert_return(() => invoke($5, `check`, [16]), [value("i32", 2)]);
603
604 // ./test/core/table_init.wast:304
605 assert_return(() => invoke($5, `check`, [17]), [value("i32", 7)]);
606
607 // ./test/core/table_init.wast:305
608 assert_trap(() => invoke($5, `check`, [18]), `uninitialized element`);
609
610 // ./test/core/table_init.wast:306
611 assert_trap(() => invoke($5, `check`, [19]), `uninitialized element`);
612
613 // ./test/core/table_init.wast:307
614 assert_trap(() => invoke($5, `check`, [20]), `uninitialized element`);
615
616 // ./test/core/table_init.wast:308
617 assert_trap(() => invoke($5, `check`, [21]), `uninitialized element`);
618
619 // ./test/core/table_init.wast:309
620 assert_trap(() => invoke($5, `check`, [22]), `uninitialized element`);
621
622 // ./test/core/table_init.wast:310
623 assert_trap(() => invoke($5, `check`, [23]), `uninitialized element`);
624
625 // ./test/core/table_init.wast:311
626 assert_trap(() => invoke($5, `check`, [24]), `uninitialized element`);
627
628 // ./test/core/table_init.wast:312
629 assert_trap(() => invoke($5, `check`, [25]), `uninitialized element`);
630
631 // ./test/core/table_init.wast:313
632 assert_trap(() => invoke($5, `check`, [26]), `uninitialized element`);
633
634 // ./test/core/table_init.wast:314
635 assert_trap(() => invoke($5, `check`, [27]), `uninitialized element`);
636
637 // ./test/core/table_init.wast:315
638 assert_trap(() => invoke($5, `check`, [28]), `uninitialized element`);
639
640 // ./test/core/table_init.wast:316
641 assert_trap(() => invoke($5, `check`, [29]), `uninitialized element`);
642
643 // ./test/core/table_init.wast:318
644 let $6 = instantiate(`(module
645 (type (func (result i32))) ;; type #0
646 (import "a" "ef0" (func (result i32))) ;; index 0
647 (import "a" "ef1" (func (result i32)))
648 (import "a" "ef2" (func (result i32)))
649 (import "a" "ef3" (func (result i32)))
650 (import "a" "ef4" (func (result i32))) ;; index 4
651 (table $$t0 30 30 funcref)
652 (table $$t1 30 30 funcref)
653 (table $$t2 i64 30 30 funcref)
654 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
655 (elem funcref
656 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
657 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
658 (elem funcref
659 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
660 (func (result i32) (i32.const 5)) ;; index 5
661 (func (result i32) (i32.const 6))
662 (func (result i32) (i32.const 7))
663 (func (result i32) (i32.const 8))
664 (func (result i32) (i32.const 9)) ;; index 9
665 (func (export "test")
666 (table.init $$t1 1 (i32.const 7) (i32.const 0) (i32.const 4))
667 (elem.drop 1)
668 (table.init $$t1 3 (i32.const 15) (i32.const 1) (i32.const 3))
669 (elem.drop 3)
670 (table.copy $$t1 1 (i32.const 20) (i32.const 15) (i32.const 5))
671 (table.copy $$t1 1 (i32.const 21) (i32.const 29) (i32.const 1))
672 (table.copy $$t1 1 (i32.const 24) (i32.const 10) (i32.const 1))
673 (table.copy $$t1 1 (i32.const 13) (i32.const 11) (i32.const 4))
674 (table.copy $$t1 1 (i32.const 19) (i32.const 20) (i32.const 5)))
675 (func (export "check") (param i32) (result i32)
676 (call_indirect $$t1 (type 0) (local.get 0)))
677 )`);
678
679 // ./test/core/table_init.wast:353
680 invoke($6, `test`, []);
681
682 // ./test/core/table_init.wast:354
683 assert_trap(() => invoke($6, `check`, [0]), `uninitialized element`);
684
685 // ./test/core/table_init.wast:355
686 assert_trap(() => invoke($6, `check`, [1]), `uninitialized element`);
687
688 // ./test/core/table_init.wast:356
689 assert_return(() => invoke($6, `check`, [2]), [value("i32", 3)]);
690
691 // ./test/core/table_init.wast:357
692 assert_return(() => invoke($6, `check`, [3]), [value("i32", 1)]);
693
694 // ./test/core/table_init.wast:358
695 assert_return(() => invoke($6, `check`, [4]), [value("i32", 4)]);
696
697 // ./test/core/table_init.wast:359
698 assert_return(() => invoke($6, `check`, [5]), [value("i32", 1)]);
699
700 // ./test/core/table_init.wast:360
701 assert_trap(() => invoke($6, `check`, [6]), `uninitialized element`);
702
703 // ./test/core/table_init.wast:361
704 assert_return(() => invoke($6, `check`, [7]), [value("i32", 2)]);
705
706 // ./test/core/table_init.wast:362
707 assert_return(() => invoke($6, `check`, [8]), [value("i32", 7)]);
708
709 // ./test/core/table_init.wast:363
710 assert_return(() => invoke($6, `check`, [9]), [value("i32", 1)]);
711
712 // ./test/core/table_init.wast:364
713 assert_return(() => invoke($6, `check`, [10]), [value("i32", 8)]);
714
715 // ./test/core/table_init.wast:365
716 assert_trap(() => invoke($6, `check`, [11]), `uninitialized element`);
717
718 // ./test/core/table_init.wast:366
719 assert_return(() => invoke($6, `check`, [12]), [value("i32", 7)]);
720
721 // ./test/core/table_init.wast:367
722 assert_trap(() => invoke($6, `check`, [13]), `uninitialized element`);
723
724 // ./test/core/table_init.wast:368
725 assert_return(() => invoke($6, `check`, [14]), [value("i32", 7)]);
726
727 // ./test/core/table_init.wast:369
728 assert_return(() => invoke($6, `check`, [15]), [value("i32", 5)]);
729
730 // ./test/core/table_init.wast:370
731 assert_return(() => invoke($6, `check`, [16]), [value("i32", 2)]);
732
733 // ./test/core/table_init.wast:371
734 assert_return(() => invoke($6, `check`, [17]), [value("i32", 7)]);
735
736 // ./test/core/table_init.wast:372
737 assert_trap(() => invoke($6, `check`, [18]), `uninitialized element`);
738
739 // ./test/core/table_init.wast:373
740 assert_return(() => invoke($6, `check`, [19]), [value("i32", 9)]);
741
742 // ./test/core/table_init.wast:374
743 assert_trap(() => invoke($6, `check`, [20]), `uninitialized element`);
744
745 // ./test/core/table_init.wast:375
746 assert_return(() => invoke($6, `check`, [21]), [value("i32", 7)]);
747
748 // ./test/core/table_init.wast:376
749 assert_trap(() => invoke($6, `check`, [22]), `uninitialized element`);
750
751 // ./test/core/table_init.wast:377
752 assert_return(() => invoke($6, `check`, [23]), [value("i32", 8)]);
753
754 // ./test/core/table_init.wast:378
755 assert_return(() => invoke($6, `check`, [24]), [value("i32", 8)]);
756
757 // ./test/core/table_init.wast:379
758 assert_trap(() => invoke($6, `check`, [25]), `uninitialized element`);
759
760 // ./test/core/table_init.wast:380
761 assert_trap(() => invoke($6, `check`, [26]), `uninitialized element`);
762
763 // ./test/core/table_init.wast:381
764 assert_trap(() => invoke($6, `check`, [27]), `uninitialized element`);
765
766 // ./test/core/table_init.wast:382
767 assert_trap(() => invoke($6, `check`, [28]), `uninitialized element`);
768
769 // ./test/core/table_init.wast:383
770 assert_trap(() => invoke($6, `check`, [29]), `uninitialized element`);
771
772 // ./test/core/table_init.wast:385
773 let $7 = instantiate(`(module
774 (type (func (result i32))) ;; type #0
775 (import "a" "ef0" (func (result i32))) ;; index 0
776 (import "a" "ef1" (func (result i32)))
777 (import "a" "ef2" (func (result i32)))
778 (import "a" "ef3" (func (result i32)))
779 (import "a" "ef4" (func (result i32))) ;; index 4
780 (table $$t0 30 30 funcref)
781 (table $$t1 30 30 funcref)
782 (table $$t2 i64 30 30 funcref)
783 (elem (table $$t2) (i64.const 2) func 3 1 4 1)
784 (elem funcref
785 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
786 (elem (table $$t2) (i64.const 12) func 7 5 2 3 6)
787 (elem funcref
788 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
789 (func (result i32) (i32.const 5)) ;; index 5
790 (func (result i32) (i32.const 6))
791 (func (result i32) (i32.const 7))
792 (func (result i32) (i32.const 8))
793 (func (result i32) (i32.const 9)) ;; index 9
794 (func (export "test")
795 (table.init $$t2 1 (i64.const 7) (i32.const 0) (i32.const 4)))
796 (func (export "check") (param i64) (result i32)
797 (call_indirect $$t2 (type 0) (local.get 0)))
798 )`);
799
800 // ./test/core/table_init.wast:412
801 invoke($7, `test`, []);
802
803 // ./test/core/table_init.wast:413
804 assert_trap(() => invoke($7, `check`, [0n]), `uninitialized element`);
805
806 // ./test/core/table_init.wast:414
807 assert_trap(() => invoke($7, `check`, [1n]), `uninitialized element`);
808
809 // ./test/core/table_init.wast:415
810 assert_return(() => invoke($7, `check`, [2n]), [value("i32", 3)]);
811
812 // ./test/core/table_init.wast:416
813 assert_return(() => invoke($7, `check`, [3n]), [value("i32", 1)]);
814
815 // ./test/core/table_init.wast:417
816 assert_return(() => invoke($7, `check`, [4n]), [value("i32", 4)]);
817
818 // ./test/core/table_init.wast:418
819 assert_return(() => invoke($7, `check`, [5n]), [value("i32", 1)]);
820
821 // ./test/core/table_init.wast:419
822 assert_trap(() => invoke($7, `check`, [6n]), `uninitialized element`);
823
824 // ./test/core/table_init.wast:420
825 assert_return(() => invoke($7, `check`, [7n]), [value("i32", 2)]);
826
827 // ./test/core/table_init.wast:421
828 assert_return(() => invoke($7, `check`, [8n]), [value("i32", 7)]);
829
830 // ./test/core/table_init.wast:422
831 assert_return(() => invoke($7, `check`, [9n]), [value("i32", 1)]);
832
833 // ./test/core/table_init.wast:423
834 assert_return(() => invoke($7, `check`, [10n]), [value("i32", 8)]);
835
836 // ./test/core/table_init.wast:424
837 assert_trap(() => invoke($7, `check`, [11n]), `uninitialized element`);
838
839 // ./test/core/table_init.wast:425
840 assert_return(() => invoke($7, `check`, [12n]), [value("i32", 7)]);
841
842 // ./test/core/table_init.wast:426
843 assert_return(() => invoke($7, `check`, [13n]), [value("i32", 5)]);
844
845 // ./test/core/table_init.wast:427
846 assert_return(() => invoke($7, `check`, [14n]), [value("i32", 2)]);
847
848 // ./test/core/table_init.wast:428
849 assert_return(() => invoke($7, `check`, [15n]), [value("i32", 3)]);
850
851 // ./test/core/table_init.wast:429
852 assert_return(() => invoke($7, `check`, [16n]), [value("i32", 6)]);
853
854 // ./test/core/table_init.wast:430
855 assert_trap(() => invoke($7, `check`, [17n]), `uninitialized element`);
856
857 // ./test/core/table_init.wast:431
858 assert_trap(() => invoke($7, `check`, [18n]), `uninitialized element`);
859
860 // ./test/core/table_init.wast:432
861 assert_trap(() => invoke($7, `check`, [19n]), `uninitialized element`);
862
863 // ./test/core/table_init.wast:433
864 assert_trap(() => invoke($7, `check`, [20n]), `uninitialized element`);
865
866 // ./test/core/table_init.wast:434
867 assert_trap(() => invoke($7, `check`, [21n]), `uninitialized element`);
868
869 // ./test/core/table_init.wast:435
870 assert_trap(() => invoke($7, `check`, [22n]), `uninitialized element`);
871
872 // ./test/core/table_init.wast:436
873 assert_trap(() => invoke($7, `check`, [23n]), `uninitialized element`);
874
875 // ./test/core/table_init.wast:437
876 assert_trap(() => invoke($7, `check`, [24n]), `uninitialized element`);
877
878 // ./test/core/table_init.wast:438
879 assert_trap(() => invoke($7, `check`, [25n]), `uninitialized element`);
880
881 // ./test/core/table_init.wast:439
882 assert_trap(() => invoke($7, `check`, [26n]), `uninitialized element`);
883
884 // ./test/core/table_init.wast:440
885 assert_trap(() => invoke($7, `check`, [27n]), `uninitialized element`);
886
887 // ./test/core/table_init.wast:441
888 assert_trap(() => invoke($7, `check`, [28n]), `uninitialized element`);
889
890 // ./test/core/table_init.wast:442
891 assert_trap(() => invoke($7, `check`, [29n]), `uninitialized element`);
892
893 // ./test/core/table_init.wast:444
894 let $8 = instantiate(`(module
895 (type (func (result i32))) ;; type #0
896 (import "a" "ef0" (func (result i32))) ;; index 0
897 (import "a" "ef1" (func (result i32)))
898 (import "a" "ef2" (func (result i32)))
899 (import "a" "ef3" (func (result i32)))
900 (import "a" "ef4" (func (result i32))) ;; index 4
901 (table $$t0 30 30 funcref)
902 (table $$t1 30 30 funcref)
903 (table $$t2 i64 30 30 funcref)
904 (elem (table $$t2) (i64.const 2) func 3 1 4 1)
905 (elem funcref
906 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
907 (elem (table $$t2) (i64.const 12) func 7 5 2 3 6)
908 (elem funcref
909 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
910 (func (result i32) (i32.const 5)) ;; index 5
911 (func (result i32) (i32.const 6))
912 (func (result i32) (i32.const 7))
913 (func (result i32) (i32.const 8))
914 (func (result i32) (i32.const 9)) ;; index 9
915 (func (export "test")
916 (table.init $$t2 3 (i64.const 15) (i32.const 1) (i32.const 3)))
917 (func (export "check") (param i64) (result i32)
918 (call_indirect $$t2 (type 0) (local.get 0)))
919 )`);
920
921 // ./test/core/table_init.wast:471
922 invoke($8, `test`, []);
923
924 // ./test/core/table_init.wast:472
925 assert_trap(() => invoke($8, `check`, [0n]), `uninitialized element`);
926
927 // ./test/core/table_init.wast:473
928 assert_trap(() => invoke($8, `check`, [1n]), `uninitialized element`);
929
930 // ./test/core/table_init.wast:474
931 assert_return(() => invoke($8, `check`, [2n]), [value("i32", 3)]);
932
933 // ./test/core/table_init.wast:475
934 assert_return(() => invoke($8, `check`, [3n]), [value("i32", 1)]);
935
936 // ./test/core/table_init.wast:476
937 assert_return(() => invoke($8, `check`, [4n]), [value("i32", 4)]);
938
939 // ./test/core/table_init.wast:477
940 assert_return(() => invoke($8, `check`, [5n]), [value("i32", 1)]);
941
942 // ./test/core/table_init.wast:478
943 assert_trap(() => invoke($8, `check`, [6n]), `uninitialized element`);
944
945 // ./test/core/table_init.wast:479
946 assert_trap(() => invoke($8, `check`, [7n]), `uninitialized element`);
947
948 // ./test/core/table_init.wast:480
949 assert_trap(() => invoke($8, `check`, [8n]), `uninitialized element`);
950
951 // ./test/core/table_init.wast:481
952 assert_trap(() => invoke($8, `check`, [9n]), `uninitialized element`);
953
954 // ./test/core/table_init.wast:482
955 assert_trap(() => invoke($8, `check`, [10n]), `uninitialized element`);
956
957 // ./test/core/table_init.wast:483
958 assert_trap(() => invoke($8, `check`, [11n]), `uninitialized element`);
959
960 // ./test/core/table_init.wast:484
961 assert_return(() => invoke($8, `check`, [12n]), [value("i32", 7)]);
962
963 // ./test/core/table_init.wast:485
964 assert_return(() => invoke($8, `check`, [13n]), [value("i32", 5)]);
965
966 // ./test/core/table_init.wast:486
967 assert_return(() => invoke($8, `check`, [14n]), [value("i32", 2)]);
968
969 // ./test/core/table_init.wast:487
970 assert_return(() => invoke($8, `check`, [15n]), [value("i32", 9)]);
971
972 // ./test/core/table_init.wast:488
973 assert_return(() => invoke($8, `check`, [16n]), [value("i32", 2)]);
974
975 // ./test/core/table_init.wast:489
976 assert_return(() => invoke($8, `check`, [17n]), [value("i32", 7)]);
977
978 // ./test/core/table_init.wast:490
979 assert_trap(() => invoke($8, `check`, [18n]), `uninitialized element`);
980
981 // ./test/core/table_init.wast:491
982 assert_trap(() => invoke($8, `check`, [19n]), `uninitialized element`);
983
984 // ./test/core/table_init.wast:492
985 assert_trap(() => invoke($8, `check`, [20n]), `uninitialized element`);
986
987 // ./test/core/table_init.wast:493
988 assert_trap(() => invoke($8, `check`, [21n]), `uninitialized element`);
989
990 // ./test/core/table_init.wast:494
991 assert_trap(() => invoke($8, `check`, [22n]), `uninitialized element`);
992
993 // ./test/core/table_init.wast:495
994 assert_trap(() => invoke($8, `check`, [23n]), `uninitialized element`);
995
996 // ./test/core/table_init.wast:496
997 assert_trap(() => invoke($8, `check`, [24n]), `uninitialized element`);
998
999 // ./test/core/table_init.wast:497
1000 assert_trap(() => invoke($8, `check`, [25n]), `uninitialized element`);
1001
1002 // ./test/core/table_init.wast:498
1003 assert_trap(() => invoke($8, `check`, [26n]), `uninitialized element`);
1004
1005 // ./test/core/table_init.wast:499
1006 assert_trap(() => invoke($8, `check`, [27n]), `uninitialized element`);
1007
1008 // ./test/core/table_init.wast:500
1009 assert_trap(() => invoke($8, `check`, [28n]), `uninitialized element`);
1010
1011 // ./test/core/table_init.wast:501
1012 assert_trap(() => invoke($8, `check`, [29n]), `uninitialized element`);
1013
1014 // ./test/core/table_init.wast:503
1015 let $9 = instantiate(`(module
1016 (type (func (result i32))) ;; type #0
1017 (import "a" "ef0" (func (result i32))) ;; index 0
1018 (import "a" "ef1" (func (result i32)))
1019 (import "a" "ef2" (func (result i32)))
1020 (import "a" "ef3" (func (result i32)))
1021 (import "a" "ef4" (func (result i32))) ;; index 4
1022 (table $$t0 30 30 funcref)
1023 (table $$t1 30 30 funcref)
1024 (table $$t2 i64 30 30 funcref)
1025 (elem (table $$t2) (i64.const 2) func 3 1 4 1)
1026 (elem funcref
1027 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1028 (elem (table $$t2) (i64.const 12) func 7 5 2 3 6)
1029 (elem funcref
1030 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1031 (func (result i32) (i32.const 5)) ;; index 5
1032 (func (result i32) (i32.const 6))
1033 (func (result i32) (i32.const 7))
1034 (func (result i32) (i32.const 8))
1035 (func (result i32) (i32.const 9)) ;; index 9
1036 (func (export "test")
1037 (table.init $$t2 1 (i64.const 7) (i32.const 0) (i32.const 4))
1038 (elem.drop 1)
1039 (table.init $$t2 3 (i64.const 15) (i32.const 1) (i32.const 3))
1040 (elem.drop 3)
1041 (table.copy $$t2 2 (i64.const 20) (i64.const 15) (i64.const 5))
1042 (table.copy $$t2 2 (i64.const 21) (i64.const 29) (i64.const 1))
1043 (table.copy $$t2 2 (i64.const 24) (i64.const 10) (i64.const 1))
1044 (table.copy $$t2 2 (i64.const 13) (i64.const 11) (i64.const 4))
1045 (table.copy $$t2 2 (i64.const 19) (i64.const 20) (i64.const 5)))
1046 (func (export "check") (param i64) (result i32)
1047 (call_indirect $$t2 (type 0) (local.get 0)))
1048 )`);
1049
1050 // ./test/core/table_init.wast:538
1051 invoke($9, `test`, []);
1052
1053 // ./test/core/table_init.wast:539
1054 assert_trap(() => invoke($9, `check`, [0n]), `uninitialized element`);
1055
1056 // ./test/core/table_init.wast:540
1057 assert_trap(() => invoke($9, `check`, [1n]), `uninitialized element`);
1058
1059 // ./test/core/table_init.wast:541
1060 assert_return(() => invoke($9, `check`, [2n]), [value("i32", 3)]);
1061
1062 // ./test/core/table_init.wast:542
1063 assert_return(() => invoke($9, `check`, [3n]), [value("i32", 1)]);
1064
1065 // ./test/core/table_init.wast:543
1066 assert_return(() => invoke($9, `check`, [4n]), [value("i32", 4)]);
1067
1068 // ./test/core/table_init.wast:544
1069 assert_return(() => invoke($9, `check`, [5n]), [value("i32", 1)]);
1070
1071 // ./test/core/table_init.wast:545
1072 assert_trap(() => invoke($9, `check`, [6n]), `uninitialized element`);
1073
1074 // ./test/core/table_init.wast:546
1075 assert_return(() => invoke($9, `check`, [7n]), [value("i32", 2)]);
1076
1077 // ./test/core/table_init.wast:547
1078 assert_return(() => invoke($9, `check`, [8n]), [value("i32", 7)]);
1079
1080 // ./test/core/table_init.wast:548
1081 assert_return(() => invoke($9, `check`, [9n]), [value("i32", 1)]);
1082
1083 // ./test/core/table_init.wast:549
1084 assert_return(() => invoke($9, `check`, [10n]), [value("i32", 8)]);
1085
1086 // ./test/core/table_init.wast:550
1087 assert_trap(() => invoke($9, `check`, [11n]), `uninitialized element`);
1088
1089 // ./test/core/table_init.wast:551
1090 assert_return(() => invoke($9, `check`, [12n]), [value("i32", 7)]);
1091
1092 // ./test/core/table_init.wast:552
1093 assert_trap(() => invoke($9, `check`, [13n]), `uninitialized element`);
1094
1095 // ./test/core/table_init.wast:553
1096 assert_return(() => invoke($9, `check`, [14n]), [value("i32", 7)]);
1097
1098 // ./test/core/table_init.wast:554
1099 assert_return(() => invoke($9, `check`, [15n]), [value("i32", 5)]);
1100
1101 // ./test/core/table_init.wast:555
1102 assert_return(() => invoke($9, `check`, [16n]), [value("i32", 2)]);
1103
1104 // ./test/core/table_init.wast:556
1105 assert_return(() => invoke($9, `check`, [17n]), [value("i32", 7)]);
1106
1107 // ./test/core/table_init.wast:557
1108 assert_trap(() => invoke($9, `check`, [18n]), `uninitialized element`);
1109
1110 // ./test/core/table_init.wast:558
1111 assert_return(() => invoke($9, `check`, [19n]), [value("i32", 9)]);
1112
1113 // ./test/core/table_init.wast:559
1114 assert_trap(() => invoke($9, `check`, [20n]), `uninitialized element`);
1115
1116 // ./test/core/table_init.wast:560
1117 assert_return(() => invoke($9, `check`, [21n]), [value("i32", 7)]);
1118
1119 // ./test/core/table_init.wast:561
1120 assert_trap(() => invoke($9, `check`, [22n]), `uninitialized element`);
1121
1122 // ./test/core/table_init.wast:562
1123 assert_return(() => invoke($9, `check`, [23n]), [value("i32", 8)]);
1124
1125 // ./test/core/table_init.wast:563
1126 assert_return(() => invoke($9, `check`, [24n]), [value("i32", 8)]);
1127
1128 // ./test/core/table_init.wast:564
1129 assert_trap(() => invoke($9, `check`, [25n]), `uninitialized element`);
1130
1131 // ./test/core/table_init.wast:565
1132 assert_trap(() => invoke($9, `check`, [26n]), `uninitialized element`);
1133
1134 // ./test/core/table_init.wast:566
1135 assert_trap(() => invoke($9, `check`, [27n]), `uninitialized element`);
1136
1137 // ./test/core/table_init.wast:567
1138 assert_trap(() => invoke($9, `check`, [28n]), `uninitialized element`);
1139
1140 // ./test/core/table_init.wast:568
1141 assert_trap(() => invoke($9, `check`, [29n]), `uninitialized element`);
1142
1143 // ./test/core/table_init.wast:569
1144 assert_invalid(
1145 () => instantiate(`(module
1146 (func (export "test")
1147 (elem.drop 0)))`),
1148 `unknown elem segment 0`,
1149 );
1150
1151 // ./test/core/table_init.wast:575
1152 assert_invalid(
1153 () => instantiate(`(module
1154 (func (export "test")
1155 (table.init 0 (i32.const 12) (i32.const 1) (i32.const 1))))`),
1156 `unknown table 0`,
1157 );
1158
1159 // ./test/core/table_init.wast:581
1160 assert_invalid(
1161 () => instantiate(`(module
1162 (elem funcref (ref.func 0))
1163 (func (result i32) (i32.const 0))
1164 (func (export "test")
1165 (elem.drop 4)))`),
1166 `unknown elem segment 4`,
1167 );
1168
1169 // ./test/core/table_init.wast:589
1170 assert_invalid(
1171 () => instantiate(`(module
1172 (elem funcref (ref.func 0))
1173 (func (result i32) (i32.const 0))
1174 (func (export "test")
1175 (table.init 4 (i32.const 12) (i32.const 1) (i32.const 1))))`),
1176 `unknown table 0`,
1177 );
1178
1179 // ./test/core/table_init.wast:598
1180 let $10 = instantiate(`(module
1181 (table $$t0 30 30 funcref)
1182 (table $$t1 28 28 funcref)
1183 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1184 (elem funcref
1185 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1186 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1187 (elem funcref
1188 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1189 (func (result i32) (i32.const 0))
1190 (func (result i32) (i32.const 1))
1191 (func (result i32) (i32.const 2))
1192 (func (result i32) (i32.const 3))
1193 (func (result i32) (i32.const 4))
1194 (func (result i32) (i32.const 5))
1195 (func (result i32) (i32.const 6))
1196 (func (result i32) (i32.const 7))
1197 (func (result i32) (i32.const 8))
1198 (func (result i32) (i32.const 9))
1199 (func (export "test")
1200 (elem.drop 2)
1201 ))`);
1202
1203 // ./test/core/table_init.wast:620
1204 invoke($10, `test`, []);
1205
1206 // ./test/core/table_init.wast:622
1207 let $11 = instantiate(`(module
1208 (table $$t0 30 30 funcref)
1209 (table $$t1 28 28 funcref)
1210 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1211 (elem funcref
1212 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1213 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1214 (elem funcref
1215 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1216 (func (result i32) (i32.const 0))
1217 (func (result i32) (i32.const 1))
1218 (func (result i32) (i32.const 2))
1219 (func (result i32) (i32.const 3))
1220 (func (result i32) (i32.const 4))
1221 (func (result i32) (i32.const 5))
1222 (func (result i32) (i32.const 6))
1223 (func (result i32) (i32.const 7))
1224 (func (result i32) (i32.const 8))
1225 (func (result i32) (i32.const 9))
1226 (func (export "test")
1227 (table.init 2 (i32.const 12) (i32.const 1) (i32.const 1))
1228 ))`);
1229
1230 // ./test/core/table_init.wast:644
1231 assert_trap(() => invoke($11, `test`, []), `out of bounds table access`);
1232
1233 // ./test/core/table_init.wast:646
1234 let $12 = instantiate(`(module
1235 (table $$t0 30 30 funcref)
1236 (table $$t1 28 28 funcref)
1237 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1238 (elem funcref
1239 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1240 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1241 (elem funcref
1242 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1243 (func (result i32) (i32.const 0))
1244 (func (result i32) (i32.const 1))
1245 (func (result i32) (i32.const 2))
1246 (func (result i32) (i32.const 3))
1247 (func (result i32) (i32.const 4))
1248 (func (result i32) (i32.const 5))
1249 (func (result i32) (i32.const 6))
1250 (func (result i32) (i32.const 7))
1251 (func (result i32) (i32.const 8))
1252 (func (result i32) (i32.const 9))
1253 (func (export "test")
1254 (table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))
1255 (table.init 1 (i32.const 21) (i32.const 1) (i32.const 1))))`);
1256
1257 // ./test/core/table_init.wast:668
1258 invoke($12, `test`, []);
1259
1260 // ./test/core/table_init.wast:670
1261 let $13 = instantiate(`(module
1262 (table $$t0 30 30 funcref)
1263 (table $$t1 28 28 funcref)
1264 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1265 (elem funcref
1266 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1267 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1268 (elem funcref
1269 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1270 (func (result i32) (i32.const 0))
1271 (func (result i32) (i32.const 1))
1272 (func (result i32) (i32.const 2))
1273 (func (result i32) (i32.const 3))
1274 (func (result i32) (i32.const 4))
1275 (func (result i32) (i32.const 5))
1276 (func (result i32) (i32.const 6))
1277 (func (result i32) (i32.const 7))
1278 (func (result i32) (i32.const 8))
1279 (func (result i32) (i32.const 9))
1280 (func (export "test")
1281 (elem.drop 1)
1282 (elem.drop 1)))`);
1283
1284 // ./test/core/table_init.wast:692
1285 invoke($13, `test`, []);
1286
1287 // ./test/core/table_init.wast:694
1288 let $14 = instantiate(`(module
1289 (table $$t0 30 30 funcref)
1290 (table $$t1 28 28 funcref)
1291 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1292 (elem funcref
1293 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1294 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1295 (elem funcref
1296 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1297 (func (result i32) (i32.const 0))
1298 (func (result i32) (i32.const 1))
1299 (func (result i32) (i32.const 2))
1300 (func (result i32) (i32.const 3))
1301 (func (result i32) (i32.const 4))
1302 (func (result i32) (i32.const 5))
1303 (func (result i32) (i32.const 6))
1304 (func (result i32) (i32.const 7))
1305 (func (result i32) (i32.const 8))
1306 (func (result i32) (i32.const 9))
1307 (func (export "test")
1308 (elem.drop 1)
1309 (table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))))`);
1310
1311 // ./test/core/table_init.wast:716
1312 assert_trap(() => invoke($14, `test`, []), `out of bounds table access`);
1313
1314 // ./test/core/table_init.wast:718
1315 let $15 = instantiate(`(module
1316 (table $$t0 30 30 funcref)
1317 (table $$t1 28 28 funcref)
1318 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1319 (elem funcref
1320 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1321 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1322 (elem funcref
1323 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1324 (func (result i32) (i32.const 0))
1325 (func (result i32) (i32.const 1))
1326 (func (result i32) (i32.const 2))
1327 (func (result i32) (i32.const 3))
1328 (func (result i32) (i32.const 4))
1329 (func (result i32) (i32.const 5))
1330 (func (result i32) (i32.const 6))
1331 (func (result i32) (i32.const 7))
1332 (func (result i32) (i32.const 8))
1333 (func (result i32) (i32.const 9))
1334 (func (export "test")
1335 (table.init 1 (i32.const 12) (i32.const 0) (i32.const 5))
1336 ))`);
1337
1338 // ./test/core/table_init.wast:740
1339 assert_trap(() => invoke($15, `test`, []), `out of bounds table access`);
1340
1341 // ./test/core/table_init.wast:742
1342 let $16 = instantiate(`(module
1343 (table $$t0 30 30 funcref)
1344 (table $$t1 28 28 funcref)
1345 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1346 (elem funcref
1347 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1348 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1349 (elem funcref
1350 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1351 (func (result i32) (i32.const 0))
1352 (func (result i32) (i32.const 1))
1353 (func (result i32) (i32.const 2))
1354 (func (result i32) (i32.const 3))
1355 (func (result i32) (i32.const 4))
1356 (func (result i32) (i32.const 5))
1357 (func (result i32) (i32.const 6))
1358 (func (result i32) (i32.const 7))
1359 (func (result i32) (i32.const 8))
1360 (func (result i32) (i32.const 9))
1361 (func (export "test")
1362 (table.init 1 (i32.const 12) (i32.const 2) (i32.const 3))
1363 ))`);
1364
1365 // ./test/core/table_init.wast:764
1366 assert_trap(() => invoke($16, `test`, []), `out of bounds table access`);
1367
1368 // ./test/core/table_init.wast:766
1369 let $17 = instantiate(`(module
1370 (table $$t0 30 30 funcref)
1371 (table $$t1 28 28 funcref)
1372 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1373 (elem funcref
1374 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1375 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1376 (elem funcref
1377 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1378 (func (result i32) (i32.const 0))
1379 (func (result i32) (i32.const 1))
1380 (func (result i32) (i32.const 2))
1381 (func (result i32) (i32.const 3))
1382 (func (result i32) (i32.const 4))
1383 (func (result i32) (i32.const 5))
1384 (func (result i32) (i32.const 6))
1385 (func (result i32) (i32.const 7))
1386 (func (result i32) (i32.const 8))
1387 (func (result i32) (i32.const 9))
1388 (func (export "test")
1389 (table.init $$t0 1 (i32.const 28) (i32.const 1) (i32.const 3))
1390 ))`);
1391
1392 // ./test/core/table_init.wast:788
1393 assert_trap(() => invoke($17, `test`, []), `out of bounds table access`);
1394
1395 // ./test/core/table_init.wast:790
1396 let $18 = instantiate(`(module
1397 (table $$t0 30 30 funcref)
1398 (table $$t1 28 28 funcref)
1399 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1400 (elem funcref
1401 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1402 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1403 (elem funcref
1404 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1405 (func (result i32) (i32.const 0))
1406 (func (result i32) (i32.const 1))
1407 (func (result i32) (i32.const 2))
1408 (func (result i32) (i32.const 3))
1409 (func (result i32) (i32.const 4))
1410 (func (result i32) (i32.const 5))
1411 (func (result i32) (i32.const 6))
1412 (func (result i32) (i32.const 7))
1413 (func (result i32) (i32.const 8))
1414 (func (result i32) (i32.const 9))
1415 (func (export "test")
1416 (table.init $$t0 1 (i32.const 12) (i32.const 4) (i32.const 0))
1417 ))`);
1418
1419 // ./test/core/table_init.wast:812
1420 invoke($18, `test`, []);
1421
1422 // ./test/core/table_init.wast:814
1423 let $19 = instantiate(`(module
1424 (table $$t0 30 30 funcref)
1425 (table $$t1 28 28 funcref)
1426 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1427 (elem funcref
1428 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1429 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1430 (elem funcref
1431 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1432 (func (result i32) (i32.const 0))
1433 (func (result i32) (i32.const 1))
1434 (func (result i32) (i32.const 2))
1435 (func (result i32) (i32.const 3))
1436 (func (result i32) (i32.const 4))
1437 (func (result i32) (i32.const 5))
1438 (func (result i32) (i32.const 6))
1439 (func (result i32) (i32.const 7))
1440 (func (result i32) (i32.const 8))
1441 (func (result i32) (i32.const 9))
1442 (func (export "test")
1443 (table.init $$t0 1 (i32.const 12) (i32.const 5) (i32.const 0))
1444 ))`);
1445
1446 // ./test/core/table_init.wast:836
1447 assert_trap(() => invoke($19, `test`, []), `out of bounds table access`);
1448
1449 // ./test/core/table_init.wast:838
1450 let $20 = instantiate(`(module
1451 (table $$t0 30 30 funcref)
1452 (table $$t1 28 28 funcref)
1453 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1454 (elem funcref
1455 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1456 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1457 (elem funcref
1458 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1459 (func (result i32) (i32.const 0))
1460 (func (result i32) (i32.const 1))
1461 (func (result i32) (i32.const 2))
1462 (func (result i32) (i32.const 3))
1463 (func (result i32) (i32.const 4))
1464 (func (result i32) (i32.const 5))
1465 (func (result i32) (i32.const 6))
1466 (func (result i32) (i32.const 7))
1467 (func (result i32) (i32.const 8))
1468 (func (result i32) (i32.const 9))
1469 (func (export "test")
1470 (table.init $$t0 1 (i32.const 30) (i32.const 2) (i32.const 0))
1471 ))`);
1472
1473 // ./test/core/table_init.wast:860
1474 invoke($20, `test`, []);
1475
1476 // ./test/core/table_init.wast:862
1477 let $21 = instantiate(`(module
1478 (table $$t0 30 30 funcref)
1479 (table $$t1 28 28 funcref)
1480 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1481 (elem funcref
1482 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1483 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1484 (elem funcref
1485 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1486 (func (result i32) (i32.const 0))
1487 (func (result i32) (i32.const 1))
1488 (func (result i32) (i32.const 2))
1489 (func (result i32) (i32.const 3))
1490 (func (result i32) (i32.const 4))
1491 (func (result i32) (i32.const 5))
1492 (func (result i32) (i32.const 6))
1493 (func (result i32) (i32.const 7))
1494 (func (result i32) (i32.const 8))
1495 (func (result i32) (i32.const 9))
1496 (func (export "test")
1497 (table.init $$t0 1 (i32.const 31) (i32.const 2) (i32.const 0))
1498 ))`);
1499
1500 // ./test/core/table_init.wast:884
1501 assert_trap(() => invoke($21, `test`, []), `out of bounds table access`);
1502
1503 // ./test/core/table_init.wast:886
1504 let $22 = instantiate(`(module
1505 (table $$t0 30 30 funcref)
1506 (table $$t1 28 28 funcref)
1507 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1508 (elem funcref
1509 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1510 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1511 (elem funcref
1512 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1513 (func (result i32) (i32.const 0))
1514 (func (result i32) (i32.const 1))
1515 (func (result i32) (i32.const 2))
1516 (func (result i32) (i32.const 3))
1517 (func (result i32) (i32.const 4))
1518 (func (result i32) (i32.const 5))
1519 (func (result i32) (i32.const 6))
1520 (func (result i32) (i32.const 7))
1521 (func (result i32) (i32.const 8))
1522 (func (result i32) (i32.const 9))
1523 (func (export "test")
1524 (table.init $$t0 1 (i32.const 30) (i32.const 4) (i32.const 0))
1525 ))`);
1526
1527 // ./test/core/table_init.wast:908
1528 invoke($22, `test`, []);
1529
1530 // ./test/core/table_init.wast:910
1531 let $23 = instantiate(`(module
1532 (table $$t0 30 30 funcref)
1533 (table $$t1 28 28 funcref)
1534 (elem (table $$t0) (i32.const 2) func 3 1 4 1)
1535 (elem funcref
1536 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1537 (elem (table $$t0) (i32.const 12) func 7 5 2 3 6)
1538 (elem funcref
1539 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1540 (func (result i32) (i32.const 0))
1541 (func (result i32) (i32.const 1))
1542 (func (result i32) (i32.const 2))
1543 (func (result i32) (i32.const 3))
1544 (func (result i32) (i32.const 4))
1545 (func (result i32) (i32.const 5))
1546 (func (result i32) (i32.const 6))
1547 (func (result i32) (i32.const 7))
1548 (func (result i32) (i32.const 8))
1549 (func (result i32) (i32.const 9))
1550 (func (export "test")
1551 (table.init $$t0 1 (i32.const 31) (i32.const 5) (i32.const 0))
1552 ))`);
1553
1554 // ./test/core/table_init.wast:932
1555 assert_trap(() => invoke($23, `test`, []), `out of bounds table access`);
1556
1557 // ./test/core/table_init.wast:934
1558 let $24 = instantiate(`(module
1559 (table $$t0 30 30 funcref)
1560 (table $$t1 28 28 funcref)
1561 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1562 (elem funcref
1563 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1564 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1565 (elem funcref
1566 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1567 (func (result i32) (i32.const 0))
1568 (func (result i32) (i32.const 1))
1569 (func (result i32) (i32.const 2))
1570 (func (result i32) (i32.const 3))
1571 (func (result i32) (i32.const 4))
1572 (func (result i32) (i32.const 5))
1573 (func (result i32) (i32.const 6))
1574 (func (result i32) (i32.const 7))
1575 (func (result i32) (i32.const 8))
1576 (func (result i32) (i32.const 9))
1577 (func (export "test")
1578 (table.init $$t1 1 (i32.const 26) (i32.const 1) (i32.const 3))
1579 ))`);
1580
1581 // ./test/core/table_init.wast:956
1582 assert_trap(() => invoke($24, `test`, []), `out of bounds table access`);
1583
1584 // ./test/core/table_init.wast:958
1585 let $25 = instantiate(`(module
1586 (table $$t0 30 30 funcref)
1587 (table $$t1 28 28 funcref)
1588 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1589 (elem funcref
1590 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1591 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1592 (elem funcref
1593 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1594 (func (result i32) (i32.const 0))
1595 (func (result i32) (i32.const 1))
1596 (func (result i32) (i32.const 2))
1597 (func (result i32) (i32.const 3))
1598 (func (result i32) (i32.const 4))
1599 (func (result i32) (i32.const 5))
1600 (func (result i32) (i32.const 6))
1601 (func (result i32) (i32.const 7))
1602 (func (result i32) (i32.const 8))
1603 (func (result i32) (i32.const 9))
1604 (func (export "test")
1605 (table.init $$t1 1 (i32.const 12) (i32.const 4) (i32.const 0))
1606 ))`);
1607
1608 // ./test/core/table_init.wast:980
1609 invoke($25, `test`, []);
1610
1611 // ./test/core/table_init.wast:982
1612 let $26 = instantiate(`(module
1613 (table $$t0 30 30 funcref)
1614 (table $$t1 28 28 funcref)
1615 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1616 (elem funcref
1617 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1618 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1619 (elem funcref
1620 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1621 (func (result i32) (i32.const 0))
1622 (func (result i32) (i32.const 1))
1623 (func (result i32) (i32.const 2))
1624 (func (result i32) (i32.const 3))
1625 (func (result i32) (i32.const 4))
1626 (func (result i32) (i32.const 5))
1627 (func (result i32) (i32.const 6))
1628 (func (result i32) (i32.const 7))
1629 (func (result i32) (i32.const 8))
1630 (func (result i32) (i32.const 9))
1631 (func (export "test")
1632 (table.init $$t1 1 (i32.const 12) (i32.const 5) (i32.const 0))
1633 ))`);
1634
1635 // ./test/core/table_init.wast:1004
1636 assert_trap(() => invoke($26, `test`, []), `out of bounds table access`);
1637
1638 // ./test/core/table_init.wast:1006
1639 let $27 = instantiate(`(module
1640 (table $$t0 30 30 funcref)
1641 (table $$t1 28 28 funcref)
1642 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1643 (elem funcref
1644 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1645 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1646 (elem funcref
1647 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1648 (func (result i32) (i32.const 0))
1649 (func (result i32) (i32.const 1))
1650 (func (result i32) (i32.const 2))
1651 (func (result i32) (i32.const 3))
1652 (func (result i32) (i32.const 4))
1653 (func (result i32) (i32.const 5))
1654 (func (result i32) (i32.const 6))
1655 (func (result i32) (i32.const 7))
1656 (func (result i32) (i32.const 8))
1657 (func (result i32) (i32.const 9))
1658 (func (export "test")
1659 (table.init $$t1 1 (i32.const 28) (i32.const 2) (i32.const 0))
1660 ))`);
1661
1662 // ./test/core/table_init.wast:1028
1663 invoke($27, `test`, []);
1664
1665 // ./test/core/table_init.wast:1030
1666 let $28 = instantiate(`(module
1667 (table $$t0 30 30 funcref)
1668 (table $$t1 28 28 funcref)
1669 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1670 (elem funcref
1671 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1672 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1673 (elem funcref
1674 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1675 (func (result i32) (i32.const 0))
1676 (func (result i32) (i32.const 1))
1677 (func (result i32) (i32.const 2))
1678 (func (result i32) (i32.const 3))
1679 (func (result i32) (i32.const 4))
1680 (func (result i32) (i32.const 5))
1681 (func (result i32) (i32.const 6))
1682 (func (result i32) (i32.const 7))
1683 (func (result i32) (i32.const 8))
1684 (func (result i32) (i32.const 9))
1685 (func (export "test")
1686 (table.init $$t1 1 (i32.const 29) (i32.const 2) (i32.const 0))
1687 ))`);
1688
1689 // ./test/core/table_init.wast:1052
1690 assert_trap(() => invoke($28, `test`, []), `out of bounds table access`);
1691
1692 // ./test/core/table_init.wast:1054
1693 let $29 = instantiate(`(module
1694 (table $$t0 30 30 funcref)
1695 (table $$t1 28 28 funcref)
1696 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1697 (elem funcref
1698 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1699 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1700 (elem funcref
1701 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1702 (func (result i32) (i32.const 0))
1703 (func (result i32) (i32.const 1))
1704 (func (result i32) (i32.const 2))
1705 (func (result i32) (i32.const 3))
1706 (func (result i32) (i32.const 4))
1707 (func (result i32) (i32.const 5))
1708 (func (result i32) (i32.const 6))
1709 (func (result i32) (i32.const 7))
1710 (func (result i32) (i32.const 8))
1711 (func (result i32) (i32.const 9))
1712 (func (export "test")
1713 (table.init $$t1 1 (i32.const 28) (i32.const 4) (i32.const 0))
1714 ))`);
1715
1716 // ./test/core/table_init.wast:1076
1717 invoke($29, `test`, []);
1718
1719 // ./test/core/table_init.wast:1078
1720 let $30 = instantiate(`(module
1721 (table $$t0 30 30 funcref)
1722 (table $$t1 28 28 funcref)
1723 (elem (table $$t1) (i32.const 2) func 3 1 4 1)
1724 (elem funcref
1725 (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
1726 (elem (table $$t1) (i32.const 12) func 7 5 2 3 6)
1727 (elem funcref
1728 (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
1729 (func (result i32) (i32.const 0))
1730 (func (result i32) (i32.const 1))
1731 (func (result i32) (i32.const 2))
1732 (func (result i32) (i32.const 3))
1733 (func (result i32) (i32.const 4))
1734 (func (result i32) (i32.const 5))
1735 (func (result i32) (i32.const 6))
1736 (func (result i32) (i32.const 7))
1737 (func (result i32) (i32.const 8))
1738 (func (result i32) (i32.const 9))
1739 (func (export "test")
1740 (table.init $$t1 1 (i32.const 29) (i32.const 5) (i32.const 0))
1741 ))`);
1742
1743 // ./test/core/table_init.wast:1100
1744 assert_trap(() => invoke($30, `test`, []), `out of bounds table access`);
1745
1746 // ./test/core/table_init.wast:1102
1747 assert_invalid(
1748 () => instantiate(`(module
1749 (table 10 funcref)
1750 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1751 (func $$f0)
1752 (func (export "test")
1753 (table.init 0 (i32.const 1) (i32.const 1) (f32.const 1))))`),
1754 `type mismatch`,
1755 );
1756
1757 // ./test/core/table_init.wast:1111
1758 assert_invalid(
1759 () => instantiate(`(module
1760 (table 10 funcref)
1761 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1762 (func $$f0)
1763 (func (export "test")
1764 (table.init 0 (i32.const 1) (i32.const 1) (i64.const 1))))`),
1765 `type mismatch`,
1766 );
1767
1768 // ./test/core/table_init.wast:1120
1769 assert_invalid(
1770 () => instantiate(`(module
1771 (table 10 funcref)
1772 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1773 (func $$f0)
1774 (func (export "test")
1775 (table.init 0 (i32.const 1) (i32.const 1) (f64.const 1))))`),
1776 `type mismatch`,
1777 );
1778
1779 // ./test/core/table_init.wast:1129
1780 assert_invalid(
1781 () => instantiate(`(module
1782 (table 10 funcref)
1783 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1784 (func $$f0)
1785 (func (export "test")
1786 (table.init 0 (i32.const 1) (f32.const 1) (i32.const 1))))`),
1787 `type mismatch`,
1788 );
1789
1790 // ./test/core/table_init.wast:1138
1791 assert_invalid(
1792 () => instantiate(`(module
1793 (table 10 funcref)
1794 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1795 (func $$f0)
1796 (func (export "test")
1797 (table.init 0 (i32.const 1) (f32.const 1) (f32.const 1))))`),
1798 `type mismatch`,
1799 );
1800
1801 // ./test/core/table_init.wast:1147
1802 assert_invalid(
1803 () => instantiate(`(module
1804 (table 10 funcref)
1805 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1806 (func $$f0)
1807 (func (export "test")
1808 (table.init 0 (i32.const 1) (f32.const 1) (i64.const 1))))`),
1809 `type mismatch`,
1810 );
1811
1812 // ./test/core/table_init.wast:1156
1813 assert_invalid(
1814 () => instantiate(`(module
1815 (table 10 funcref)
1816 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1817 (func $$f0)
1818 (func (export "test")
1819 (table.init 0 (i32.const 1) (f32.const 1) (f64.const 1))))`),
1820 `type mismatch`,
1821 );
1822
1823 // ./test/core/table_init.wast:1165
1824 assert_invalid(
1825 () => instantiate(`(module
1826 (table 10 funcref)
1827 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1828 (func $$f0)
1829 (func (export "test")
1830 (table.init 0 (i32.const 1) (i64.const 1) (i32.const 1))))`),
1831 `type mismatch`,
1832 );
1833
1834 // ./test/core/table_init.wast:1174
1835 assert_invalid(
1836 () => instantiate(`(module
1837 (table 10 funcref)
1838 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1839 (func $$f0)
1840 (func (export "test")
1841 (table.init 0 (i32.const 1) (i64.const 1) (f32.const 1))))`),
1842 `type mismatch`,
1843 );
1844
1845 // ./test/core/table_init.wast:1183
1846 assert_invalid(
1847 () => instantiate(`(module
1848 (table 10 funcref)
1849 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1850 (func $$f0)
1851 (func (export "test")
1852 (table.init 0 (i32.const 1) (i64.const 1) (i64.const 1))))`),
1853 `type mismatch`,
1854 );
1855
1856 // ./test/core/table_init.wast:1192
1857 assert_invalid(
1858 () => instantiate(`(module
1859 (table 10 funcref)
1860 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1861 (func $$f0)
1862 (func (export "test")
1863 (table.init 0 (i32.const 1) (i64.const 1) (f64.const 1))))`),
1864 `type mismatch`,
1865 );
1866
1867 // ./test/core/table_init.wast:1201
1868 assert_invalid(
1869 () => instantiate(`(module
1870 (table 10 funcref)
1871 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1872 (func $$f0)
1873 (func (export "test")
1874 (table.init 0 (i32.const 1) (f64.const 1) (i32.const 1))))`),
1875 `type mismatch`,
1876 );
1877
1878 // ./test/core/table_init.wast:1210
1879 assert_invalid(
1880 () => instantiate(`(module
1881 (table 10 funcref)
1882 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1883 (func $$f0)
1884 (func (export "test")
1885 (table.init 0 (i32.const 1) (f64.const 1) (f32.const 1))))`),
1886 `type mismatch`,
1887 );
1888
1889 // ./test/core/table_init.wast:1219
1890 assert_invalid(
1891 () => instantiate(`(module
1892 (table 10 funcref)
1893 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1894 (func $$f0)
1895 (func (export "test")
1896 (table.init 0 (i32.const 1) (f64.const 1) (i64.const 1))))`),
1897 `type mismatch`,
1898 );
1899
1900 // ./test/core/table_init.wast:1228
1901 assert_invalid(
1902 () => instantiate(`(module
1903 (table 10 funcref)
1904 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1905 (func $$f0)
1906 (func (export "test")
1907 (table.init 0 (i32.const 1) (f64.const 1) (f64.const 1))))`),
1908 `type mismatch`,
1909 );
1910
1911 // ./test/core/table_init.wast:1237
1912 assert_invalid(
1913 () => instantiate(`(module
1914 (table 10 funcref)
1915 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1916 (func $$f0)
1917 (func (export "test")
1918 (table.init 0 (f32.const 1) (i32.const 1) (i32.const 1))))`),
1919 `type mismatch`,
1920 );
1921
1922 // ./test/core/table_init.wast:1246
1923 assert_invalid(
1924 () => instantiate(`(module
1925 (table 10 funcref)
1926 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1927 (func $$f0)
1928 (func (export "test")
1929 (table.init 0 (f32.const 1) (i32.const 1) (f32.const 1))))`),
1930 `type mismatch`,
1931 );
1932
1933 // ./test/core/table_init.wast:1255
1934 assert_invalid(
1935 () => instantiate(`(module
1936 (table 10 funcref)
1937 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1938 (func $$f0)
1939 (func (export "test")
1940 (table.init 0 (f32.const 1) (i32.const 1) (i64.const 1))))`),
1941 `type mismatch`,
1942 );
1943
1944 // ./test/core/table_init.wast:1264
1945 assert_invalid(
1946 () => instantiate(`(module
1947 (table 10 funcref)
1948 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1949 (func $$f0)
1950 (func (export "test")
1951 (table.init 0 (f32.const 1) (i32.const 1) (f64.const 1))))`),
1952 `type mismatch`,
1953 );
1954
1955 // ./test/core/table_init.wast:1273
1956 assert_invalid(
1957 () => instantiate(`(module
1958 (table 10 funcref)
1959 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1960 (func $$f0)
1961 (func (export "test")
1962 (table.init 0 (f32.const 1) (f32.const 1) (i32.const 1))))`),
1963 `type mismatch`,
1964 );
1965
1966 // ./test/core/table_init.wast:1282
1967 assert_invalid(
1968 () => instantiate(`(module
1969 (table 10 funcref)
1970 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1971 (func $$f0)
1972 (func (export "test")
1973 (table.init 0 (f32.const 1) (f32.const 1) (f32.const 1))))`),
1974 `type mismatch`,
1975 );
1976
1977 // ./test/core/table_init.wast:1291
1978 assert_invalid(
1979 () => instantiate(`(module
1980 (table 10 funcref)
1981 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1982 (func $$f0)
1983 (func (export "test")
1984 (table.init 0 (f32.const 1) (f32.const 1) (i64.const 1))))`),
1985 `type mismatch`,
1986 );
1987
1988 // ./test/core/table_init.wast:1300
1989 assert_invalid(
1990 () => instantiate(`(module
1991 (table 10 funcref)
1992 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
1993 (func $$f0)
1994 (func (export "test")
1995 (table.init 0 (f32.const 1) (f32.const 1) (f64.const 1))))`),
1996 `type mismatch`,
1997 );
1998
1999 // ./test/core/table_init.wast:1309
2000 assert_invalid(
2001 () => instantiate(`(module
2002 (table 10 funcref)
2003 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2004 (func $$f0)
2005 (func (export "test")
2006 (table.init 0 (f32.const 1) (i64.const 1) (i32.const 1))))`),
2007 `type mismatch`,
2008 );
2009
2010 // ./test/core/table_init.wast:1318
2011 assert_invalid(
2012 () => instantiate(`(module
2013 (table 10 funcref)
2014 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2015 (func $$f0)
2016 (func (export "test")
2017 (table.init 0 (f32.const 1) (i64.const 1) (f32.const 1))))`),
2018 `type mismatch`,
2019 );
2020
2021 // ./test/core/table_init.wast:1327
2022 assert_invalid(
2023 () => instantiate(`(module
2024 (table 10 funcref)
2025 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2026 (func $$f0)
2027 (func (export "test")
2028 (table.init 0 (f32.const 1) (i64.const 1) (i64.const 1))))`),
2029 `type mismatch`,
2030 );
2031
2032 // ./test/core/table_init.wast:1336
2033 assert_invalid(
2034 () => instantiate(`(module
2035 (table 10 funcref)
2036 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2037 (func $$f0)
2038 (func (export "test")
2039 (table.init 0 (f32.const 1) (i64.const 1) (f64.const 1))))`),
2040 `type mismatch`,
2041 );
2042
2043 // ./test/core/table_init.wast:1345
2044 assert_invalid(
2045 () => instantiate(`(module
2046 (table 10 funcref)
2047 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2048 (func $$f0)
2049 (func (export "test")
2050 (table.init 0 (f32.const 1) (f64.const 1) (i32.const 1))))`),
2051 `type mismatch`,
2052 );
2053
2054 // ./test/core/table_init.wast:1354
2055 assert_invalid(
2056 () => instantiate(`(module
2057 (table 10 funcref)
2058 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2059 (func $$f0)
2060 (func (export "test")
2061 (table.init 0 (f32.const 1) (f64.const 1) (f32.const 1))))`),
2062 `type mismatch`,
2063 );
2064
2065 // ./test/core/table_init.wast:1363
2066 assert_invalid(
2067 () => instantiate(`(module
2068 (table 10 funcref)
2069 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2070 (func $$f0)
2071 (func (export "test")
2072 (table.init 0 (f32.const 1) (f64.const 1) (i64.const 1))))`),
2073 `type mismatch`,
2074 );
2075
2076 // ./test/core/table_init.wast:1372
2077 assert_invalid(
2078 () => instantiate(`(module
2079 (table 10 funcref)
2080 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2081 (func $$f0)
2082 (func (export "test")
2083 (table.init 0 (f32.const 1) (f64.const 1) (f64.const 1))))`),
2084 `type mismatch`,
2085 );
2086
2087 // ./test/core/table_init.wast:1381
2088 assert_invalid(
2089 () => instantiate(`(module
2090 (table 10 funcref)
2091 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2092 (func $$f0)
2093 (func (export "test")
2094 (table.init 0 (i64.const 1) (i32.const 1) (i32.const 1))))`),
2095 `type mismatch`,
2096 );
2097
2098 // ./test/core/table_init.wast:1390
2099 assert_invalid(
2100 () => instantiate(`(module
2101 (table 10 funcref)
2102 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2103 (func $$f0)
2104 (func (export "test")
2105 (table.init 0 (i64.const 1) (i32.const 1) (f32.const 1))))`),
2106 `type mismatch`,
2107 );
2108
2109 // ./test/core/table_init.wast:1399
2110 assert_invalid(
2111 () => instantiate(`(module
2112 (table 10 funcref)
2113 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2114 (func $$f0)
2115 (func (export "test")
2116 (table.init 0 (i64.const 1) (i32.const 1) (i64.const 1))))`),
2117 `type mismatch`,
2118 );
2119
2120 // ./test/core/table_init.wast:1408
2121 assert_invalid(
2122 () => instantiate(`(module
2123 (table 10 funcref)
2124 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2125 (func $$f0)
2126 (func (export "test")
2127 (table.init 0 (i64.const 1) (i32.const 1) (f64.const 1))))`),
2128 `type mismatch`,
2129 );
2130
2131 // ./test/core/table_init.wast:1417
2132 assert_invalid(
2133 () => instantiate(`(module
2134 (table 10 funcref)
2135 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2136 (func $$f0)
2137 (func (export "test")
2138 (table.init 0 (i64.const 1) (f32.const 1) (i32.const 1))))`),
2139 `type mismatch`,
2140 );
2141
2142 // ./test/core/table_init.wast:1426
2143 assert_invalid(
2144 () => instantiate(`(module
2145 (table 10 funcref)
2146 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2147 (func $$f0)
2148 (func (export "test")
2149 (table.init 0 (i64.const 1) (f32.const 1) (f32.const 1))))`),
2150 `type mismatch`,
2151 );
2152
2153 // ./test/core/table_init.wast:1435
2154 assert_invalid(
2155 () => instantiate(`(module
2156 (table 10 funcref)
2157 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2158 (func $$f0)
2159 (func (export "test")
2160 (table.init 0 (i64.const 1) (f32.const 1) (i64.const 1))))`),
2161 `type mismatch`,
2162 );
2163
2164 // ./test/core/table_init.wast:1444
2165 assert_invalid(
2166 () => instantiate(`(module
2167 (table 10 funcref)
2168 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2169 (func $$f0)
2170 (func (export "test")
2171 (table.init 0 (i64.const 1) (f32.const 1) (f64.const 1))))`),
2172 `type mismatch`,
2173 );
2174
2175 // ./test/core/table_init.wast:1453
2176 assert_invalid(
2177 () => instantiate(`(module
2178 (table 10 funcref)
2179 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2180 (func $$f0)
2181 (func (export "test")
2182 (table.init 0 (i64.const 1) (i64.const 1) (i32.const 1))))`),
2183 `type mismatch`,
2184 );
2185
2186 // ./test/core/table_init.wast:1462
2187 assert_invalid(
2188 () => instantiate(`(module
2189 (table 10 funcref)
2190 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2191 (func $$f0)
2192 (func (export "test")
2193 (table.init 0 (i64.const 1) (i64.const 1) (f32.const 1))))`),
2194 `type mismatch`,
2195 );
2196
2197 // ./test/core/table_init.wast:1471
2198 assert_invalid(
2199 () => instantiate(`(module
2200 (table 10 funcref)
2201 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2202 (func $$f0)
2203 (func (export "test")
2204 (table.init 0 (i64.const 1) (i64.const 1) (i64.const 1))))`),
2205 `type mismatch`,
2206 );
2207
2208 // ./test/core/table_init.wast:1480
2209 assert_invalid(
2210 () => instantiate(`(module
2211 (table 10 funcref)
2212 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2213 (func $$f0)
2214 (func (export "test")
2215 (table.init 0 (i64.const 1) (i64.const 1) (f64.const 1))))`),
2216 `type mismatch`,
2217 );
2218
2219 // ./test/core/table_init.wast:1489
2220 assert_invalid(
2221 () => instantiate(`(module
2222 (table 10 funcref)
2223 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2224 (func $$f0)
2225 (func (export "test")
2226 (table.init 0 (i64.const 1) (f64.const 1) (i32.const 1))))`),
2227 `type mismatch`,
2228 );
2229
2230 // ./test/core/table_init.wast:1498
2231 assert_invalid(
2232 () => instantiate(`(module
2233 (table 10 funcref)
2234 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2235 (func $$f0)
2236 (func (export "test")
2237 (table.init 0 (i64.const 1) (f64.const 1) (f32.const 1))))`),
2238 `type mismatch`,
2239 );
2240
2241 // ./test/core/table_init.wast:1507
2242 assert_invalid(
2243 () => instantiate(`(module
2244 (table 10 funcref)
2245 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2246 (func $$f0)
2247 (func (export "test")
2248 (table.init 0 (i64.const 1) (f64.const 1) (i64.const 1))))`),
2249 `type mismatch`,
2250 );
2251
2252 // ./test/core/table_init.wast:1516
2253 assert_invalid(
2254 () => instantiate(`(module
2255 (table 10 funcref)
2256 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2257 (func $$f0)
2258 (func (export "test")
2259 (table.init 0 (i64.const 1) (f64.const 1) (f64.const 1))))`),
2260 `type mismatch`,
2261 );
2262
2263 // ./test/core/table_init.wast:1525
2264 assert_invalid(
2265 () => instantiate(`(module
2266 (table 10 funcref)
2267 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2268 (func $$f0)
2269 (func (export "test")
2270 (table.init 0 (f64.const 1) (i32.const 1) (i32.const 1))))`),
2271 `type mismatch`,
2272 );
2273
2274 // ./test/core/table_init.wast:1534
2275 assert_invalid(
2276 () => instantiate(`(module
2277 (table 10 funcref)
2278 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2279 (func $$f0)
2280 (func (export "test")
2281 (table.init 0 (f64.const 1) (i32.const 1) (f32.const 1))))`),
2282 `type mismatch`,
2283 );
2284
2285 // ./test/core/table_init.wast:1543
2286 assert_invalid(
2287 () => instantiate(`(module
2288 (table 10 funcref)
2289 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2290 (func $$f0)
2291 (func (export "test")
2292 (table.init 0 (f64.const 1) (i32.const 1) (i64.const 1))))`),
2293 `type mismatch`,
2294 );
2295
2296 // ./test/core/table_init.wast:1552
2297 assert_invalid(
2298 () => instantiate(`(module
2299 (table 10 funcref)
2300 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2301 (func $$f0)
2302 (func (export "test")
2303 (table.init 0 (f64.const 1) (i32.const 1) (f64.const 1))))`),
2304 `type mismatch`,
2305 );
2306
2307 // ./test/core/table_init.wast:1561
2308 assert_invalid(
2309 () => instantiate(`(module
2310 (table 10 funcref)
2311 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2312 (func $$f0)
2313 (func (export "test")
2314 (table.init 0 (f64.const 1) (f32.const 1) (i32.const 1))))`),
2315 `type mismatch`,
2316 );
2317
2318 // ./test/core/table_init.wast:1570
2319 assert_invalid(
2320 () => instantiate(`(module
2321 (table 10 funcref)
2322 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2323 (func $$f0)
2324 (func (export "test")
2325 (table.init 0 (f64.const 1) (f32.const 1) (f32.const 1))))`),
2326 `type mismatch`,
2327 );
2328
2329 // ./test/core/table_init.wast:1579
2330 assert_invalid(
2331 () => instantiate(`(module
2332 (table 10 funcref)
2333 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2334 (func $$f0)
2335 (func (export "test")
2336 (table.init 0 (f64.const 1) (f32.const 1) (i64.const 1))))`),
2337 `type mismatch`,
2338 );
2339
2340 // ./test/core/table_init.wast:1588
2341 assert_invalid(
2342 () => instantiate(`(module
2343 (table 10 funcref)
2344 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2345 (func $$f0)
2346 (func (export "test")
2347 (table.init 0 (f64.const 1) (f32.const 1) (f64.const 1))))`),
2348 `type mismatch`,
2349 );
2350
2351 // ./test/core/table_init.wast:1597
2352 assert_invalid(
2353 () => instantiate(`(module
2354 (table 10 funcref)
2355 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2356 (func $$f0)
2357 (func (export "test")
2358 (table.init 0 (f64.const 1) (i64.const 1) (i32.const 1))))`),
2359 `type mismatch`,
2360 );
2361
2362 // ./test/core/table_init.wast:1606
2363 assert_invalid(
2364 () => instantiate(`(module
2365 (table 10 funcref)
2366 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2367 (func $$f0)
2368 (func (export "test")
2369 (table.init 0 (f64.const 1) (i64.const 1) (f32.const 1))))`),
2370 `type mismatch`,
2371 );
2372
2373 // ./test/core/table_init.wast:1615
2374 assert_invalid(
2375 () => instantiate(`(module
2376 (table 10 funcref)
2377 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2378 (func $$f0)
2379 (func (export "test")
2380 (table.init 0 (f64.const 1) (i64.const 1) (i64.const 1))))`),
2381 `type mismatch`,
2382 );
2383
2384 // ./test/core/table_init.wast:1624
2385 assert_invalid(
2386 () => instantiate(`(module
2387 (table 10 funcref)
2388 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2389 (func $$f0)
2390 (func (export "test")
2391 (table.init 0 (f64.const 1) (i64.const 1) (f64.const 1))))`),
2392 `type mismatch`,
2393 );
2394
2395 // ./test/core/table_init.wast:1633
2396 assert_invalid(
2397 () => instantiate(`(module
2398 (table 10 funcref)
2399 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2400 (func $$f0)
2401 (func (export "test")
2402 (table.init 0 (f64.const 1) (f64.const 1) (i32.const 1))))`),
2403 `type mismatch`,
2404 );
2405
2406 // ./test/core/table_init.wast:1642
2407 assert_invalid(
2408 () => instantiate(`(module
2409 (table 10 funcref)
2410 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2411 (func $$f0)
2412 (func (export "test")
2413 (table.init 0 (f64.const 1) (f64.const 1) (f32.const 1))))`),
2414 `type mismatch`,
2415 );
2416
2417 // ./test/core/table_init.wast:1651
2418 assert_invalid(
2419 () => instantiate(`(module
2420 (table 10 funcref)
2421 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2422 (func $$f0)
2423 (func (export "test")
2424 (table.init 0 (f64.const 1) (f64.const 1) (i64.const 1))))`),
2425 `type mismatch`,
2426 );
2427
2428 // ./test/core/table_init.wast:1660
2429 assert_invalid(
2430 () => instantiate(`(module
2431 (table 10 funcref)
2432 (elem funcref (ref.func $$f0) (ref.func $$f0) (ref.func $$f0))
2433 (func $$f0)
2434 (func (export "test")
2435 (table.init 0 (f64.const 1) (f64.const 1) (f64.const 1))))`),
2436 `type mismatch`,
2437 );
2438
2439 // ./test/core/table_init.wast:1669
2440 let $31 = instantiate(`(module
2441 (type (func (result i32)))
2442 (table 32 64 funcref)
2443 (elem funcref
2444 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
2445 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
2446 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
2447 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
2448 (func $$f0 (export "f0") (result i32) (i32.const 0))
2449 (func $$f1 (export "f1") (result i32) (i32.const 1))
2450 (func $$f2 (export "f2") (result i32) (i32.const 2))
2451 (func $$f3 (export "f3") (result i32) (i32.const 3))
2452 (func $$f4 (export "f4") (result i32) (i32.const 4))
2453 (func $$f5 (export "f5") (result i32) (i32.const 5))
2454 (func $$f6 (export "f6") (result i32) (i32.const 6))
2455 (func $$f7 (export "f7") (result i32) (i32.const 7))
2456 (func $$f8 (export "f8") (result i32) (i32.const 8))
2457 (func $$f9 (export "f9") (result i32) (i32.const 9))
2458 (func $$f10 (export "f10") (result i32) (i32.const 10))
2459 (func $$f11 (export "f11") (result i32) (i32.const 11))
2460 (func $$f12 (export "f12") (result i32) (i32.const 12))
2461 (func $$f13 (export "f13") (result i32) (i32.const 13))
2462 (func $$f14 (export "f14") (result i32) (i32.const 14))
2463 (func $$f15 (export "f15") (result i32) (i32.const 15))
2464 (func (export "test") (param $$n i32) (result i32)
2465 (call_indirect (type 0) (local.get $$n)))
2466 (func (export "run") (param $$offs i32) (param $$len i32)
2467 (table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
2468
2469 // ./test/core/table_init.wast:1697
2470 assert_trap(() => invoke($31, `run`, [24, 16]), `out of bounds table access`);
2471
2472 // ./test/core/table_init.wast:1698
2473 assert_trap(() => invoke($31, `test`, [0]), `uninitialized element`);
2474
2475 // ./test/core/table_init.wast:1699
2476 assert_trap(() => invoke($31, `test`, [1]), `uninitialized element`);
2477
2478 // ./test/core/table_init.wast:1700
2479 assert_trap(() => invoke($31, `test`, [2]), `uninitialized element`);
2480
2481 // ./test/core/table_init.wast:1701
2482 assert_trap(() => invoke($31, `test`, [3]), `uninitialized element`);
2483
2484 // ./test/core/table_init.wast:1702
2485 assert_trap(() => invoke($31, `test`, [4]), `uninitialized element`);
2486
2487 // ./test/core/table_init.wast:1703
2488 assert_trap(() => invoke($31, `test`, [5]), `uninitialized element`);
2489
2490 // ./test/core/table_init.wast:1704
2491 assert_trap(() => invoke($31, `test`, [6]), `uninitialized element`);
2492
2493 // ./test/core/table_init.wast:1705
2494 assert_trap(() => invoke($31, `test`, [7]), `uninitialized element`);
2495
2496 // ./test/core/table_init.wast:1706
2497 assert_trap(() => invoke($31, `test`, [8]), `uninitialized element`);
2498
2499 // ./test/core/table_init.wast:1707
2500 assert_trap(() => invoke($31, `test`, [9]), `uninitialized element`);
2501
2502 // ./test/core/table_init.wast:1708
2503 assert_trap(() => invoke($31, `test`, [10]), `uninitialized element`);
2504
2505 // ./test/core/table_init.wast:1709
2506 assert_trap(() => invoke($31, `test`, [11]), `uninitialized element`);
2507
2508 // ./test/core/table_init.wast:1710
2509 assert_trap(() => invoke($31, `test`, [12]), `uninitialized element`);
2510
2511 // ./test/core/table_init.wast:1711
2512 assert_trap(() => invoke($31, `test`, [13]), `uninitialized element`);
2513
2514 // ./test/core/table_init.wast:1712
2515 assert_trap(() => invoke($31, `test`, [14]), `uninitialized element`);
2516
2517 // ./test/core/table_init.wast:1713
2518 assert_trap(() => invoke($31, `test`, [15]), `uninitialized element`);
2519
2520 // ./test/core/table_init.wast:1714
2521 assert_trap(() => invoke($31, `test`, [16]), `uninitialized element`);
2522
2523 // ./test/core/table_init.wast:1715
2524 assert_trap(() => invoke($31, `test`, [17]), `uninitialized element`);
2525
2526 // ./test/core/table_init.wast:1716
2527 assert_trap(() => invoke($31, `test`, [18]), `uninitialized element`);
2528
2529 // ./test/core/table_init.wast:1717
2530 assert_trap(() => invoke($31, `test`, [19]), `uninitialized element`);
2531
2532 // ./test/core/table_init.wast:1718
2533 assert_trap(() => invoke($31, `test`, [20]), `uninitialized element`);
2534
2535 // ./test/core/table_init.wast:1719
2536 assert_trap(() => invoke($31, `test`, [21]), `uninitialized element`);
2537
2538 // ./test/core/table_init.wast:1720
2539 assert_trap(() => invoke($31, `test`, [22]), `uninitialized element`);
2540
2541 // ./test/core/table_init.wast:1721
2542 assert_trap(() => invoke($31, `test`, [23]), `uninitialized element`);
2543
2544 // ./test/core/table_init.wast:1722
2545 assert_trap(() => invoke($31, `test`, [24]), `uninitialized element`);
2546
2547 // ./test/core/table_init.wast:1723
2548 assert_trap(() => invoke($31, `test`, [25]), `uninitialized element`);
2549
2550 // ./test/core/table_init.wast:1724
2551 assert_trap(() => invoke($31, `test`, [26]), `uninitialized element`);
2552
2553 // ./test/core/table_init.wast:1725
2554 assert_trap(() => invoke($31, `test`, [27]), `uninitialized element`);
2555
2556 // ./test/core/table_init.wast:1726
2557 assert_trap(() => invoke($31, `test`, [28]), `uninitialized element`);
2558
2559 // ./test/core/table_init.wast:1727
2560 assert_trap(() => invoke($31, `test`, [29]), `uninitialized element`);
2561
2562 // ./test/core/table_init.wast:1728
2563 assert_trap(() => invoke($31, `test`, [30]), `uninitialized element`);
2564
2565 // ./test/core/table_init.wast:1729
2566 assert_trap(() => invoke($31, `test`, [31]), `uninitialized element`);
2567
2568 // ./test/core/table_init.wast:1731
2569 let $32 = instantiate(`(module
2570 (type (func (result i32)))
2571 (table 32 64 funcref)
2572 (elem funcref
2573 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
2574 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
2575 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
2576 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
2577 (func $$f0 (export "f0") (result i32) (i32.const 0))
2578 (func $$f1 (export "f1") (result i32) (i32.const 1))
2579 (func $$f2 (export "f2") (result i32) (i32.const 2))
2580 (func $$f3 (export "f3") (result i32) (i32.const 3))
2581 (func $$f4 (export "f4") (result i32) (i32.const 4))
2582 (func $$f5 (export "f5") (result i32) (i32.const 5))
2583 (func $$f6 (export "f6") (result i32) (i32.const 6))
2584 (func $$f7 (export "f7") (result i32) (i32.const 7))
2585 (func $$f8 (export "f8") (result i32) (i32.const 8))
2586 (func $$f9 (export "f9") (result i32) (i32.const 9))
2587 (func $$f10 (export "f10") (result i32) (i32.const 10))
2588 (func $$f11 (export "f11") (result i32) (i32.const 11))
2589 (func $$f12 (export "f12") (result i32) (i32.const 12))
2590 (func $$f13 (export "f13") (result i32) (i32.const 13))
2591 (func $$f14 (export "f14") (result i32) (i32.const 14))
2592 (func $$f15 (export "f15") (result i32) (i32.const 15))
2593 (func (export "test") (param $$n i32) (result i32)
2594 (call_indirect (type 0) (local.get $$n)))
2595 (func (export "run") (param $$offs i32) (param $$len i32)
2596 (table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
2597
2598 // ./test/core/table_init.wast:1759
2599 assert_trap(() => invoke($32, `run`, [25, 16]), `out of bounds table access`);
2600
2601 // ./test/core/table_init.wast:1760
2602 assert_trap(() => invoke($32, `test`, [0]), `uninitialized element`);
2603
2604 // ./test/core/table_init.wast:1761
2605 assert_trap(() => invoke($32, `test`, [1]), `uninitialized element`);
2606
2607 // ./test/core/table_init.wast:1762
2608 assert_trap(() => invoke($32, `test`, [2]), `uninitialized element`);
2609
2610 // ./test/core/table_init.wast:1763
2611 assert_trap(() => invoke($32, `test`, [3]), `uninitialized element`);
2612
2613 // ./test/core/table_init.wast:1764
2614 assert_trap(() => invoke($32, `test`, [4]), `uninitialized element`);
2615
2616 // ./test/core/table_init.wast:1765
2617 assert_trap(() => invoke($32, `test`, [5]), `uninitialized element`);
2618
2619 // ./test/core/table_init.wast:1766
2620 assert_trap(() => invoke($32, `test`, [6]), `uninitialized element`);
2621
2622 // ./test/core/table_init.wast:1767
2623 assert_trap(() => invoke($32, `test`, [7]), `uninitialized element`);
2624
2625 // ./test/core/table_init.wast:1768
2626 assert_trap(() => invoke($32, `test`, [8]), `uninitialized element`);
2627
2628 // ./test/core/table_init.wast:1769
2629 assert_trap(() => invoke($32, `test`, [9]), `uninitialized element`);
2630
2631 // ./test/core/table_init.wast:1770
2632 assert_trap(() => invoke($32, `test`, [10]), `uninitialized element`);
2633
2634 // ./test/core/table_init.wast:1771
2635 assert_trap(() => invoke($32, `test`, [11]), `uninitialized element`);
2636
2637 // ./test/core/table_init.wast:1772
2638 assert_trap(() => invoke($32, `test`, [12]), `uninitialized element`);
2639
2640 // ./test/core/table_init.wast:1773
2641 assert_trap(() => invoke($32, `test`, [13]), `uninitialized element`);
2642
2643 // ./test/core/table_init.wast:1774
2644 assert_trap(() => invoke($32, `test`, [14]), `uninitialized element`);
2645
2646 // ./test/core/table_init.wast:1775
2647 assert_trap(() => invoke($32, `test`, [15]), `uninitialized element`);
2648
2649 // ./test/core/table_init.wast:1776
2650 assert_trap(() => invoke($32, `test`, [16]), `uninitialized element`);
2651
2652 // ./test/core/table_init.wast:1777
2653 assert_trap(() => invoke($32, `test`, [17]), `uninitialized element`);
2654
2655 // ./test/core/table_init.wast:1778
2656 assert_trap(() => invoke($32, `test`, [18]), `uninitialized element`);
2657
2658 // ./test/core/table_init.wast:1779
2659 assert_trap(() => invoke($32, `test`, [19]), `uninitialized element`);
2660
2661 // ./test/core/table_init.wast:1780
2662 assert_trap(() => invoke($32, `test`, [20]), `uninitialized element`);
2663
2664 // ./test/core/table_init.wast:1781
2665 assert_trap(() => invoke($32, `test`, [21]), `uninitialized element`);
2666
2667 // ./test/core/table_init.wast:1782
2668 assert_trap(() => invoke($32, `test`, [22]), `uninitialized element`);
2669
2670 // ./test/core/table_init.wast:1783
2671 assert_trap(() => invoke($32, `test`, [23]), `uninitialized element`);
2672
2673 // ./test/core/table_init.wast:1784
2674 assert_trap(() => invoke($32, `test`, [24]), `uninitialized element`);
2675
2676 // ./test/core/table_init.wast:1785
2677 assert_trap(() => invoke($32, `test`, [25]), `uninitialized element`);
2678
2679 // ./test/core/table_init.wast:1786
2680 assert_trap(() => invoke($32, `test`, [26]), `uninitialized element`);
2681
2682 // ./test/core/table_init.wast:1787
2683 assert_trap(() => invoke($32, `test`, [27]), `uninitialized element`);
2684
2685 // ./test/core/table_init.wast:1788
2686 assert_trap(() => invoke($32, `test`, [28]), `uninitialized element`);
2687
2688 // ./test/core/table_init.wast:1789
2689 assert_trap(() => invoke($32, `test`, [29]), `uninitialized element`);
2690
2691 // ./test/core/table_init.wast:1790
2692 assert_trap(() => invoke($32, `test`, [30]), `uninitialized element`);
2693
2694 // ./test/core/table_init.wast:1791
2695 assert_trap(() => invoke($32, `test`, [31]), `uninitialized element`);
2696
2697 // ./test/core/table_init.wast:1793
2698 let $33 = instantiate(`(module
2699 (type (func (result i32)))
2700 (table 160 320 funcref)
2701 (elem funcref
2702 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
2703 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
2704 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
2705 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
2706 (func $$f0 (export "f0") (result i32) (i32.const 0))
2707 (func $$f1 (export "f1") (result i32) (i32.const 1))
2708 (func $$f2 (export "f2") (result i32) (i32.const 2))
2709 (func $$f3 (export "f3") (result i32) (i32.const 3))
2710 (func $$f4 (export "f4") (result i32) (i32.const 4))
2711 (func $$f5 (export "f5") (result i32) (i32.const 5))
2712 (func $$f6 (export "f6") (result i32) (i32.const 6))
2713 (func $$f7 (export "f7") (result i32) (i32.const 7))
2714 (func $$f8 (export "f8") (result i32) (i32.const 8))
2715 (func $$f9 (export "f9") (result i32) (i32.const 9))
2716 (func $$f10 (export "f10") (result i32) (i32.const 10))
2717 (func $$f11 (export "f11") (result i32) (i32.const 11))
2718 (func $$f12 (export "f12") (result i32) (i32.const 12))
2719 (func $$f13 (export "f13") (result i32) (i32.const 13))
2720 (func $$f14 (export "f14") (result i32) (i32.const 14))
2721 (func $$f15 (export "f15") (result i32) (i32.const 15))
2722 (func (export "test") (param $$n i32) (result i32)
2723 (call_indirect (type 0) (local.get $$n)))
2724 (func (export "run") (param $$offs i32) (param $$len i32)
2725 (table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
2726
2727 // ./test/core/table_init.wast:1821
2728 assert_trap(() => invoke($33, `run`, [96, 32]), `out of bounds table access`);
2729
2730 // ./test/core/table_init.wast:1822
2731 assert_trap(() => invoke($33, `test`, [0]), `uninitialized element`);
2732
2733 // ./test/core/table_init.wast:1823
2734 assert_trap(() => invoke($33, `test`, [1]), `uninitialized element`);
2735
2736 // ./test/core/table_init.wast:1824
2737 assert_trap(() => invoke($33, `test`, [2]), `uninitialized element`);
2738
2739 // ./test/core/table_init.wast:1825
2740 assert_trap(() => invoke($33, `test`, [3]), `uninitialized element`);
2741
2742 // ./test/core/table_init.wast:1826
2743 assert_trap(() => invoke($33, `test`, [4]), `uninitialized element`);
2744
2745 // ./test/core/table_init.wast:1827
2746 assert_trap(() => invoke($33, `test`, [5]), `uninitialized element`);
2747
2748 // ./test/core/table_init.wast:1828
2749 assert_trap(() => invoke($33, `test`, [6]), `uninitialized element`);
2750
2751 // ./test/core/table_init.wast:1829
2752 assert_trap(() => invoke($33, `test`, [7]), `uninitialized element`);
2753
2754 // ./test/core/table_init.wast:1830
2755 assert_trap(() => invoke($33, `test`, [8]), `uninitialized element`);
2756
2757 // ./test/core/table_init.wast:1831
2758 assert_trap(() => invoke($33, `test`, [9]), `uninitialized element`);
2759
2760 // ./test/core/table_init.wast:1832
2761 assert_trap(() => invoke($33, `test`, [10]), `uninitialized element`);
2762
2763 // ./test/core/table_init.wast:1833
2764 assert_trap(() => invoke($33, `test`, [11]), `uninitialized element`);
2765
2766 // ./test/core/table_init.wast:1834
2767 assert_trap(() => invoke($33, `test`, [12]), `uninitialized element`);
2768
2769 // ./test/core/table_init.wast:1835
2770 assert_trap(() => invoke($33, `test`, [13]), `uninitialized element`);
2771
2772 // ./test/core/table_init.wast:1836
2773 assert_trap(() => invoke($33, `test`, [14]), `uninitialized element`);
2774
2775 // ./test/core/table_init.wast:1837
2776 assert_trap(() => invoke($33, `test`, [15]), `uninitialized element`);
2777
2778 // ./test/core/table_init.wast:1838
2779 assert_trap(() => invoke($33, `test`, [16]), `uninitialized element`);
2780
2781 // ./test/core/table_init.wast:1839
2782 assert_trap(() => invoke($33, `test`, [17]), `uninitialized element`);
2783
2784 // ./test/core/table_init.wast:1840
2785 assert_trap(() => invoke($33, `test`, [18]), `uninitialized element`);
2786
2787 // ./test/core/table_init.wast:1841
2788 assert_trap(() => invoke($33, `test`, [19]), `uninitialized element`);
2789
2790 // ./test/core/table_init.wast:1842
2791 assert_trap(() => invoke($33, `test`, [20]), `uninitialized element`);
2792
2793 // ./test/core/table_init.wast:1843
2794 assert_trap(() => invoke($33, `test`, [21]), `uninitialized element`);
2795
2796 // ./test/core/table_init.wast:1844
2797 assert_trap(() => invoke($33, `test`, [22]), `uninitialized element`);
2798
2799 // ./test/core/table_init.wast:1845
2800 assert_trap(() => invoke($33, `test`, [23]), `uninitialized element`);
2801
2802 // ./test/core/table_init.wast:1846
2803 assert_trap(() => invoke($33, `test`, [24]), `uninitialized element`);
2804
2805 // ./test/core/table_init.wast:1847
2806 assert_trap(() => invoke($33, `test`, [25]), `uninitialized element`);
2807
2808 // ./test/core/table_init.wast:1848
2809 assert_trap(() => invoke($33, `test`, [26]), `uninitialized element`);
2810
2811 // ./test/core/table_init.wast:1849
2812 assert_trap(() => invoke($33, `test`, [27]), `uninitialized element`);
2813
2814 // ./test/core/table_init.wast:1850
2815 assert_trap(() => invoke($33, `test`, [28]), `uninitialized element`);
2816
2817 // ./test/core/table_init.wast:1851
2818 assert_trap(() => invoke($33, `test`, [29]), `uninitialized element`);
2819
2820 // ./test/core/table_init.wast:1852
2821 assert_trap(() => invoke($33, `test`, [30]), `uninitialized element`);
2822
2823 // ./test/core/table_init.wast:1853
2824 assert_trap(() => invoke($33, `test`, [31]), `uninitialized element`);
2825
2826 // ./test/core/table_init.wast:1854
2827 assert_trap(() => invoke($33, `test`, [32]), `uninitialized element`);
2828
2829 // ./test/core/table_init.wast:1855
2830 assert_trap(() => invoke($33, `test`, [33]), `uninitialized element`);
2831
2832 // ./test/core/table_init.wast:1856
2833 assert_trap(() => invoke($33, `test`, [34]), `uninitialized element`);
2834
2835 // ./test/core/table_init.wast:1857
2836 assert_trap(() => invoke($33, `test`, [35]), `uninitialized element`);
2837
2838 // ./test/core/table_init.wast:1858
2839 assert_trap(() => invoke($33, `test`, [36]), `uninitialized element`);
2840
2841 // ./test/core/table_init.wast:1859
2842 assert_trap(() => invoke($33, `test`, [37]), `uninitialized element`);
2843
2844 // ./test/core/table_init.wast:1860
2845 assert_trap(() => invoke($33, `test`, [38]), `uninitialized element`);
2846
2847 // ./test/core/table_init.wast:1861
2848 assert_trap(() => invoke($33, `test`, [39]), `uninitialized element`);
2849
2850 // ./test/core/table_init.wast:1862
2851 assert_trap(() => invoke($33, `test`, [40]), `uninitialized element`);
2852
2853 // ./test/core/table_init.wast:1863
2854 assert_trap(() => invoke($33, `test`, [41]), `uninitialized element`);
2855
2856 // ./test/core/table_init.wast:1864
2857 assert_trap(() => invoke($33, `test`, [42]), `uninitialized element`);
2858
2859 // ./test/core/table_init.wast:1865
2860 assert_trap(() => invoke($33, `test`, [43]), `uninitialized element`);
2861
2862 // ./test/core/table_init.wast:1866
2863 assert_trap(() => invoke($33, `test`, [44]), `uninitialized element`);
2864
2865 // ./test/core/table_init.wast:1867
2866 assert_trap(() => invoke($33, `test`, [45]), `uninitialized element`);
2867
2868 // ./test/core/table_init.wast:1868
2869 assert_trap(() => invoke($33, `test`, [46]), `uninitialized element`);
2870
2871 // ./test/core/table_init.wast:1869
2872 assert_trap(() => invoke($33, `test`, [47]), `uninitialized element`);
2873
2874 // ./test/core/table_init.wast:1870
2875 assert_trap(() => invoke($33, `test`, [48]), `uninitialized element`);
2876
2877 // ./test/core/table_init.wast:1871
2878 assert_trap(() => invoke($33, `test`, [49]), `uninitialized element`);
2879
2880 // ./test/core/table_init.wast:1872
2881 assert_trap(() => invoke($33, `test`, [50]), `uninitialized element`);
2882
2883 // ./test/core/table_init.wast:1873
2884 assert_trap(() => invoke($33, `test`, [51]), `uninitialized element`);
2885
2886 // ./test/core/table_init.wast:1874
2887 assert_trap(() => invoke($33, `test`, [52]), `uninitialized element`);
2888
2889 // ./test/core/table_init.wast:1875
2890 assert_trap(() => invoke($33, `test`, [53]), `uninitialized element`);
2891
2892 // ./test/core/table_init.wast:1876
2893 assert_trap(() => invoke($33, `test`, [54]), `uninitialized element`);
2894
2895 // ./test/core/table_init.wast:1877
2896 assert_trap(() => invoke($33, `test`, [55]), `uninitialized element`);
2897
2898 // ./test/core/table_init.wast:1878
2899 assert_trap(() => invoke($33, `test`, [56]), `uninitialized element`);
2900
2901 // ./test/core/table_init.wast:1879
2902 assert_trap(() => invoke($33, `test`, [57]), `uninitialized element`);
2903
2904 // ./test/core/table_init.wast:1880
2905 assert_trap(() => invoke($33, `test`, [58]), `uninitialized element`);
2906
2907 // ./test/core/table_init.wast:1881
2908 assert_trap(() => invoke($33, `test`, [59]), `uninitialized element`);
2909
2910 // ./test/core/table_init.wast:1882
2911 assert_trap(() => invoke($33, `test`, [60]), `uninitialized element`);
2912
2913 // ./test/core/table_init.wast:1883
2914 assert_trap(() => invoke($33, `test`, [61]), `uninitialized element`);
2915
2916 // ./test/core/table_init.wast:1884
2917 assert_trap(() => invoke($33, `test`, [62]), `uninitialized element`);
2918
2919 // ./test/core/table_init.wast:1885
2920 assert_trap(() => invoke($33, `test`, [63]), `uninitialized element`);
2921
2922 // ./test/core/table_init.wast:1886
2923 assert_trap(() => invoke($33, `test`, [64]), `uninitialized element`);
2924
2925 // ./test/core/table_init.wast:1887
2926 assert_trap(() => invoke($33, `test`, [65]), `uninitialized element`);
2927
2928 // ./test/core/table_init.wast:1888
2929 assert_trap(() => invoke($33, `test`, [66]), `uninitialized element`);
2930
2931 // ./test/core/table_init.wast:1889
2932 assert_trap(() => invoke($33, `test`, [67]), `uninitialized element`);
2933
2934 // ./test/core/table_init.wast:1890
2935 assert_trap(() => invoke($33, `test`, [68]), `uninitialized element`);
2936
2937 // ./test/core/table_init.wast:1891
2938 assert_trap(() => invoke($33, `test`, [69]), `uninitialized element`);
2939
2940 // ./test/core/table_init.wast:1892
2941 assert_trap(() => invoke($33, `test`, [70]), `uninitialized element`);
2942
2943 // ./test/core/table_init.wast:1893
2944 assert_trap(() => invoke($33, `test`, [71]), `uninitialized element`);
2945
2946 // ./test/core/table_init.wast:1894
2947 assert_trap(() => invoke($33, `test`, [72]), `uninitialized element`);
2948
2949 // ./test/core/table_init.wast:1895
2950 assert_trap(() => invoke($33, `test`, [73]), `uninitialized element`);
2951
2952 // ./test/core/table_init.wast:1896
2953 assert_trap(() => invoke($33, `test`, [74]), `uninitialized element`);
2954
2955 // ./test/core/table_init.wast:1897
2956 assert_trap(() => invoke($33, `test`, [75]), `uninitialized element`);
2957
2958 // ./test/core/table_init.wast:1898
2959 assert_trap(() => invoke($33, `test`, [76]), `uninitialized element`);
2960
2961 // ./test/core/table_init.wast:1899
2962 assert_trap(() => invoke($33, `test`, [77]), `uninitialized element`);
2963
2964 // ./test/core/table_init.wast:1900
2965 assert_trap(() => invoke($33, `test`, [78]), `uninitialized element`);
2966
2967 // ./test/core/table_init.wast:1901
2968 assert_trap(() => invoke($33, `test`, [79]), `uninitialized element`);
2969
2970 // ./test/core/table_init.wast:1902
2971 assert_trap(() => invoke($33, `test`, [80]), `uninitialized element`);
2972
2973 // ./test/core/table_init.wast:1903
2974 assert_trap(() => invoke($33, `test`, [81]), `uninitialized element`);
2975
2976 // ./test/core/table_init.wast:1904
2977 assert_trap(() => invoke($33, `test`, [82]), `uninitialized element`);
2978
2979 // ./test/core/table_init.wast:1905
2980 assert_trap(() => invoke($33, `test`, [83]), `uninitialized element`);
2981
2982 // ./test/core/table_init.wast:1906
2983 assert_trap(() => invoke($33, `test`, [84]), `uninitialized element`);
2984
2985 // ./test/core/table_init.wast:1907
2986 assert_trap(() => invoke($33, `test`, [85]), `uninitialized element`);
2987
2988 // ./test/core/table_init.wast:1908
2989 assert_trap(() => invoke($33, `test`, [86]), `uninitialized element`);
2990
2991 // ./test/core/table_init.wast:1909
2992 assert_trap(() => invoke($33, `test`, [87]), `uninitialized element`);
2993
2994 // ./test/core/table_init.wast:1910
2995 assert_trap(() => invoke($33, `test`, [88]), `uninitialized element`);
2996
2997 // ./test/core/table_init.wast:1911
2998 assert_trap(() => invoke($33, `test`, [89]), `uninitialized element`);
2999
3000 // ./test/core/table_init.wast:1912
3001 assert_trap(() => invoke($33, `test`, [90]), `uninitialized element`);
3002
3003 // ./test/core/table_init.wast:1913
3004 assert_trap(() => invoke($33, `test`, [91]), `uninitialized element`);
3005
3006 // ./test/core/table_init.wast:1914
3007 assert_trap(() => invoke($33, `test`, [92]), `uninitialized element`);
3008
3009 // ./test/core/table_init.wast:1915
3010 assert_trap(() => invoke($33, `test`, [93]), `uninitialized element`);
3011
3012 // ./test/core/table_init.wast:1916
3013 assert_trap(() => invoke($33, `test`, [94]), `uninitialized element`);
3014
3015 // ./test/core/table_init.wast:1917
3016 assert_trap(() => invoke($33, `test`, [95]), `uninitialized element`);
3017
3018 // ./test/core/table_init.wast:1918
3019 assert_trap(() => invoke($33, `test`, [96]), `uninitialized element`);
3020
3021 // ./test/core/table_init.wast:1919
3022 assert_trap(() => invoke($33, `test`, [97]), `uninitialized element`);
3023
3024 // ./test/core/table_init.wast:1920
3025 assert_trap(() => invoke($33, `test`, [98]), `uninitialized element`);
3026
3027 // ./test/core/table_init.wast:1921
3028 assert_trap(() => invoke($33, `test`, [99]), `uninitialized element`);
3029
3030 // ./test/core/table_init.wast:1922
3031 assert_trap(() => invoke($33, `test`, [100]), `uninitialized element`);
3032
3033 // ./test/core/table_init.wast:1923
3034 assert_trap(() => invoke($33, `test`, [101]), `uninitialized element`);
3035
3036 // ./test/core/table_init.wast:1924
3037 assert_trap(() => invoke($33, `test`, [102]), `uninitialized element`);
3038
3039 // ./test/core/table_init.wast:1925
3040 assert_trap(() => invoke($33, `test`, [103]), `uninitialized element`);
3041
3042 // ./test/core/table_init.wast:1926
3043 assert_trap(() => invoke($33, `test`, [104]), `uninitialized element`);
3044
3045 // ./test/core/table_init.wast:1927
3046 assert_trap(() => invoke($33, `test`, [105]), `uninitialized element`);
3047
3048 // ./test/core/table_init.wast:1928
3049 assert_trap(() => invoke($33, `test`, [106]), `uninitialized element`);
3050
3051 // ./test/core/table_init.wast:1929
3052 assert_trap(() => invoke($33, `test`, [107]), `uninitialized element`);
3053
3054 // ./test/core/table_init.wast:1930
3055 assert_trap(() => invoke($33, `test`, [108]), `uninitialized element`);
3056
3057 // ./test/core/table_init.wast:1931
3058 assert_trap(() => invoke($33, `test`, [109]), `uninitialized element`);
3059
3060 // ./test/core/table_init.wast:1932
3061 assert_trap(() => invoke($33, `test`, [110]), `uninitialized element`);
3062
3063 // ./test/core/table_init.wast:1933
3064 assert_trap(() => invoke($33, `test`, [111]), `uninitialized element`);
3065
3066 // ./test/core/table_init.wast:1934
3067 assert_trap(() => invoke($33, `test`, [112]), `uninitialized element`);
3068
3069 // ./test/core/table_init.wast:1935
3070 assert_trap(() => invoke($33, `test`, [113]), `uninitialized element`);
3071
3072 // ./test/core/table_init.wast:1936
3073 assert_trap(() => invoke($33, `test`, [114]), `uninitialized element`);
3074
3075 // ./test/core/table_init.wast:1937
3076 assert_trap(() => invoke($33, `test`, [115]), `uninitialized element`);
3077
3078 // ./test/core/table_init.wast:1938
3079 assert_trap(() => invoke($33, `test`, [116]), `uninitialized element`);
3080
3081 // ./test/core/table_init.wast:1939
3082 assert_trap(() => invoke($33, `test`, [117]), `uninitialized element`);
3083
3084 // ./test/core/table_init.wast:1940
3085 assert_trap(() => invoke($33, `test`, [118]), `uninitialized element`);
3086
3087 // ./test/core/table_init.wast:1941
3088 assert_trap(() => invoke($33, `test`, [119]), `uninitialized element`);
3089
3090 // ./test/core/table_init.wast:1942
3091 assert_trap(() => invoke($33, `test`, [120]), `uninitialized element`);
3092
3093 // ./test/core/table_init.wast:1943
3094 assert_trap(() => invoke($33, `test`, [121]), `uninitialized element`);
3095
3096 // ./test/core/table_init.wast:1944
3097 assert_trap(() => invoke($33, `test`, [122]), `uninitialized element`);
3098
3099 // ./test/core/table_init.wast:1945
3100 assert_trap(() => invoke($33, `test`, [123]), `uninitialized element`);
3101
3102 // ./test/core/table_init.wast:1946
3103 assert_trap(() => invoke($33, `test`, [124]), `uninitialized element`);
3104
3105 // ./test/core/table_init.wast:1947
3106 assert_trap(() => invoke($33, `test`, [125]), `uninitialized element`);
3107
3108 // ./test/core/table_init.wast:1948
3109 assert_trap(() => invoke($33, `test`, [126]), `uninitialized element`);
3110
3111 // ./test/core/table_init.wast:1949
3112 assert_trap(() => invoke($33, `test`, [127]), `uninitialized element`);
3113
3114 // ./test/core/table_init.wast:1950
3115 assert_trap(() => invoke($33, `test`, [128]), `uninitialized element`);
3116
3117 // ./test/core/table_init.wast:1951
3118 assert_trap(() => invoke($33, `test`, [129]), `uninitialized element`);
3119
3120 // ./test/core/table_init.wast:1952
3121 assert_trap(() => invoke($33, `test`, [130]), `uninitialized element`);
3122
3123 // ./test/core/table_init.wast:1953
3124 assert_trap(() => invoke($33, `test`, [131]), `uninitialized element`);
3125
3126 // ./test/core/table_init.wast:1954
3127 assert_trap(() => invoke($33, `test`, [132]), `uninitialized element`);
3128
3129 // ./test/core/table_init.wast:1955
3130 assert_trap(() => invoke($33, `test`, [133]), `uninitialized element`);
3131
3132 // ./test/core/table_init.wast:1956
3133 assert_trap(() => invoke($33, `test`, [134]), `uninitialized element`);
3134
3135 // ./test/core/table_init.wast:1957
3136 assert_trap(() => invoke($33, `test`, [135]), `uninitialized element`);
3137
3138 // ./test/core/table_init.wast:1958
3139 assert_trap(() => invoke($33, `test`, [136]), `uninitialized element`);
3140
3141 // ./test/core/table_init.wast:1959
3142 assert_trap(() => invoke($33, `test`, [137]), `uninitialized element`);
3143
3144 // ./test/core/table_init.wast:1960
3145 assert_trap(() => invoke($33, `test`, [138]), `uninitialized element`);
3146
3147 // ./test/core/table_init.wast:1961
3148 assert_trap(() => invoke($33, `test`, [139]), `uninitialized element`);
3149
3150 // ./test/core/table_init.wast:1962
3151 assert_trap(() => invoke($33, `test`, [140]), `uninitialized element`);
3152
3153 // ./test/core/table_init.wast:1963
3154 assert_trap(() => invoke($33, `test`, [141]), `uninitialized element`);
3155
3156 // ./test/core/table_init.wast:1964
3157 assert_trap(() => invoke($33, `test`, [142]), `uninitialized element`);
3158
3159 // ./test/core/table_init.wast:1965
3160 assert_trap(() => invoke($33, `test`, [143]), `uninitialized element`);
3161
3162 // ./test/core/table_init.wast:1966
3163 assert_trap(() => invoke($33, `test`, [144]), `uninitialized element`);
3164
3165 // ./test/core/table_init.wast:1967
3166 assert_trap(() => invoke($33, `test`, [145]), `uninitialized element`);
3167
3168 // ./test/core/table_init.wast:1968
3169 assert_trap(() => invoke($33, `test`, [146]), `uninitialized element`);
3170
3171 // ./test/core/table_init.wast:1969
3172 assert_trap(() => invoke($33, `test`, [147]), `uninitialized element`);
3173
3174 // ./test/core/table_init.wast:1970
3175 assert_trap(() => invoke($33, `test`, [148]), `uninitialized element`);
3176
3177 // ./test/core/table_init.wast:1971
3178 assert_trap(() => invoke($33, `test`, [149]), `uninitialized element`);
3179
3180 // ./test/core/table_init.wast:1972
3181 assert_trap(() => invoke($33, `test`, [150]), `uninitialized element`);
3182
3183 // ./test/core/table_init.wast:1973
3184 assert_trap(() => invoke($33, `test`, [151]), `uninitialized element`);
3185
3186 // ./test/core/table_init.wast:1974
3187 assert_trap(() => invoke($33, `test`, [152]), `uninitialized element`);
3188
3189 // ./test/core/table_init.wast:1975
3190 assert_trap(() => invoke($33, `test`, [153]), `uninitialized element`);
3191
3192 // ./test/core/table_init.wast:1976
3193 assert_trap(() => invoke($33, `test`, [154]), `uninitialized element`);
3194
3195 // ./test/core/table_init.wast:1977
3196 assert_trap(() => invoke($33, `test`, [155]), `uninitialized element`);
3197
3198 // ./test/core/table_init.wast:1978
3199 assert_trap(() => invoke($33, `test`, [156]), `uninitialized element`);
3200
3201 // ./test/core/table_init.wast:1979
3202 assert_trap(() => invoke($33, `test`, [157]), `uninitialized element`);
3203
3204 // ./test/core/table_init.wast:1980
3205 assert_trap(() => invoke($33, `test`, [158]), `uninitialized element`);
3206
3207 // ./test/core/table_init.wast:1981
3208 assert_trap(() => invoke($33, `test`, [159]), `uninitialized element`);
3209
3210 // ./test/core/table_init.wast:1983
3211 let $34 = instantiate(`(module
3212 (type (func (result i32)))
3213 (table 160 320 funcref)
3214 (elem funcref
3215 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
3216 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
3217 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
3218 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
3219 (func $$f0 (export "f0") (result i32) (i32.const 0))
3220 (func $$f1 (export "f1") (result i32) (i32.const 1))
3221 (func $$f2 (export "f2") (result i32) (i32.const 2))
3222 (func $$f3 (export "f3") (result i32) (i32.const 3))
3223 (func $$f4 (export "f4") (result i32) (i32.const 4))
3224 (func $$f5 (export "f5") (result i32) (i32.const 5))
3225 (func $$f6 (export "f6") (result i32) (i32.const 6))
3226 (func $$f7 (export "f7") (result i32) (i32.const 7))
3227 (func $$f8 (export "f8") (result i32) (i32.const 8))
3228 (func $$f9 (export "f9") (result i32) (i32.const 9))
3229 (func $$f10 (export "f10") (result i32) (i32.const 10))
3230 (func $$f11 (export "f11") (result i32) (i32.const 11))
3231 (func $$f12 (export "f12") (result i32) (i32.const 12))
3232 (func $$f13 (export "f13") (result i32) (i32.const 13))
3233 (func $$f14 (export "f14") (result i32) (i32.const 14))
3234 (func $$f15 (export "f15") (result i32) (i32.const 15))
3235 (func (export "test") (param $$n i32) (result i32)
3236 (call_indirect (type 0) (local.get $$n)))
3237 (func (export "run") (param $$offs i32) (param $$len i32)
3238 (table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
3239
3240 // ./test/core/table_init.wast:2011
3241 assert_trap(() => invoke($34, `run`, [97, 31]), `out of bounds table access`);
3242
3243 // ./test/core/table_init.wast:2012
3244 assert_trap(() => invoke($34, `test`, [0]), `uninitialized element`);
3245
3246 // ./test/core/table_init.wast:2013
3247 assert_trap(() => invoke($34, `test`, [1]), `uninitialized element`);
3248
3249 // ./test/core/table_init.wast:2014
3250 assert_trap(() => invoke($34, `test`, [2]), `uninitialized element`);
3251
3252 // ./test/core/table_init.wast:2015
3253 assert_trap(() => invoke($34, `test`, [3]), `uninitialized element`);
3254
3255 // ./test/core/table_init.wast:2016
3256 assert_trap(() => invoke($34, `test`, [4]), `uninitialized element`);
3257
3258 // ./test/core/table_init.wast:2017
3259 assert_trap(() => invoke($34, `test`, [5]), `uninitialized element`);
3260
3261 // ./test/core/table_init.wast:2018
3262 assert_trap(() => invoke($34, `test`, [6]), `uninitialized element`);
3263
3264 // ./test/core/table_init.wast:2019
3265 assert_trap(() => invoke($34, `test`, [7]), `uninitialized element`);
3266
3267 // ./test/core/table_init.wast:2020
3268 assert_trap(() => invoke($34, `test`, [8]), `uninitialized element`);
3269
3270 // ./test/core/table_init.wast:2021
3271 assert_trap(() => invoke($34, `test`, [9]), `uninitialized element`);
3272
3273 // ./test/core/table_init.wast:2022
3274 assert_trap(() => invoke($34, `test`, [10]), `uninitialized element`);
3275
3276 // ./test/core/table_init.wast:2023
3277 assert_trap(() => invoke($34, `test`, [11]), `uninitialized element`);
3278
3279 // ./test/core/table_init.wast:2024
3280 assert_trap(() => invoke($34, `test`, [12]), `uninitialized element`);
3281
3282 // ./test/core/table_init.wast:2025
3283 assert_trap(() => invoke($34, `test`, [13]), `uninitialized element`);
3284
3285 // ./test/core/table_init.wast:2026
3286 assert_trap(() => invoke($34, `test`, [14]), `uninitialized element`);
3287
3288 // ./test/core/table_init.wast:2027
3289 assert_trap(() => invoke($34, `test`, [15]), `uninitialized element`);
3290
3291 // ./test/core/table_init.wast:2028
3292 assert_trap(() => invoke($34, `test`, [16]), `uninitialized element`);
3293
3294 // ./test/core/table_init.wast:2029
3295 assert_trap(() => invoke($34, `test`, [17]), `uninitialized element`);
3296
3297 // ./test/core/table_init.wast:2030
3298 assert_trap(() => invoke($34, `test`, [18]), `uninitialized element`);
3299
3300 // ./test/core/table_init.wast:2031
3301 assert_trap(() => invoke($34, `test`, [19]), `uninitialized element`);
3302
3303 // ./test/core/table_init.wast:2032
3304 assert_trap(() => invoke($34, `test`, [20]), `uninitialized element`);
3305
3306 // ./test/core/table_init.wast:2033
3307 assert_trap(() => invoke($34, `test`, [21]), `uninitialized element`);
3308
3309 // ./test/core/table_init.wast:2034
3310 assert_trap(() => invoke($34, `test`, [22]), `uninitialized element`);
3311
3312 // ./test/core/table_init.wast:2035
3313 assert_trap(() => invoke($34, `test`, [23]), `uninitialized element`);
3314
3315 // ./test/core/table_init.wast:2036
3316 assert_trap(() => invoke($34, `test`, [24]), `uninitialized element`);
3317
3318 // ./test/core/table_init.wast:2037
3319 assert_trap(() => invoke($34, `test`, [25]), `uninitialized element`);
3320
3321 // ./test/core/table_init.wast:2038
3322 assert_trap(() => invoke($34, `test`, [26]), `uninitialized element`);
3323
3324 // ./test/core/table_init.wast:2039
3325 assert_trap(() => invoke($34, `test`, [27]), `uninitialized element`);
3326
3327 // ./test/core/table_init.wast:2040
3328 assert_trap(() => invoke($34, `test`, [28]), `uninitialized element`);
3329
3330 // ./test/core/table_init.wast:2041
3331 assert_trap(() => invoke($34, `test`, [29]), `uninitialized element`);
3332
3333 // ./test/core/table_init.wast:2042
3334 assert_trap(() => invoke($34, `test`, [30]), `uninitialized element`);
3335
3336 // ./test/core/table_init.wast:2043
3337 assert_trap(() => invoke($34, `test`, [31]), `uninitialized element`);
3338
3339 // ./test/core/table_init.wast:2044
3340 assert_trap(() => invoke($34, `test`, [32]), `uninitialized element`);
3341
3342 // ./test/core/table_init.wast:2045
3343 assert_trap(() => invoke($34, `test`, [33]), `uninitialized element`);
3344
3345 // ./test/core/table_init.wast:2046
3346 assert_trap(() => invoke($34, `test`, [34]), `uninitialized element`);
3347
3348 // ./test/core/table_init.wast:2047
3349 assert_trap(() => invoke($34, `test`, [35]), `uninitialized element`);
3350
3351 // ./test/core/table_init.wast:2048
3352 assert_trap(() => invoke($34, `test`, [36]), `uninitialized element`);
3353
3354 // ./test/core/table_init.wast:2049
3355 assert_trap(() => invoke($34, `test`, [37]), `uninitialized element`);
3356
3357 // ./test/core/table_init.wast:2050
3358 assert_trap(() => invoke($34, `test`, [38]), `uninitialized element`);
3359
3360 // ./test/core/table_init.wast:2051
3361 assert_trap(() => invoke($34, `test`, [39]), `uninitialized element`);
3362
3363 // ./test/core/table_init.wast:2052
3364 assert_trap(() => invoke($34, `test`, [40]), `uninitialized element`);
3365
3366 // ./test/core/table_init.wast:2053
3367 assert_trap(() => invoke($34, `test`, [41]), `uninitialized element`);
3368
3369 // ./test/core/table_init.wast:2054
3370 assert_trap(() => invoke($34, `test`, [42]), `uninitialized element`);
3371
3372 // ./test/core/table_init.wast:2055
3373 assert_trap(() => invoke($34, `test`, [43]), `uninitialized element`);
3374
3375 // ./test/core/table_init.wast:2056
3376 assert_trap(() => invoke($34, `test`, [44]), `uninitialized element`);
3377
3378 // ./test/core/table_init.wast:2057
3379 assert_trap(() => invoke($34, `test`, [45]), `uninitialized element`);
3380
3381 // ./test/core/table_init.wast:2058
3382 assert_trap(() => invoke($34, `test`, [46]), `uninitialized element`);
3383
3384 // ./test/core/table_init.wast:2059
3385 assert_trap(() => invoke($34, `test`, [47]), `uninitialized element`);
3386
3387 // ./test/core/table_init.wast:2060
3388 assert_trap(() => invoke($34, `test`, [48]), `uninitialized element`);
3389
3390 // ./test/core/table_init.wast:2061
3391 assert_trap(() => invoke($34, `test`, [49]), `uninitialized element`);
3392
3393 // ./test/core/table_init.wast:2062
3394 assert_trap(() => invoke($34, `test`, [50]), `uninitialized element`);
3395
3396 // ./test/core/table_init.wast:2063
3397 assert_trap(() => invoke($34, `test`, [51]), `uninitialized element`);
3398
3399 // ./test/core/table_init.wast:2064
3400 assert_trap(() => invoke($34, `test`, [52]), `uninitialized element`);
3401
3402 // ./test/core/table_init.wast:2065
3403 assert_trap(() => invoke($34, `test`, [53]), `uninitialized element`);
3404
3405 // ./test/core/table_init.wast:2066
3406 assert_trap(() => invoke($34, `test`, [54]), `uninitialized element`);
3407
3408 // ./test/core/table_init.wast:2067
3409 assert_trap(() => invoke($34, `test`, [55]), `uninitialized element`);
3410
3411 // ./test/core/table_init.wast:2068
3412 assert_trap(() => invoke($34, `test`, [56]), `uninitialized element`);
3413
3414 // ./test/core/table_init.wast:2069
3415 assert_trap(() => invoke($34, `test`, [57]), `uninitialized element`);
3416
3417 // ./test/core/table_init.wast:2070
3418 assert_trap(() => invoke($34, `test`, [58]), `uninitialized element`);
3419
3420 // ./test/core/table_init.wast:2071
3421 assert_trap(() => invoke($34, `test`, [59]), `uninitialized element`);
3422
3423 // ./test/core/table_init.wast:2072
3424 assert_trap(() => invoke($34, `test`, [60]), `uninitialized element`);
3425
3426 // ./test/core/table_init.wast:2073
3427 assert_trap(() => invoke($34, `test`, [61]), `uninitialized element`);
3428
3429 // ./test/core/table_init.wast:2074
3430 assert_trap(() => invoke($34, `test`, [62]), `uninitialized element`);
3431
3432 // ./test/core/table_init.wast:2075
3433 assert_trap(() => invoke($34, `test`, [63]), `uninitialized element`);
3434
3435 // ./test/core/table_init.wast:2076
3436 assert_trap(() => invoke($34, `test`, [64]), `uninitialized element`);
3437
3438 // ./test/core/table_init.wast:2077
3439 assert_trap(() => invoke($34, `test`, [65]), `uninitialized element`);
3440
3441 // ./test/core/table_init.wast:2078
3442 assert_trap(() => invoke($34, `test`, [66]), `uninitialized element`);
3443
3444 // ./test/core/table_init.wast:2079
3445 assert_trap(() => invoke($34, `test`, [67]), `uninitialized element`);
3446
3447 // ./test/core/table_init.wast:2080
3448 assert_trap(() => invoke($34, `test`, [68]), `uninitialized element`);
3449
3450 // ./test/core/table_init.wast:2081
3451 assert_trap(() => invoke($34, `test`, [69]), `uninitialized element`);
3452
3453 // ./test/core/table_init.wast:2082
3454 assert_trap(() => invoke($34, `test`, [70]), `uninitialized element`);
3455
3456 // ./test/core/table_init.wast:2083
3457 assert_trap(() => invoke($34, `test`, [71]), `uninitialized element`);
3458
3459 // ./test/core/table_init.wast:2084
3460 assert_trap(() => invoke($34, `test`, [72]), `uninitialized element`);
3461
3462 // ./test/core/table_init.wast:2085
3463 assert_trap(() => invoke($34, `test`, [73]), `uninitialized element`);
3464
3465 // ./test/core/table_init.wast:2086
3466 assert_trap(() => invoke($34, `test`, [74]), `uninitialized element`);
3467
3468 // ./test/core/table_init.wast:2087
3469 assert_trap(() => invoke($34, `test`, [75]), `uninitialized element`);
3470
3471 // ./test/core/table_init.wast:2088
3472 assert_trap(() => invoke($34, `test`, [76]), `uninitialized element`);
3473
3474 // ./test/core/table_init.wast:2089
3475 assert_trap(() => invoke($34, `test`, [77]), `uninitialized element`);
3476
3477 // ./test/core/table_init.wast:2090
3478 assert_trap(() => invoke($34, `test`, [78]), `uninitialized element`);
3479
3480 // ./test/core/table_init.wast:2091
3481 assert_trap(() => invoke($34, `test`, [79]), `uninitialized element`);
3482
3483 // ./test/core/table_init.wast:2092
3484 assert_trap(() => invoke($34, `test`, [80]), `uninitialized element`);
3485
3486 // ./test/core/table_init.wast:2093
3487 assert_trap(() => invoke($34, `test`, [81]), `uninitialized element`);
3488
3489 // ./test/core/table_init.wast:2094
3490 assert_trap(() => invoke($34, `test`, [82]), `uninitialized element`);
3491
3492 // ./test/core/table_init.wast:2095
3493 assert_trap(() => invoke($34, `test`, [83]), `uninitialized element`);
3494
3495 // ./test/core/table_init.wast:2096
3496 assert_trap(() => invoke($34, `test`, [84]), `uninitialized element`);
3497
3498 // ./test/core/table_init.wast:2097
3499 assert_trap(() => invoke($34, `test`, [85]), `uninitialized element`);
3500
3501 // ./test/core/table_init.wast:2098
3502 assert_trap(() => invoke($34, `test`, [86]), `uninitialized element`);
3503
3504 // ./test/core/table_init.wast:2099
3505 assert_trap(() => invoke($34, `test`, [87]), `uninitialized element`);
3506
3507 // ./test/core/table_init.wast:2100
3508 assert_trap(() => invoke($34, `test`, [88]), `uninitialized element`);
3509
3510 // ./test/core/table_init.wast:2101
3511 assert_trap(() => invoke($34, `test`, [89]), `uninitialized element`);
3512
3513 // ./test/core/table_init.wast:2102
3514 assert_trap(() => invoke($34, `test`, [90]), `uninitialized element`);
3515
3516 // ./test/core/table_init.wast:2103
3517 assert_trap(() => invoke($34, `test`, [91]), `uninitialized element`);
3518
3519 // ./test/core/table_init.wast:2104
3520 assert_trap(() => invoke($34, `test`, [92]), `uninitialized element`);
3521
3522 // ./test/core/table_init.wast:2105
3523 assert_trap(() => invoke($34, `test`, [93]), `uninitialized element`);
3524
3525 // ./test/core/table_init.wast:2106
3526 assert_trap(() => invoke($34, `test`, [94]), `uninitialized element`);
3527
3528 // ./test/core/table_init.wast:2107
3529 assert_trap(() => invoke($34, `test`, [95]), `uninitialized element`);
3530
3531 // ./test/core/table_init.wast:2108
3532 assert_trap(() => invoke($34, `test`, [96]), `uninitialized element`);
3533
3534 // ./test/core/table_init.wast:2109
3535 assert_trap(() => invoke($34, `test`, [97]), `uninitialized element`);
3536
3537 // ./test/core/table_init.wast:2110
3538 assert_trap(() => invoke($34, `test`, [98]), `uninitialized element`);
3539
3540 // ./test/core/table_init.wast:2111
3541 assert_trap(() => invoke($34, `test`, [99]), `uninitialized element`);
3542
3543 // ./test/core/table_init.wast:2112
3544 assert_trap(() => invoke($34, `test`, [100]), `uninitialized element`);
3545
3546 // ./test/core/table_init.wast:2113
3547 assert_trap(() => invoke($34, `test`, [101]), `uninitialized element`);
3548
3549 // ./test/core/table_init.wast:2114
3550 assert_trap(() => invoke($34, `test`, [102]), `uninitialized element`);
3551
3552 // ./test/core/table_init.wast:2115
3553 assert_trap(() => invoke($34, `test`, [103]), `uninitialized element`);
3554
3555 // ./test/core/table_init.wast:2116
3556 assert_trap(() => invoke($34, `test`, [104]), `uninitialized element`);
3557
3558 // ./test/core/table_init.wast:2117
3559 assert_trap(() => invoke($34, `test`, [105]), `uninitialized element`);
3560
3561 // ./test/core/table_init.wast:2118
3562 assert_trap(() => invoke($34, `test`, [106]), `uninitialized element`);
3563
3564 // ./test/core/table_init.wast:2119
3565 assert_trap(() => invoke($34, `test`, [107]), `uninitialized element`);
3566
3567 // ./test/core/table_init.wast:2120
3568 assert_trap(() => invoke($34, `test`, [108]), `uninitialized element`);
3569
3570 // ./test/core/table_init.wast:2121
3571 assert_trap(() => invoke($34, `test`, [109]), `uninitialized element`);
3572
3573 // ./test/core/table_init.wast:2122
3574 assert_trap(() => invoke($34, `test`, [110]), `uninitialized element`);
3575
3576 // ./test/core/table_init.wast:2123
3577 assert_trap(() => invoke($34, `test`, [111]), `uninitialized element`);
3578
3579 // ./test/core/table_init.wast:2124
3580 assert_trap(() => invoke($34, `test`, [112]), `uninitialized element`);
3581
3582 // ./test/core/table_init.wast:2125
3583 assert_trap(() => invoke($34, `test`, [113]), `uninitialized element`);
3584
3585 // ./test/core/table_init.wast:2126
3586 assert_trap(() => invoke($34, `test`, [114]), `uninitialized element`);
3587
3588 // ./test/core/table_init.wast:2127
3589 assert_trap(() => invoke($34, `test`, [115]), `uninitialized element`);
3590
3591 // ./test/core/table_init.wast:2128
3592 assert_trap(() => invoke($34, `test`, [116]), `uninitialized element`);
3593
3594 // ./test/core/table_init.wast:2129
3595 assert_trap(() => invoke($34, `test`, [117]), `uninitialized element`);
3596
3597 // ./test/core/table_init.wast:2130
3598 assert_trap(() => invoke($34, `test`, [118]), `uninitialized element`);
3599
3600 // ./test/core/table_init.wast:2131
3601 assert_trap(() => invoke($34, `test`, [119]), `uninitialized element`);
3602
3603 // ./test/core/table_init.wast:2132
3604 assert_trap(() => invoke($34, `test`, [120]), `uninitialized element`);
3605
3606 // ./test/core/table_init.wast:2133
3607 assert_trap(() => invoke($34, `test`, [121]), `uninitialized element`);
3608
3609 // ./test/core/table_init.wast:2134
3610 assert_trap(() => invoke($34, `test`, [122]), `uninitialized element`);
3611
3612 // ./test/core/table_init.wast:2135
3613 assert_trap(() => invoke($34, `test`, [123]), `uninitialized element`);
3614
3615 // ./test/core/table_init.wast:2136
3616 assert_trap(() => invoke($34, `test`, [124]), `uninitialized element`);
3617
3618 // ./test/core/table_init.wast:2137
3619 assert_trap(() => invoke($34, `test`, [125]), `uninitialized element`);
3620
3621 // ./test/core/table_init.wast:2138
3622 assert_trap(() => invoke($34, `test`, [126]), `uninitialized element`);
3623
3624 // ./test/core/table_init.wast:2139
3625 assert_trap(() => invoke($34, `test`, [127]), `uninitialized element`);
3626
3627 // ./test/core/table_init.wast:2140
3628 assert_trap(() => invoke($34, `test`, [128]), `uninitialized element`);
3629
3630 // ./test/core/table_init.wast:2141
3631 assert_trap(() => invoke($34, `test`, [129]), `uninitialized element`);
3632
3633 // ./test/core/table_init.wast:2142
3634 assert_trap(() => invoke($34, `test`, [130]), `uninitialized element`);
3635
3636 // ./test/core/table_init.wast:2143
3637 assert_trap(() => invoke($34, `test`, [131]), `uninitialized element`);
3638
3639 // ./test/core/table_init.wast:2144
3640 assert_trap(() => invoke($34, `test`, [132]), `uninitialized element`);
3641
3642 // ./test/core/table_init.wast:2145
3643 assert_trap(() => invoke($34, `test`, [133]), `uninitialized element`);
3644
3645 // ./test/core/table_init.wast:2146
3646 assert_trap(() => invoke($34, `test`, [134]), `uninitialized element`);
3647
3648 // ./test/core/table_init.wast:2147
3649 assert_trap(() => invoke($34, `test`, [135]), `uninitialized element`);
3650
3651 // ./test/core/table_init.wast:2148
3652 assert_trap(() => invoke($34, `test`, [136]), `uninitialized element`);
3653
3654 // ./test/core/table_init.wast:2149
3655 assert_trap(() => invoke($34, `test`, [137]), `uninitialized element`);
3656
3657 // ./test/core/table_init.wast:2150
3658 assert_trap(() => invoke($34, `test`, [138]), `uninitialized element`);
3659
3660 // ./test/core/table_init.wast:2151
3661 assert_trap(() => invoke($34, `test`, [139]), `uninitialized element`);
3662
3663 // ./test/core/table_init.wast:2152
3664 assert_trap(() => invoke($34, `test`, [140]), `uninitialized element`);
3665
3666 // ./test/core/table_init.wast:2153
3667 assert_trap(() => invoke($34, `test`, [141]), `uninitialized element`);
3668
3669 // ./test/core/table_init.wast:2154
3670 assert_trap(() => invoke($34, `test`, [142]), `uninitialized element`);
3671
3672 // ./test/core/table_init.wast:2155
3673 assert_trap(() => invoke($34, `test`, [143]), `uninitialized element`);
3674
3675 // ./test/core/table_init.wast:2156
3676 assert_trap(() => invoke($34, `test`, [144]), `uninitialized element`);
3677
3678 // ./test/core/table_init.wast:2157
3679 assert_trap(() => invoke($34, `test`, [145]), `uninitialized element`);
3680
3681 // ./test/core/table_init.wast:2158
3682 assert_trap(() => invoke($34, `test`, [146]), `uninitialized element`);
3683
3684 // ./test/core/table_init.wast:2159
3685 assert_trap(() => invoke($34, `test`, [147]), `uninitialized element`);
3686
3687 // ./test/core/table_init.wast:2160
3688 assert_trap(() => invoke($34, `test`, [148]), `uninitialized element`);
3689
3690 // ./test/core/table_init.wast:2161
3691 assert_trap(() => invoke($34, `test`, [149]), `uninitialized element`);
3692
3693 // ./test/core/table_init.wast:2162
3694 assert_trap(() => invoke($34, `test`, [150]), `uninitialized element`);
3695
3696 // ./test/core/table_init.wast:2163
3697 assert_trap(() => invoke($34, `test`, [151]), `uninitialized element`);
3698
3699 // ./test/core/table_init.wast:2164
3700 assert_trap(() => invoke($34, `test`, [152]), `uninitialized element`);
3701
3702 // ./test/core/table_init.wast:2165
3703 assert_trap(() => invoke($34, `test`, [153]), `uninitialized element`);
3704
3705 // ./test/core/table_init.wast:2166
3706 assert_trap(() => invoke($34, `test`, [154]), `uninitialized element`);
3707
3708 // ./test/core/table_init.wast:2167
3709 assert_trap(() => invoke($34, `test`, [155]), `uninitialized element`);
3710
3711 // ./test/core/table_init.wast:2168
3712 assert_trap(() => invoke($34, `test`, [156]), `uninitialized element`);
3713
3714 // ./test/core/table_init.wast:2169
3715 assert_trap(() => invoke($34, `test`, [157]), `uninitialized element`);
3716
3717 // ./test/core/table_init.wast:2170
3718 assert_trap(() => invoke($34, `test`, [158]), `uninitialized element`);
3719
3720 // ./test/core/table_init.wast:2171
3721 assert_trap(() => invoke($34, `test`, [159]), `uninitialized element`);
3722
3723 // ./test/core/table_init.wast:2173
3724 let $35 = instantiate(`(module
3725 (type (func (result i32)))
3726 (table 64 64 funcref)
3727 (elem funcref
3728 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
3729 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
3730 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
3731 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
3732 (func $$f0 (export "f0") (result i32) (i32.const 0))
3733 (func $$f1 (export "f1") (result i32) (i32.const 1))
3734 (func $$f2 (export "f2") (result i32) (i32.const 2))
3735 (func $$f3 (export "f3") (result i32) (i32.const 3))
3736 (func $$f4 (export "f4") (result i32) (i32.const 4))
3737 (func $$f5 (export "f5") (result i32) (i32.const 5))
3738 (func $$f6 (export "f6") (result i32) (i32.const 6))
3739 (func $$f7 (export "f7") (result i32) (i32.const 7))
3740 (func $$f8 (export "f8") (result i32) (i32.const 8))
3741 (func $$f9 (export "f9") (result i32) (i32.const 9))
3742 (func $$f10 (export "f10") (result i32) (i32.const 10))
3743 (func $$f11 (export "f11") (result i32) (i32.const 11))
3744 (func $$f12 (export "f12") (result i32) (i32.const 12))
3745 (func $$f13 (export "f13") (result i32) (i32.const 13))
3746 (func $$f14 (export "f14") (result i32) (i32.const 14))
3747 (func $$f15 (export "f15") (result i32) (i32.const 15))
3748 (func (export "test") (param $$n i32) (result i32)
3749 (call_indirect (type 0) (local.get $$n)))
3750 (func (export "run") (param $$offs i32) (param $$len i32)
3751 (table.init 0 (local.get $$offs) (i32.const 0) (local.get $$len))))`);
3752
3753 // ./test/core/table_init.wast:2201
3754 assert_trap(() => invoke($35, `run`, [48, -16]), `out of bounds table access`);
3755
3756 // ./test/core/table_init.wast:2202
3757 assert_trap(() => invoke($35, `test`, [0]), `uninitialized element`);
3758
3759 // ./test/core/table_init.wast:2203
3760 assert_trap(() => invoke($35, `test`, [1]), `uninitialized element`);
3761
3762 // ./test/core/table_init.wast:2204
3763 assert_trap(() => invoke($35, `test`, [2]), `uninitialized element`);
3764
3765 // ./test/core/table_init.wast:2205
3766 assert_trap(() => invoke($35, `test`, [3]), `uninitialized element`);
3767
3768 // ./test/core/table_init.wast:2206
3769 assert_trap(() => invoke($35, `test`, [4]), `uninitialized element`);
3770
3771 // ./test/core/table_init.wast:2207
3772 assert_trap(() => invoke($35, `test`, [5]), `uninitialized element`);
3773
3774 // ./test/core/table_init.wast:2208
3775 assert_trap(() => invoke($35, `test`, [6]), `uninitialized element`);
3776
3777 // ./test/core/table_init.wast:2209
3778 assert_trap(() => invoke($35, `test`, [7]), `uninitialized element`);
3779
3780 // ./test/core/table_init.wast:2210
3781 assert_trap(() => invoke($35, `test`, [8]), `uninitialized element`);
3782
3783 // ./test/core/table_init.wast:2211
3784 assert_trap(() => invoke($35, `test`, [9]), `uninitialized element`);
3785
3786 // ./test/core/table_init.wast:2212
3787 assert_trap(() => invoke($35, `test`, [10]), `uninitialized element`);
3788
3789 // ./test/core/table_init.wast:2213
3790 assert_trap(() => invoke($35, `test`, [11]), `uninitialized element`);
3791
3792 // ./test/core/table_init.wast:2214
3793 assert_trap(() => invoke($35, `test`, [12]), `uninitialized element`);
3794
3795 // ./test/core/table_init.wast:2215
3796 assert_trap(() => invoke($35, `test`, [13]), `uninitialized element`);
3797
3798 // ./test/core/table_init.wast:2216
3799 assert_trap(() => invoke($35, `test`, [14]), `uninitialized element`);
3800
3801 // ./test/core/table_init.wast:2217
3802 assert_trap(() => invoke($35, `test`, [15]), `uninitialized element`);
3803
3804 // ./test/core/table_init.wast:2218
3805 assert_trap(() => invoke($35, `test`, [16]), `uninitialized element`);
3806
3807 // ./test/core/table_init.wast:2219
3808 assert_trap(() => invoke($35, `test`, [17]), `uninitialized element`);
3809
3810 // ./test/core/table_init.wast:2220
3811 assert_trap(() => invoke($35, `test`, [18]), `uninitialized element`);
3812
3813 // ./test/core/table_init.wast:2221
3814 assert_trap(() => invoke($35, `test`, [19]), `uninitialized element`);
3815
3816 // ./test/core/table_init.wast:2222
3817 assert_trap(() => invoke($35, `test`, [20]), `uninitialized element`);
3818
3819 // ./test/core/table_init.wast:2223
3820 assert_trap(() => invoke($35, `test`, [21]), `uninitialized element`);
3821
3822 // ./test/core/table_init.wast:2224
3823 assert_trap(() => invoke($35, `test`, [22]), `uninitialized element`);
3824
3825 // ./test/core/table_init.wast:2225
3826 assert_trap(() => invoke($35, `test`, [23]), `uninitialized element`);
3827
3828 // ./test/core/table_init.wast:2226
3829 assert_trap(() => invoke($35, `test`, [24]), `uninitialized element`);
3830
3831 // ./test/core/table_init.wast:2227
3832 assert_trap(() => invoke($35, `test`, [25]), `uninitialized element`);
3833
3834 // ./test/core/table_init.wast:2228
3835 assert_trap(() => invoke($35, `test`, [26]), `uninitialized element`);
3836
3837 // ./test/core/table_init.wast:2229
3838 assert_trap(() => invoke($35, `test`, [27]), `uninitialized element`);
3839
3840 // ./test/core/table_init.wast:2230
3841 assert_trap(() => invoke($35, `test`, [28]), `uninitialized element`);
3842
3843 // ./test/core/table_init.wast:2231
3844 assert_trap(() => invoke($35, `test`, [29]), `uninitialized element`);
3845
3846 // ./test/core/table_init.wast:2232
3847 assert_trap(() => invoke($35, `test`, [30]), `uninitialized element`);
3848
3849 // ./test/core/table_init.wast:2233
3850 assert_trap(() => invoke($35, `test`, [31]), `uninitialized element`);
3851
3852 // ./test/core/table_init.wast:2234
3853 assert_trap(() => invoke($35, `test`, [32]), `uninitialized element`);
3854
3855 // ./test/core/table_init.wast:2235
3856 assert_trap(() => invoke($35, `test`, [33]), `uninitialized element`);
3857
3858 // ./test/core/table_init.wast:2236
3859 assert_trap(() => invoke($35, `test`, [34]), `uninitialized element`);
3860
3861 // ./test/core/table_init.wast:2237
3862 assert_trap(() => invoke($35, `test`, [35]), `uninitialized element`);
3863
3864 // ./test/core/table_init.wast:2238
3865 assert_trap(() => invoke($35, `test`, [36]), `uninitialized element`);
3866
3867 // ./test/core/table_init.wast:2239
3868 assert_trap(() => invoke($35, `test`, [37]), `uninitialized element`);
3869
3870 // ./test/core/table_init.wast:2240
3871 assert_trap(() => invoke($35, `test`, [38]), `uninitialized element`);
3872
3873 // ./test/core/table_init.wast:2241
3874 assert_trap(() => invoke($35, `test`, [39]), `uninitialized element`);
3875
3876 // ./test/core/table_init.wast:2242
3877 assert_trap(() => invoke($35, `test`, [40]), `uninitialized element`);
3878
3879 // ./test/core/table_init.wast:2243
3880 assert_trap(() => invoke($35, `test`, [41]), `uninitialized element`);
3881
3882 // ./test/core/table_init.wast:2244
3883 assert_trap(() => invoke($35, `test`, [42]), `uninitialized element`);
3884
3885 // ./test/core/table_init.wast:2245
3886 assert_trap(() => invoke($35, `test`, [43]), `uninitialized element`);
3887
3888 // ./test/core/table_init.wast:2246
3889 assert_trap(() => invoke($35, `test`, [44]), `uninitialized element`);
3890
3891 // ./test/core/table_init.wast:2247
3892 assert_trap(() => invoke($35, `test`, [45]), `uninitialized element`);
3893
3894 // ./test/core/table_init.wast:2248
3895 assert_trap(() => invoke($35, `test`, [46]), `uninitialized element`);
3896
3897 // ./test/core/table_init.wast:2249
3898 assert_trap(() => invoke($35, `test`, [47]), `uninitialized element`);
3899
3900 // ./test/core/table_init.wast:2250
3901 assert_trap(() => invoke($35, `test`, [48]), `uninitialized element`);
3902
3903 // ./test/core/table_init.wast:2251
3904 assert_trap(() => invoke($35, `test`, [49]), `uninitialized element`);
3905
3906 // ./test/core/table_init.wast:2252
3907 assert_trap(() => invoke($35, `test`, [50]), `uninitialized element`);
3908
3909 // ./test/core/table_init.wast:2253
3910 assert_trap(() => invoke($35, `test`, [51]), `uninitialized element`);
3911
3912 // ./test/core/table_init.wast:2254
3913 assert_trap(() => invoke($35, `test`, [52]), `uninitialized element`);
3914
3915 // ./test/core/table_init.wast:2255
3916 assert_trap(() => invoke($35, `test`, [53]), `uninitialized element`);
3917
3918 // ./test/core/table_init.wast:2256
3919 assert_trap(() => invoke($35, `test`, [54]), `uninitialized element`);
3920
3921 // ./test/core/table_init.wast:2257
3922 assert_trap(() => invoke($35, `test`, [55]), `uninitialized element`);
3923
3924 // ./test/core/table_init.wast:2258
3925 assert_trap(() => invoke($35, `test`, [56]), `uninitialized element`);
3926
3927 // ./test/core/table_init.wast:2259
3928 assert_trap(() => invoke($35, `test`, [57]), `uninitialized element`);
3929
3930 // ./test/core/table_init.wast:2260
3931 assert_trap(() => invoke($35, `test`, [58]), `uninitialized element`);
3932
3933 // ./test/core/table_init.wast:2261
3934 assert_trap(() => invoke($35, `test`, [59]), `uninitialized element`);
3935
3936 // ./test/core/table_init.wast:2262
3937 assert_trap(() => invoke($35, `test`, [60]), `uninitialized element`);
3938
3939 // ./test/core/table_init.wast:2263
3940 assert_trap(() => invoke($35, `test`, [61]), `uninitialized element`);
3941
3942 // ./test/core/table_init.wast:2264
3943 assert_trap(() => invoke($35, `test`, [62]), `uninitialized element`);
3944
3945 // ./test/core/table_init.wast:2265
3946 assert_trap(() => invoke($35, `test`, [63]), `uninitialized element`);
3947
3948 // ./test/core/table_init.wast:2267
3949 let $36 = instantiate(`(module
3950 (type (func (result i32)))
3951 (table 16 16 funcref)
3952 (elem funcref
3953 (ref.func $$f0) (ref.func $$f1) (ref.func $$f2) (ref.func $$f3)
3954 (ref.func $$f4) (ref.func $$f5) (ref.func $$f6) (ref.func $$f7)
3955 (ref.func $$f8) (ref.func $$f9) (ref.func $$f10) (ref.func $$f11)
3956 (ref.func $$f12) (ref.func $$f13) (ref.func $$f14) (ref.func $$f15))
3957 (func $$f0 (export "f0") (result i32) (i32.const 0))
3958 (func $$f1 (export "f1") (result i32) (i32.const 1))
3959 (func $$f2 (export "f2") (result i32) (i32.const 2))
3960 (func $$f3 (export "f3") (result i32) (i32.const 3))
3961 (func $$f4 (export "f4") (result i32) (i32.const 4))
3962 (func $$f5 (export "f5") (result i32) (i32.const 5))
3963 (func $$f6 (export "f6") (result i32) (i32.const 6))
3964 (func $$f7 (export "f7") (result i32) (i32.const 7))
3965 (func $$f8 (export "f8") (result i32) (i32.const 8))
3966 (func $$f9 (export "f9") (result i32) (i32.const 9))
3967 (func $$f10 (export "f10") (result i32) (i32.const 10))
3968 (func $$f11 (export "f11") (result i32) (i32.const 11))
3969 (func $$f12 (export "f12") (result i32) (i32.const 12))
3970 (func $$f13 (export "f13") (result i32) (i32.const 13))
3971 (func $$f14 (export "f14") (result i32) (i32.const 14))
3972 (func $$f15 (export "f15") (result i32) (i32.const 15))
3973 (func (export "test") (param $$n i32) (result i32)
3974 (call_indirect (type 0) (local.get $$n)))
3975 (func (export "run") (param $$offs i32) (param $$len i32)
3976 (table.init 0 (local.get $$offs) (i32.const 8) (local.get $$len))))`);
3977
3978 // ./test/core/table_init.wast:2295
3979 assert_trap(() => invoke($36, `run`, [0, -4]), `out of bounds table access`);
3980
3981 // ./test/core/table_init.wast:2296
3982 assert_trap(() => invoke($36, `test`, [0]), `uninitialized element`);
3983
3984 // ./test/core/table_init.wast:2297
3985 assert_trap(() => invoke($36, `test`, [1]), `uninitialized element`);
3986
3987 // ./test/core/table_init.wast:2298
3988 assert_trap(() => invoke($36, `test`, [2]), `uninitialized element`);
3989
3990 // ./test/core/table_init.wast:2299
3991 assert_trap(() => invoke($36, `test`, [3]), `uninitialized element`);
3992
3993 // ./test/core/table_init.wast:2300
3994 assert_trap(() => invoke($36, `test`, [4]), `uninitialized element`);
3995
3996 // ./test/core/table_init.wast:2301
3997 assert_trap(() => invoke($36, `test`, [5]), `uninitialized element`);
3998
3999 // ./test/core/table_init.wast:2302
4000 assert_trap(() => invoke($36, `test`, [6]), `uninitialized element`);
4001
4002 // ./test/core/table_init.wast:2303
4003 assert_trap(() => invoke($36, `test`, [7]), `uninitialized element`);
4004
4005 // ./test/core/table_init.wast:2304
4006 assert_trap(() => invoke($36, `test`, [8]), `uninitialized element`);
4007
4008 // ./test/core/table_init.wast:2305
4009 assert_trap(() => invoke($36, `test`, [9]), `uninitialized element`);
4010
4011 // ./test/core/table_init.wast:2306
4012 assert_trap(() => invoke($36, `test`, [10]), `uninitialized element`);
4013
4014 // ./test/core/table_init.wast:2307
4015 assert_trap(() => invoke($36, `test`, [11]), `uninitialized element`);
4016
4017 // ./test/core/table_init.wast:2308
4018 assert_trap(() => invoke($36, `test`, [12]), `uninitialized element`);
4019
4020 // ./test/core/table_init.wast:2309
4021 assert_trap(() => invoke($36, `test`, [13]), `uninitialized element`);
4022
4023 // ./test/core/table_init.wast:2310
4024 assert_trap(() => invoke($36, `test`, [14]), `uninitialized element`);
4025
4026 // ./test/core/table_init.wast:2311
4027 assert_trap(() => invoke($36, `test`, [15]), `uninitialized element`);
4028
4029 // ./test/core/table_init.wast:2313
4030 let $37 = instantiate(`(module
4031 (table 1 funcref)
4032 ;; 65 elem segments. 64 is the smallest positive number that is encoded
4033 ;; differently as a signed LEB.
4034 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4035 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4036 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4037 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4038 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4039 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4040 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4041 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4042 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4043 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4044 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4045 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4046 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4047 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4048 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4049 (elem funcref) (elem funcref) (elem funcref) (elem funcref)
4050 (elem funcref)
4051 (func (table.init 64 (i32.const 0) (i32.const 0) (i32.const 0))))`);