Debian Codegraph @

js/src/jit-test/tests/wasm/spec/memory64/memory_fill.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/memory_fill.wast
17
18 // ./test/core/memory_fill.wast:6
19 let $0 = instantiate(`(module
20 (memory 1 1)
21
22 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
23 (loop $$cont
24 (if (i32.eq (local.get $$from) (local.get $$to))
25 (then
26 (return (i32.const -1))))
27 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
28 (then
29 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
30 (br $$cont))))
31 (return (local.get $$from)))
32
33 (func (export "test")
34 (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 256))))`);
35
36 // ./test/core/memory_fill.wast:22
37 invoke($0, `test`, []);
38
39 // ./test/core/memory_fill.wast:24
40 assert_return(() => invoke($0, `checkRange`, [0, 65280, 0]), [value("i32", -1)]);
41
42 // ./test/core/memory_fill.wast:26
43 assert_return(() => invoke($0, `checkRange`, [65280, 65536, 85]), [value("i32", -1)]);
44
45 // ./test/core/memory_fill.wast:28
46 let $1 = instantiate(`(module
47 (memory 1 1)
48
49 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
50 (loop $$cont
51 (if (i32.eq (local.get $$from) (local.get $$to))
52 (then
53 (return (i32.const -1))))
54 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
55 (then
56 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
57 (br $$cont))))
58 (return (local.get $$from)))
59
60 (func (export "test")
61 (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 257))))`);
62
63 // ./test/core/memory_fill.wast:44
64 assert_trap(() => invoke($1, `test`, []), `out of bounds memory access`);
65
66 // ./test/core/memory_fill.wast:46
67 let $2 = instantiate(`(module
68 (memory 1 1)
69
70 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
71 (loop $$cont
72 (if (i32.eq (local.get $$from) (local.get $$to))
73 (then
74 (return (i32.const -1))))
75 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
76 (then
77 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
78 (br $$cont))))
79 (return (local.get $$from)))
80
81 (func (export "test")
82 (memory.fill (i32.const 0xFFFFFF00) (i32.const 0x55) (i32.const 257))))`);
83
84 // ./test/core/memory_fill.wast:62
85 assert_trap(() => invoke($2, `test`, []), `out of bounds memory access`);
86
87 // ./test/core/memory_fill.wast:64
88 let $3 = instantiate(`(module
89 (memory 1 1)
90
91 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
92 (loop $$cont
93 (if (i32.eq (local.get $$from) (local.get $$to))
94 (then
95 (return (i32.const -1))))
96 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
97 (then
98 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
99 (br $$cont))))
100 (return (local.get $$from)))
101
102 (func (export "test")
103 (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 0))))`);
104
105 // ./test/core/memory_fill.wast:80
106 invoke($3, `test`, []);
107
108 // ./test/core/memory_fill.wast:82
109 assert_return(() => invoke($3, `checkRange`, [0, 65536, 0]), [value("i32", -1)]);
110
111 // ./test/core/memory_fill.wast:84
112 let $4 = instantiate(`(module
113 (memory 1 1)
114
115 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
116 (loop $$cont
117 (if (i32.eq (local.get $$from) (local.get $$to))
118 (then
119 (return (i32.const -1))))
120 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
121 (then
122 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
123 (br $$cont))))
124 (return (local.get $$from)))
125
126 (func (export "test")
127 (memory.fill (i32.const 0x10000) (i32.const 0x55) (i32.const 0))))`);
128
129 // ./test/core/memory_fill.wast:100
130 invoke($4, `test`, []);
131
132 // ./test/core/memory_fill.wast:102
133 let $5 = instantiate(`(module
134 (memory 1 1)
135
136 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
137 (loop $$cont
138 (if (i32.eq (local.get $$from) (local.get $$to))
139 (then
140 (return (i32.const -1))))
141 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
142 (then
143 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
144 (br $$cont))))
145 (return (local.get $$from)))
146
147 (func (export "test")
148 (memory.fill (i32.const 0x20000) (i32.const 0x55) (i32.const 0))))`);
149
150 // ./test/core/memory_fill.wast:118
151 assert_trap(() => invoke($5, `test`, []), `out of bounds memory access`);
152
153 // ./test/core/memory_fill.wast:120
154 let $6 = instantiate(`(module
155 (memory 1 1)
156
157 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
158 (loop $$cont
159 (if (i32.eq (local.get $$from) (local.get $$to))
160 (then
161 (return (i32.const -1))))
162 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
163 (then
164 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
165 (br $$cont))))
166 (return (local.get $$from)))
167
168 (func (export "test")
169 (memory.fill (i32.const 0x1) (i32.const 0xAA) (i32.const 0xFFFE))))`);
170
171 // ./test/core/memory_fill.wast:136
172 invoke($6, `test`, []);
173
174 // ./test/core/memory_fill.wast:138
175 assert_return(() => invoke($6, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
176
177 // ./test/core/memory_fill.wast:140
178 assert_return(() => invoke($6, `checkRange`, [1, 65535, 170]), [value("i32", -1)]);
179
180 // ./test/core/memory_fill.wast:142
181 assert_return(() => invoke($6, `checkRange`, [65535, 65536, 0]), [value("i32", -1)]);
182
183 // ./test/core/memory_fill.wast:145
184 let $7 = instantiate(`(module
185 (memory 1 1)
186
187 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
188 (loop $$cont
189 (if (i32.eq (local.get $$from) (local.get $$to))
190 (then
191 (return (i32.const -1))))
192 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
193 (then
194 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
195 (br $$cont))))
196 (return (local.get $$from)))
197
198 (func (export "test")
199 (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 10))
200 (memory.fill (i32.const 0x15) (i32.const 0xAA) (i32.const 4))))`);
201
202 // ./test/core/memory_fill.wast:162
203 invoke($7, `test`, []);
204
205 // ./test/core/memory_fill.wast:164
206 assert_return(() => invoke($7, `checkRange`, [0, 18, 0]), [value("i32", -1)]);
207
208 // ./test/core/memory_fill.wast:166
209 assert_return(() => invoke($7, `checkRange`, [18, 21, 85]), [value("i32", -1)]);
210
211 // ./test/core/memory_fill.wast:168
212 assert_return(() => invoke($7, `checkRange`, [21, 25, 170]), [value("i32", -1)]);
213
214 // ./test/core/memory_fill.wast:170
215 assert_return(() => invoke($7, `checkRange`, [25, 28, 85]), [value("i32", -1)]);
216
217 // ./test/core/memory_fill.wast:172
218 assert_return(() => invoke($7, `checkRange`, [28, 65536, 0]), [value("i32", -1)]);
219
220 // ./test/core/memory_fill.wast:174
221 assert_invalid(
222 () => instantiate(`(module
223 (func (export "testfn")
224 (memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))`),
225 `unknown memory 0`,
226 );
227
228 // ./test/core/memory_fill.wast:180
229 assert_invalid(
230 () => instantiate(`(module
231 (memory 1 1)
232 (func (export "testfn")
233 (memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))`),
234 `type mismatch`,
235 );
236
237 // ./test/core/memory_fill.wast:187
238 assert_invalid(
239 () => instantiate(`(module
240 (memory 1 1)
241 (func (export "testfn")
242 (memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))`),
243 `type mismatch`,
244 );
245
246 // ./test/core/memory_fill.wast:194
247 assert_invalid(
248 () => instantiate(`(module
249 (memory 1 1)
250 (func (export "testfn")
251 (memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))`),
252 `type mismatch`,
253 );
254
255 // ./test/core/memory_fill.wast:201
256 assert_invalid(
257 () => instantiate(`(module
258 (memory 1 1)
259 (func (export "testfn")
260 (memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))`),
261 `type mismatch`,
262 );
263
264 // ./test/core/memory_fill.wast:208
265 assert_invalid(
266 () => instantiate(`(module
267 (memory 1 1)
268 (func (export "testfn")
269 (memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))`),
270 `type mismatch`,
271 );
272
273 // ./test/core/memory_fill.wast:215
274 assert_invalid(
275 () => instantiate(`(module
276 (memory 1 1)
277 (func (export "testfn")
278 (memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))`),
279 `type mismatch`,
280 );
281
282 // ./test/core/memory_fill.wast:222
283 assert_invalid(
284 () => instantiate(`(module
285 (memory 1 1)
286 (func (export "testfn")
287 (memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))`),
288 `type mismatch`,
289 );
290
291 // ./test/core/memory_fill.wast:229
292 assert_invalid(
293 () => instantiate(`(module
294 (memory 1 1)
295 (func (export "testfn")
296 (memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))`),
297 `type mismatch`,
298 );
299
300 // ./test/core/memory_fill.wast:236
301 assert_invalid(
302 () => instantiate(`(module
303 (memory 1 1)
304 (func (export "testfn")
305 (memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))`),
306 `type mismatch`,
307 );
308
309 // ./test/core/memory_fill.wast:243
310 assert_invalid(
311 () => instantiate(`(module
312 (memory 1 1)
313 (func (export "testfn")
314 (memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))`),
315 `type mismatch`,
316 );
317
318 // ./test/core/memory_fill.wast:250
319 assert_invalid(
320 () => instantiate(`(module
321 (memory 1 1)
322 (func (export "testfn")
323 (memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))`),
324 `type mismatch`,
325 );
326
327 // ./test/core/memory_fill.wast:257
328 assert_invalid(
329 () => instantiate(`(module
330 (memory 1 1)
331 (func (export "testfn")
332 (memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))`),
333 `type mismatch`,
334 );
335
336 // ./test/core/memory_fill.wast:264
337 assert_invalid(
338 () => instantiate(`(module
339 (memory 1 1)
340 (func (export "testfn")
341 (memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))`),
342 `type mismatch`,
343 );
344
345 // ./test/core/memory_fill.wast:271
346 assert_invalid(
347 () => instantiate(`(module
348 (memory 1 1)
349 (func (export "testfn")
350 (memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))`),
351 `type mismatch`,
352 );
353
354 // ./test/core/memory_fill.wast:278
355 assert_invalid(
356 () => instantiate(`(module
357 (memory 1 1)
358 (func (export "testfn")
359 (memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))`),
360 `type mismatch`,
361 );
362
363 // ./test/core/memory_fill.wast:285
364 assert_invalid(
365 () => instantiate(`(module
366 (memory 1 1)
367 (func (export "testfn")
368 (memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))`),
369 `type mismatch`,
370 );
371
372 // ./test/core/memory_fill.wast:292
373 assert_invalid(
374 () => instantiate(`(module
375 (memory 1 1)
376 (func (export "testfn")
377 (memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))`),
378 `type mismatch`,
379 );
380
381 // ./test/core/memory_fill.wast:299
382 assert_invalid(
383 () => instantiate(`(module
384 (memory 1 1)
385 (func (export "testfn")
386 (memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))`),
387 `type mismatch`,
388 );
389
390 // ./test/core/memory_fill.wast:306
391 assert_invalid(
392 () => instantiate(`(module
393 (memory 1 1)
394 (func (export "testfn")
395 (memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))`),
396 `type mismatch`,
397 );
398
399 // ./test/core/memory_fill.wast:313
400 assert_invalid(
401 () => instantiate(`(module
402 (memory 1 1)
403 (func (export "testfn")
404 (memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))`),
405 `type mismatch`,
406 );
407
408 // ./test/core/memory_fill.wast:320
409 assert_invalid(
410 () => instantiate(`(module
411 (memory 1 1)
412 (func (export "testfn")
413 (memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))`),
414 `type mismatch`,
415 );
416
417 // ./test/core/memory_fill.wast:327
418 assert_invalid(
419 () => instantiate(`(module
420 (memory 1 1)
421 (func (export "testfn")
422 (memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))`),
423 `type mismatch`,
424 );
425
426 // ./test/core/memory_fill.wast:334
427 assert_invalid(
428 () => instantiate(`(module
429 (memory 1 1)
430 (func (export "testfn")
431 (memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))`),
432 `type mismatch`,
433 );
434
435 // ./test/core/memory_fill.wast:341
436 assert_invalid(
437 () => instantiate(`(module
438 (memory 1 1)
439 (func (export "testfn")
440 (memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))`),
441 `type mismatch`,
442 );
443
444 // ./test/core/memory_fill.wast:348
445 assert_invalid(
446 () => instantiate(`(module
447 (memory 1 1)
448 (func (export "testfn")
449 (memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))`),
450 `type mismatch`,
451 );
452
453 // ./test/core/memory_fill.wast:355
454 assert_invalid(
455 () => instantiate(`(module
456 (memory 1 1)
457 (func (export "testfn")
458 (memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))`),
459 `type mismatch`,
460 );
461
462 // ./test/core/memory_fill.wast:362
463 assert_invalid(
464 () => instantiate(`(module
465 (memory 1 1)
466 (func (export "testfn")
467 (memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))`),
468 `type mismatch`,
469 );
470
471 // ./test/core/memory_fill.wast:369
472 assert_invalid(
473 () => instantiate(`(module
474 (memory 1 1)
475 (func (export "testfn")
476 (memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))`),
477 `type mismatch`,
478 );
479
480 // ./test/core/memory_fill.wast:376
481 assert_invalid(
482 () => instantiate(`(module
483 (memory 1 1)
484 (func (export "testfn")
485 (memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))`),
486 `type mismatch`,
487 );
488
489 // ./test/core/memory_fill.wast:383
490 assert_invalid(
491 () => instantiate(`(module
492 (memory 1 1)
493 (func (export "testfn")
494 (memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))`),
495 `type mismatch`,
496 );
497
498 // ./test/core/memory_fill.wast:390
499 assert_invalid(
500 () => instantiate(`(module
501 (memory 1 1)
502 (func (export "testfn")
503 (memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))`),
504 `type mismatch`,
505 );
506
507 // ./test/core/memory_fill.wast:397
508 assert_invalid(
509 () => instantiate(`(module
510 (memory 1 1)
511 (func (export "testfn")
512 (memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))`),
513 `type mismatch`,
514 );
515
516 // ./test/core/memory_fill.wast:404
517 assert_invalid(
518 () => instantiate(`(module
519 (memory 1 1)
520 (func (export "testfn")
521 (memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))`),
522 `type mismatch`,
523 );
524
525 // ./test/core/memory_fill.wast:411
526 assert_invalid(
527 () => instantiate(`(module
528 (memory 1 1)
529 (func (export "testfn")
530 (memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))`),
531 `type mismatch`,
532 );
533
534 // ./test/core/memory_fill.wast:418
535 assert_invalid(
536 () => instantiate(`(module
537 (memory 1 1)
538 (func (export "testfn")
539 (memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))`),
540 `type mismatch`,
541 );
542
543 // ./test/core/memory_fill.wast:425
544 assert_invalid(
545 () => instantiate(`(module
546 (memory 1 1)
547 (func (export "testfn")
548 (memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))`),
549 `type mismatch`,
550 );
551
552 // ./test/core/memory_fill.wast:432
553 assert_invalid(
554 () => instantiate(`(module
555 (memory 1 1)
556 (func (export "testfn")
557 (memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))`),
558 `type mismatch`,
559 );
560
561 // ./test/core/memory_fill.wast:439
562 assert_invalid(
563 () => instantiate(`(module
564 (memory 1 1)
565 (func (export "testfn")
566 (memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))`),
567 `type mismatch`,
568 );
569
570 // ./test/core/memory_fill.wast:446
571 assert_invalid(
572 () => instantiate(`(module
573 (memory 1 1)
574 (func (export "testfn")
575 (memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))`),
576 `type mismatch`,
577 );
578
579 // ./test/core/memory_fill.wast:453
580 assert_invalid(
581 () => instantiate(`(module
582 (memory 1 1)
583 (func (export "testfn")
584 (memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))`),
585 `type mismatch`,
586 );
587
588 // ./test/core/memory_fill.wast:460
589 assert_invalid(
590 () => instantiate(`(module
591 (memory 1 1)
592 (func (export "testfn")
593 (memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))`),
594 `type mismatch`,
595 );
596
597 // ./test/core/memory_fill.wast:467
598 assert_invalid(
599 () => instantiate(`(module
600 (memory 1 1)
601 (func (export "testfn")
602 (memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))`),
603 `type mismatch`,
604 );
605
606 // ./test/core/memory_fill.wast:474
607 assert_invalid(
608 () => instantiate(`(module
609 (memory 1 1)
610 (func (export "testfn")
611 (memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))`),
612 `type mismatch`,
613 );
614
615 // ./test/core/memory_fill.wast:481
616 assert_invalid(
617 () => instantiate(`(module
618 (memory 1 1)
619 (func (export "testfn")
620 (memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))`),
621 `type mismatch`,
622 );
623
624 // ./test/core/memory_fill.wast:488
625 assert_invalid(
626 () => instantiate(`(module
627 (memory 1 1)
628 (func (export "testfn")
629 (memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))`),
630 `type mismatch`,
631 );
632
633 // ./test/core/memory_fill.wast:495
634 assert_invalid(
635 () => instantiate(`(module
636 (memory 1 1)
637 (func (export "testfn")
638 (memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))`),
639 `type mismatch`,
640 );
641
642 // ./test/core/memory_fill.wast:502
643 assert_invalid(
644 () => instantiate(`(module
645 (memory 1 1)
646 (func (export "testfn")
647 (memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))`),
648 `type mismatch`,
649 );
650
651 // ./test/core/memory_fill.wast:509
652 assert_invalid(
653 () => instantiate(`(module
654 (memory 1 1)
655 (func (export "testfn")
656 (memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))`),
657 `type mismatch`,
658 );
659
660 // ./test/core/memory_fill.wast:516
661 assert_invalid(
662 () => instantiate(`(module
663 (memory 1 1)
664 (func (export "testfn")
665 (memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))`),
666 `type mismatch`,
667 );
668
669 // ./test/core/memory_fill.wast:523
670 assert_invalid(
671 () => instantiate(`(module
672 (memory 1 1)
673 (func (export "testfn")
674 (memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))`),
675 `type mismatch`,
676 );
677
678 // ./test/core/memory_fill.wast:530
679 assert_invalid(
680 () => instantiate(`(module
681 (memory 1 1)
682 (func (export "testfn")
683 (memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))`),
684 `type mismatch`,
685 );
686
687 // ./test/core/memory_fill.wast:537
688 assert_invalid(
689 () => instantiate(`(module
690 (memory 1 1)
691 (func (export "testfn")
692 (memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))`),
693 `type mismatch`,
694 );
695
696 // ./test/core/memory_fill.wast:544
697 assert_invalid(
698 () => instantiate(`(module
699 (memory 1 1)
700 (func (export "testfn")
701 (memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))`),
702 `type mismatch`,
703 );
704
705 // ./test/core/memory_fill.wast:551
706 assert_invalid(
707 () => instantiate(`(module
708 (memory 1 1)
709 (func (export "testfn")
710 (memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))`),
711 `type mismatch`,
712 );
713
714 // ./test/core/memory_fill.wast:558
715 assert_invalid(
716 () => instantiate(`(module
717 (memory 1 1)
718 (func (export "testfn")
719 (memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))`),
720 `type mismatch`,
721 );
722
723 // ./test/core/memory_fill.wast:565
724 assert_invalid(
725 () => instantiate(`(module
726 (memory 1 1)
727 (func (export "testfn")
728 (memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))`),
729 `type mismatch`,
730 );
731
732 // ./test/core/memory_fill.wast:572
733 assert_invalid(
734 () => instantiate(`(module
735 (memory 1 1)
736 (func (export "testfn")
737 (memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))`),
738 `type mismatch`,
739 );
740
741 // ./test/core/memory_fill.wast:579
742 assert_invalid(
743 () => instantiate(`(module
744 (memory 1 1)
745 (func (export "testfn")
746 (memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))`),
747 `type mismatch`,
748 );
749
750 // ./test/core/memory_fill.wast:586
751 assert_invalid(
752 () => instantiate(`(module
753 (memory 1 1)
754 (func (export "testfn")
755 (memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))`),
756 `type mismatch`,
757 );
758
759 // ./test/core/memory_fill.wast:593
760 assert_invalid(
761 () => instantiate(`(module
762 (memory 1 1)
763 (func (export "testfn")
764 (memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))`),
765 `type mismatch`,
766 );
767
768 // ./test/core/memory_fill.wast:600
769 assert_invalid(
770 () => instantiate(`(module
771 (memory 1 1)
772 (func (export "testfn")
773 (memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))`),
774 `type mismatch`,
775 );
776
777 // ./test/core/memory_fill.wast:607
778 assert_invalid(
779 () => instantiate(`(module
780 (memory 1 1)
781 (func (export "testfn")
782 (memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))`),
783 `type mismatch`,
784 );
785
786 // ./test/core/memory_fill.wast:614
787 assert_invalid(
788 () => instantiate(`(module
789 (memory 1 1)
790 (func (export "testfn")
791 (memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))`),
792 `type mismatch`,
793 );
794
795 // ./test/core/memory_fill.wast:621
796 let $8 = instantiate(`(module
797 (memory 1 1 )
798
799 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
800 (loop $$cont
801 (if (i32.eq (local.get $$from) (local.get $$to))
802 (then
803 (return (i32.const -1))))
804 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
805 (then
806 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
807 (br $$cont))))
808 (return (local.get $$from)))
809
810 (func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
811 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
812
813 // ./test/core/memory_fill.wast:638
814 assert_trap(() => invoke($8, `run`, [65280, 37, 512]), `out of bounds memory access`);
815
816 // ./test/core/memory_fill.wast:641
817 assert_return(() => invoke($8, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
818
819 // ./test/core/memory_fill.wast:643
820 let $9 = instantiate(`(module
821 (memory 1 1 )
822
823 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
824 (loop $$cont
825 (if (i32.eq (local.get $$from) (local.get $$to))
826 (then
827 (return (i32.const -1))))
828 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
829 (then
830 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
831 (br $$cont))))
832 (return (local.get $$from)))
833
834 (func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
835 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
836
837 // ./test/core/memory_fill.wast:660
838 assert_trap(() => invoke($9, `run`, [65279, 37, 514]), `out of bounds memory access`);
839
840 // ./test/core/memory_fill.wast:663
841 assert_return(() => invoke($9, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
842
843 // ./test/core/memory_fill.wast:665
844 let $10 = instantiate(`(module
845 (memory 1 1 )
846
847 (func (export "checkRange") (param $$from i32) (param $$to i32) (param $$expected i32) (result i32)
848 (loop $$cont
849 (if (i32.eq (local.get $$from) (local.get $$to))
850 (then
851 (return (i32.const -1))))
852 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
853 (then
854 (local.set $$from (i32.add (local.get $$from) (i32.const 1)))
855 (br $$cont))))
856 (return (local.get $$from)))
857
858 (func (export "run") (param $$offs i32) (param $$val i32) (param $$len i32)
859 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
860
861 // ./test/core/memory_fill.wast:682
862 assert_trap(() => invoke($10, `run`, [65279, 37, -1]), `out of bounds memory access`);
863
864 // ./test/core/memory_fill.wast:685
865 assert_return(() => invoke($10, `checkRange`, [0, 1, 0]), [value("i32", -1)]);
866
867 // ./test/core/memory_fill.wast:688
868 let $11 = instantiate(`(module
869 (memory i64 1 1)
870
871 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
872 (loop $$cont
873 (if (i64.eq (local.get $$from) (local.get $$to))
874 (then
875 (return (i64.const -1))))
876 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
877 (then
878 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
879 (br $$cont))))
880 (return (local.get $$from)))
881
882 (func (export "test")
883 (memory.fill (i64.const 0xFF00) (i32.const 0x55) (i64.const 256))))`);
884
885 // ./test/core/memory_fill.wast:704
886 invoke($11, `test`, []);
887
888 // ./test/core/memory_fill.wast:706
889 assert_return(() => invoke($11, `checkRange`, [0n, 65280n, 0]), [value("i64", -1n)]);
890
891 // ./test/core/memory_fill.wast:708
892 assert_return(() => invoke($11, `checkRange`, [65280n, 65536n, 85]), [value("i64", -1n)]);
893
894 // ./test/core/memory_fill.wast:710
895 let $12 = instantiate(`(module
896 (memory i64 1 1)
897
898 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
899 (loop $$cont
900 (if (i64.eq (local.get $$from) (local.get $$to))
901 (then
902 (return (i64.const -1))))
903 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
904 (then
905 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
906 (br $$cont))))
907 (return (local.get $$from)))
908
909 (func (export "test")
910 (memory.fill (i64.const 0xFF00) (i32.const 0x55) (i64.const 257))))`);
911
912 // ./test/core/memory_fill.wast:726
913 assert_trap(() => invoke($12, `test`, []), `out of bounds memory access`);
914
915 // ./test/core/memory_fill.wast:728
916 let $13 = instantiate(`(module
917 (memory i64 1 1)
918
919 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
920 (loop $$cont
921 (if (i64.eq (local.get $$from) (local.get $$to))
922 (then
923 (return (i64.const -1))))
924 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
925 (then
926 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
927 (br $$cont))))
928 (return (local.get $$from)))
929
930 (func (export "test")
931 (memory.fill (i64.const 0xFFFFFF00) (i32.const 0x55) (i64.const 257))))`);
932
933 // ./test/core/memory_fill.wast:744
934 assert_trap(() => invoke($13, `test`, []), `out of bounds memory access`);
935
936 // ./test/core/memory_fill.wast:746
937 let $14 = instantiate(`(module
938 (memory i64 1 1)
939
940 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
941 (loop $$cont
942 (if (i64.eq (local.get $$from) (local.get $$to))
943 (then
944 (return (i64.const -1))))
945 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
946 (then
947 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
948 (br $$cont))))
949 (return (local.get $$from)))
950
951 (func (export "test")
952 (memory.fill (i64.const 0x12) (i32.const 0x55) (i64.const 0))))`);
953
954 // ./test/core/memory_fill.wast:762
955 invoke($14, `test`, []);
956
957 // ./test/core/memory_fill.wast:764
958 assert_return(() => invoke($14, `checkRange`, [0n, 65536n, 0]), [value("i64", -1n)]);
959
960 // ./test/core/memory_fill.wast:766
961 let $15 = instantiate(`(module
962 (memory i64 1 1)
963
964 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
965 (loop $$cont
966 (if (i64.eq (local.get $$from) (local.get $$to))
967 (then
968 (return (i64.const -1))))
969 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
970 (then
971 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
972 (br $$cont))))
973 (return (local.get $$from)))
974
975 (func (export "test")
976 (memory.fill (i64.const 0x10000) (i32.const 0x55) (i64.const 0))))`);
977
978 // ./test/core/memory_fill.wast:782
979 invoke($15, `test`, []);
980
981 // ./test/core/memory_fill.wast:784
982 let $16 = instantiate(`(module
983 (memory i64 1 1)
984
985 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
986 (loop $$cont
987 (if (i64.eq (local.get $$from) (local.get $$to))
988 (then
989 (return (i64.const -1))))
990 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
991 (then
992 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
993 (br $$cont))))
994 (return (local.get $$from)))
995
996 (func (export "test")
997 (memory.fill (i64.const 0x20000) (i32.const 0x55) (i64.const 0))))`);
998
999 // ./test/core/memory_fill.wast:800
1000 assert_trap(() => invoke($16, `test`, []), `out of bounds memory access`);
1001
1002 // ./test/core/memory_fill.wast:802
1003 let $17 = instantiate(`(module
1004 (memory i64 1 1)
1005
1006 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
1007 (loop $$cont
1008 (if (i64.eq (local.get $$from) (local.get $$to))
1009 (then
1010 (return (i64.const -1))))
1011 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
1012 (then
1013 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
1014 (br $$cont))))
1015 (return (local.get $$from)))
1016
1017 (func (export "test")
1018 (memory.fill (i64.const 0x1) (i32.const 0xAA) (i64.const 0xFFFE))))`);
1019
1020 // ./test/core/memory_fill.wast:818
1021 invoke($17, `test`, []);
1022
1023 // ./test/core/memory_fill.wast:820
1024 assert_return(() => invoke($17, `checkRange`, [0n, 1n, 0]), [value("i64", -1n)]);
1025
1026 // ./test/core/memory_fill.wast:822
1027 assert_return(() => invoke($17, `checkRange`, [1n, 65535n, 170]), [value("i64", -1n)]);
1028
1029 // ./test/core/memory_fill.wast:824
1030 assert_return(() => invoke($17, `checkRange`, [65535n, 65536n, 0]), [value("i64", -1n)]);
1031
1032 // ./test/core/memory_fill.wast:827
1033 let $18 = instantiate(`(module
1034 (memory i64 1 1)
1035
1036 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
1037 (loop $$cont
1038 (if (i64.eq (local.get $$from) (local.get $$to))
1039 (then
1040 (return (i64.const -1))))
1041 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
1042 (then
1043 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
1044 (br $$cont))))
1045 (return (local.get $$from)))
1046
1047 (func (export "test")
1048 (memory.fill (i64.const 0x12) (i32.const 0x55) (i64.const 10))
1049 (memory.fill (i64.const 0x15) (i32.const 0xAA) (i64.const 4))))`);
1050
1051 // ./test/core/memory_fill.wast:844
1052 invoke($18, `test`, []);
1053
1054 // ./test/core/memory_fill.wast:846
1055 assert_return(() => invoke($18, `checkRange`, [0n, 18n, 0]), [value("i64", -1n)]);
1056
1057 // ./test/core/memory_fill.wast:848
1058 assert_return(() => invoke($18, `checkRange`, [18n, 21n, 85]), [value("i64", -1n)]);
1059
1060 // ./test/core/memory_fill.wast:850
1061 assert_return(() => invoke($18, `checkRange`, [21n, 25n, 170]), [value("i64", -1n)]);
1062
1063 // ./test/core/memory_fill.wast:852
1064 assert_return(() => invoke($18, `checkRange`, [25n, 28n, 85]), [value("i64", -1n)]);
1065
1066 // ./test/core/memory_fill.wast:854
1067 assert_return(() => invoke($18, `checkRange`, [28n, 65536n, 0]), [value("i64", -1n)]);
1068
1069 // ./test/core/memory_fill.wast:856
1070 assert_invalid(
1071 () => instantiate(`(module
1072 (func (export "testfn")
1073 (memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))`),
1074 `unknown memory 0`,
1075 );
1076
1077 // ./test/core/memory_fill.wast:862
1078 assert_invalid(
1079 () => instantiate(`(module
1080 (memory i64 1 1)
1081 (func (export "testfn")
1082 (memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))`),
1083 `type mismatch`,
1084 );
1085
1086 // ./test/core/memory_fill.wast:869
1087 assert_invalid(
1088 () => instantiate(`(module
1089 (memory i64 1 1)
1090 (func (export "testfn")
1091 (memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))`),
1092 `type mismatch`,
1093 );
1094
1095 // ./test/core/memory_fill.wast:876
1096 assert_invalid(
1097 () => instantiate(`(module
1098 (memory i64 1 1)
1099 (func (export "testfn")
1100 (memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))`),
1101 `type mismatch`,
1102 );
1103
1104 // ./test/core/memory_fill.wast:883
1105 assert_invalid(
1106 () => instantiate(`(module
1107 (memory i64 1 1)
1108 (func (export "testfn")
1109 (memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))`),
1110 `type mismatch`,
1111 );
1112
1113 // ./test/core/memory_fill.wast:890
1114 assert_invalid(
1115 () => instantiate(`(module
1116 (memory i64 1 1)
1117 (func (export "testfn")
1118 (memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))`),
1119 `type mismatch`,
1120 );
1121
1122 // ./test/core/memory_fill.wast:897
1123 assert_invalid(
1124 () => instantiate(`(module
1125 (memory i64 1 1)
1126 (func (export "testfn")
1127 (memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))`),
1128 `type mismatch`,
1129 );
1130
1131 // ./test/core/memory_fill.wast:904
1132 assert_invalid(
1133 () => instantiate(`(module
1134 (memory i64 1 1)
1135 (func (export "testfn")
1136 (memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))`),
1137 `type mismatch`,
1138 );
1139
1140 // ./test/core/memory_fill.wast:911
1141 assert_invalid(
1142 () => instantiate(`(module
1143 (memory i64 1 1)
1144 (func (export "testfn")
1145 (memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))`),
1146 `type mismatch`,
1147 );
1148
1149 // ./test/core/memory_fill.wast:918
1150 assert_invalid(
1151 () => instantiate(`(module
1152 (memory i64 1 1)
1153 (func (export "testfn")
1154 (memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))`),
1155 `type mismatch`,
1156 );
1157
1158 // ./test/core/memory_fill.wast:925
1159 assert_invalid(
1160 () => instantiate(`(module
1161 (memory i64 1 1)
1162 (func (export "testfn")
1163 (memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))`),
1164 `type mismatch`,
1165 );
1166
1167 // ./test/core/memory_fill.wast:932
1168 assert_invalid(
1169 () => instantiate(`(module
1170 (memory i64 1 1)
1171 (func (export "testfn")
1172 (memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))`),
1173 `type mismatch`,
1174 );
1175
1176 // ./test/core/memory_fill.wast:939
1177 assert_invalid(
1178 () => instantiate(`(module
1179 (memory i64 1 1)
1180 (func (export "testfn")
1181 (memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))`),
1182 `type mismatch`,
1183 );
1184
1185 // ./test/core/memory_fill.wast:946
1186 assert_invalid(
1187 () => instantiate(`(module
1188 (memory i64 1 1)
1189 (func (export "testfn")
1190 (memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))`),
1191 `type mismatch`,
1192 );
1193
1194 // ./test/core/memory_fill.wast:953
1195 assert_invalid(
1196 () => instantiate(`(module
1197 (memory i64 1 1)
1198 (func (export "testfn")
1199 (memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))`),
1200 `type mismatch`,
1201 );
1202
1203 // ./test/core/memory_fill.wast:960
1204 assert_invalid(
1205 () => instantiate(`(module
1206 (memory i64 1 1)
1207 (func (export "testfn")
1208 (memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))`),
1209 `type mismatch`,
1210 );
1211
1212 // ./test/core/memory_fill.wast:967
1213 assert_invalid(
1214 () => instantiate(`(module
1215 (memory i64 1 1)
1216 (func (export "testfn")
1217 (memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))`),
1218 `type mismatch`,
1219 );
1220
1221 // ./test/core/memory_fill.wast:974
1222 assert_invalid(
1223 () => instantiate(`(module
1224 (memory i64 1 1)
1225 (func (export "testfn")
1226 (memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))`),
1227 `type mismatch`,
1228 );
1229
1230 // ./test/core/memory_fill.wast:981
1231 assert_invalid(
1232 () => instantiate(`(module
1233 (memory i64 1 1)
1234 (func (export "testfn")
1235 (memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))`),
1236 `type mismatch`,
1237 );
1238
1239 // ./test/core/memory_fill.wast:988
1240 assert_invalid(
1241 () => instantiate(`(module
1242 (memory i64 1 1)
1243 (func (export "testfn")
1244 (memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))`),
1245 `type mismatch`,
1246 );
1247
1248 // ./test/core/memory_fill.wast:995
1249 assert_invalid(
1250 () => instantiate(`(module
1251 (memory i64 1 1)
1252 (func (export "testfn")
1253 (memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))`),
1254 `type mismatch`,
1255 );
1256
1257 // ./test/core/memory_fill.wast:1002
1258 assert_invalid(
1259 () => instantiate(`(module
1260 (memory i64 1 1)
1261 (func (export "testfn")
1262 (memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))`),
1263 `type mismatch`,
1264 );
1265
1266 // ./test/core/memory_fill.wast:1009
1267 assert_invalid(
1268 () => instantiate(`(module
1269 (memory i64 1 1)
1270 (func (export "testfn")
1271 (memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))`),
1272 `type mismatch`,
1273 );
1274
1275 // ./test/core/memory_fill.wast:1016
1276 assert_invalid(
1277 () => instantiate(`(module
1278 (memory i64 1 1)
1279 (func (export "testfn")
1280 (memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))`),
1281 `type mismatch`,
1282 );
1283
1284 // ./test/core/memory_fill.wast:1023
1285 assert_invalid(
1286 () => instantiate(`(module
1287 (memory i64 1 1)
1288 (func (export "testfn")
1289 (memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))`),
1290 `type mismatch`,
1291 );
1292
1293 // ./test/core/memory_fill.wast:1030
1294 assert_invalid(
1295 () => instantiate(`(module
1296 (memory i64 1 1)
1297 (func (export "testfn")
1298 (memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))`),
1299 `type mismatch`,
1300 );
1301
1302 // ./test/core/memory_fill.wast:1037
1303 assert_invalid(
1304 () => instantiate(`(module
1305 (memory i64 1 1)
1306 (func (export "testfn")
1307 (memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))`),
1308 `type mismatch`,
1309 );
1310
1311 // ./test/core/memory_fill.wast:1044
1312 assert_invalid(
1313 () => instantiate(`(module
1314 (memory i64 1 1)
1315 (func (export "testfn")
1316 (memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))`),
1317 `type mismatch`,
1318 );
1319
1320 // ./test/core/memory_fill.wast:1051
1321 assert_invalid(
1322 () => instantiate(`(module
1323 (memory i64 1 1)
1324 (func (export "testfn")
1325 (memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))`),
1326 `type mismatch`,
1327 );
1328
1329 // ./test/core/memory_fill.wast:1058
1330 assert_invalid(
1331 () => instantiate(`(module
1332 (memory i64 1 1)
1333 (func (export "testfn")
1334 (memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))`),
1335 `type mismatch`,
1336 );
1337
1338 // ./test/core/memory_fill.wast:1065
1339 assert_invalid(
1340 () => instantiate(`(module
1341 (memory i64 1 1)
1342 (func (export "testfn")
1343 (memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))`),
1344 `type mismatch`,
1345 );
1346
1347 // ./test/core/memory_fill.wast:1072
1348 assert_invalid(
1349 () => instantiate(`(module
1350 (memory i64 1 1)
1351 (func (export "testfn")
1352 (memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))`),
1353 `type mismatch`,
1354 );
1355
1356 // ./test/core/memory_fill.wast:1079
1357 assert_invalid(
1358 () => instantiate(`(module
1359 (memory i64 1 1)
1360 (func (export "testfn")
1361 (memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))`),
1362 `type mismatch`,
1363 );
1364
1365 // ./test/core/memory_fill.wast:1086
1366 assert_invalid(
1367 () => instantiate(`(module
1368 (memory i64 1 1)
1369 (func (export "testfn")
1370 (memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))`),
1371 `type mismatch`,
1372 );
1373
1374 // ./test/core/memory_fill.wast:1093
1375 assert_invalid(
1376 () => instantiate(`(module
1377 (memory i64 1 1)
1378 (func (export "testfn")
1379 (memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))`),
1380 `type mismatch`,
1381 );
1382
1383 // ./test/core/memory_fill.wast:1100
1384 assert_invalid(
1385 () => instantiate(`(module
1386 (memory i64 1 1)
1387 (func (export "testfn")
1388 (memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))`),
1389 `type mismatch`,
1390 );
1391
1392 // ./test/core/memory_fill.wast:1107
1393 assert_invalid(
1394 () => instantiate(`(module
1395 (memory i64 1 1)
1396 (func (export "testfn")
1397 (memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))`),
1398 `type mismatch`,
1399 );
1400
1401 // ./test/core/memory_fill.wast:1114
1402 assert_invalid(
1403 () => instantiate(`(module
1404 (memory i64 1 1)
1405 (func (export "testfn")
1406 (memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))`),
1407 `type mismatch`,
1408 );
1409
1410 // ./test/core/memory_fill.wast:1121
1411 assert_invalid(
1412 () => instantiate(`(module
1413 (memory i64 1 1)
1414 (func (export "testfn")
1415 (memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))`),
1416 `type mismatch`,
1417 );
1418
1419 // ./test/core/memory_fill.wast:1128
1420 assert_invalid(
1421 () => instantiate(`(module
1422 (memory i64 1 1)
1423 (func (export "testfn")
1424 (memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))`),
1425 `type mismatch`,
1426 );
1427
1428 // ./test/core/memory_fill.wast:1135
1429 assert_invalid(
1430 () => instantiate(`(module
1431 (memory i64 1 1)
1432 (func (export "testfn")
1433 (memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))`),
1434 `type mismatch`,
1435 );
1436
1437 // ./test/core/memory_fill.wast:1142
1438 assert_invalid(
1439 () => instantiate(`(module
1440 (memory i64 1 1)
1441 (func (export "testfn")
1442 (memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))`),
1443 `type mismatch`,
1444 );
1445
1446 // ./test/core/memory_fill.wast:1149
1447 assert_invalid(
1448 () => instantiate(`(module
1449 (memory i64 1 1)
1450 (func (export "testfn")
1451 (memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))`),
1452 `type mismatch`,
1453 );
1454
1455 // ./test/core/memory_fill.wast:1156
1456 assert_invalid(
1457 () => instantiate(`(module
1458 (memory i64 1 1)
1459 (func (export "testfn")
1460 (memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))`),
1461 `type mismatch`,
1462 );
1463
1464 // ./test/core/memory_fill.wast:1163
1465 assert_invalid(
1466 () => instantiate(`(module
1467 (memory i64 1 1)
1468 (func (export "testfn")
1469 (memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))`),
1470 `type mismatch`,
1471 );
1472
1473 // ./test/core/memory_fill.wast:1170
1474 assert_invalid(
1475 () => instantiate(`(module
1476 (memory i64 1 1)
1477 (func (export "testfn")
1478 (memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))`),
1479 `type mismatch`,
1480 );
1481
1482 // ./test/core/memory_fill.wast:1177
1483 assert_invalid(
1484 () => instantiate(`(module
1485 (memory i64 1 1)
1486 (func (export "testfn")
1487 (memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))`),
1488 `type mismatch`,
1489 );
1490
1491 // ./test/core/memory_fill.wast:1184
1492 assert_invalid(
1493 () => instantiate(`(module
1494 (memory i64 1 1)
1495 (func (export "testfn")
1496 (memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))`),
1497 `type mismatch`,
1498 );
1499
1500 // ./test/core/memory_fill.wast:1191
1501 assert_invalid(
1502 () => instantiate(`(module
1503 (memory i64 1 1)
1504 (func (export "testfn")
1505 (memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))`),
1506 `type mismatch`,
1507 );
1508
1509 // ./test/core/memory_fill.wast:1198
1510 assert_invalid(
1511 () => instantiate(`(module
1512 (memory i64 1 1)
1513 (func (export "testfn")
1514 (memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))`),
1515 `type mismatch`,
1516 );
1517
1518 // ./test/core/memory_fill.wast:1205
1519 assert_invalid(
1520 () => instantiate(`(module
1521 (memory i64 1 1)
1522 (func (export "testfn")
1523 (memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))`),
1524 `type mismatch`,
1525 );
1526
1527 // ./test/core/memory_fill.wast:1212
1528 assert_invalid(
1529 () => instantiate(`(module
1530 (memory i64 1 1)
1531 (func (export "testfn")
1532 (memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))`),
1533 `type mismatch`,
1534 );
1535
1536 // ./test/core/memory_fill.wast:1219
1537 assert_invalid(
1538 () => instantiate(`(module
1539 (memory i64 1 1)
1540 (func (export "testfn")
1541 (memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))`),
1542 `type mismatch`,
1543 );
1544
1545 // ./test/core/memory_fill.wast:1226
1546 assert_invalid(
1547 () => instantiate(`(module
1548 (memory i64 1 1)
1549 (func (export "testfn")
1550 (memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))`),
1551 `type mismatch`,
1552 );
1553
1554 // ./test/core/memory_fill.wast:1233
1555 assert_invalid(
1556 () => instantiate(`(module
1557 (memory i64 1 1)
1558 (func (export "testfn")
1559 (memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))`),
1560 `type mismatch`,
1561 );
1562
1563 // ./test/core/memory_fill.wast:1240
1564 assert_invalid(
1565 () => instantiate(`(module
1566 (memory i64 1 1)
1567 (func (export "testfn")
1568 (memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))`),
1569 `type mismatch`,
1570 );
1571
1572 // ./test/core/memory_fill.wast:1247
1573 assert_invalid(
1574 () => instantiate(`(module
1575 (memory i64 1 1)
1576 (func (export "testfn")
1577 (memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))`),
1578 `type mismatch`,
1579 );
1580
1581 // ./test/core/memory_fill.wast:1254
1582 assert_invalid(
1583 () => instantiate(`(module
1584 (memory i64 1 1)
1585 (func (export "testfn")
1586 (memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))`),
1587 `type mismatch`,
1588 );
1589
1590 // ./test/core/memory_fill.wast:1261
1591 assert_invalid(
1592 () => instantiate(`(module
1593 (memory i64 1 1)
1594 (func (export "testfn")
1595 (memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))`),
1596 `type mismatch`,
1597 );
1598
1599 // ./test/core/memory_fill.wast:1268
1600 assert_invalid(
1601 () => instantiate(`(module
1602 (memory i64 1 1)
1603 (func (export "testfn")
1604 (memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))`),
1605 `type mismatch`,
1606 );
1607
1608 // ./test/core/memory_fill.wast:1275
1609 assert_invalid(
1610 () => instantiate(`(module
1611 (memory i64 1 1)
1612 (func (export "testfn")
1613 (memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))`),
1614 `type mismatch`,
1615 );
1616
1617 // ./test/core/memory_fill.wast:1282
1618 assert_invalid(
1619 () => instantiate(`(module
1620 (memory i64 1 1)
1621 (func (export "testfn")
1622 (memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))`),
1623 `type mismatch`,
1624 );
1625
1626 // ./test/core/memory_fill.wast:1289
1627 assert_invalid(
1628 () => instantiate(`(module
1629 (memory i64 1 1)
1630 (func (export "testfn")
1631 (memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))`),
1632 `type mismatch`,
1633 );
1634
1635 // ./test/core/memory_fill.wast:1296
1636 assert_invalid(
1637 () => instantiate(`(module
1638 (memory i64 1 1)
1639 (func (export "testfn")
1640 (memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))`),
1641 `type mismatch`,
1642 );
1643
1644 // ./test/core/memory_fill.wast:1303
1645 let $19 = instantiate(`(module
1646 (memory i64 1 1 )
1647
1648 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
1649 (loop $$cont
1650 (if (i64.eq (local.get $$from) (local.get $$to))
1651 (then
1652 (return (i64.const -1))))
1653 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
1654 (then
1655 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
1656 (br $$cont))))
1657 (return (local.get $$from)))
1658
1659 (func (export "run") (param $$offs i64) (param $$val i32) (param $$len i64)
1660 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
1661
1662 // ./test/core/memory_fill.wast:1320
1663 assert_trap(() => invoke($19, `run`, [65280n, 37, 512n]), `out of bounds memory access`);
1664
1665 // ./test/core/memory_fill.wast:1323
1666 assert_return(() => invoke($19, `checkRange`, [0n, 1n, 0]), [value("i64", -1n)]);
1667
1668 // ./test/core/memory_fill.wast:1325
1669 let $20 = instantiate(`(module
1670 (memory i64 1 1 )
1671
1672 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
1673 (loop $$cont
1674 (if (i64.eq (local.get $$from) (local.get $$to))
1675 (then
1676 (return (i64.const -1))))
1677 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
1678 (then
1679 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
1680 (br $$cont))))
1681 (return (local.get $$from)))
1682
1683 (func (export "run") (param $$offs i64) (param $$val i32) (param $$len i64)
1684 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
1685
1686 // ./test/core/memory_fill.wast:1342
1687 assert_trap(() => invoke($20, `run`, [65279n, 37, 514n]), `out of bounds memory access`);
1688
1689 // ./test/core/memory_fill.wast:1345
1690 assert_return(() => invoke($20, `checkRange`, [0n, 1n, 0]), [value("i64", -1n)]);
1691
1692 // ./test/core/memory_fill.wast:1347
1693 let $21 = instantiate(`(module
1694 (memory i64 1 1 )
1695
1696 (func (export "checkRange") (param $$from i64) (param $$to i64) (param $$expected i32) (result i64)
1697 (loop $$cont
1698 (if (i64.eq (local.get $$from) (local.get $$to))
1699 (then
1700 (return (i64.const -1))))
1701 (if (i32.eq (i32.load8_u (local.get $$from)) (local.get $$expected))
1702 (then
1703 (local.set $$from (i64.add (local.get $$from) (i64.const 1)))
1704 (br $$cont))))
1705 (return (local.get $$from)))
1706
1707 (func (export "run") (param $$offs i64) (param $$val i32) (param $$len i64)
1708 (memory.fill (local.get $$offs) (local.get $$val) (local.get $$len))))`);
1709
1710 // ./test/core/memory_fill.wast:1364
1711 assert_trap(() => invoke($21, `run`, [65279n, 37, 4294967295n]), `out of bounds memory access`);
1712
1713 // ./test/core/memory_fill.wast:1367
1714 assert_return(() => invoke($21, `checkRange`, [0n, 1n, 0]), [value("i64", -1n)]);