2 ;; Generated by ../meta/generate_memory_fill.js
8 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
10 (if (i32.eq (local.get $from) (local.get $to))
12 (return (i32.const -1))))
13 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
15 (local.set $from (i32.add (local.get $from) (i32.const 1)))
17 (return (local.get $from)))
20 (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 256))))
23 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 65280) (i32.const 0))
25 (assert_return (invoke "checkRange" (i32.const 65280) (i32.const 65536) (i32.const 85))
30 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
32 (if (i32.eq (local.get $from) (local.get $to))
34 (return (i32.const -1))))
35 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
37 (local.set $from (i32.add (local.get $from) (i32.const 1)))
39 (return (local.get $from)))
42 (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 257))))
43 (assert_trap (invoke "test") "out of bounds memory access")
48 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
50 (if (i32.eq (local.get $from) (local.get $to))
52 (return (i32.const -1))))
53 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
55 (local.set $from (i32.add (local.get $from) (i32.const 1)))
57 (return (local.get $from)))
60 (memory.fill (i32.const 0xFFFFFF00) (i32.const 0x55) (i32.const 257))))
61 (assert_trap (invoke "test") "out of bounds memory access")
66 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
68 (if (i32.eq (local.get $from) (local.get $to))
70 (return (i32.const -1))))
71 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
73 (local.set $from (i32.add (local.get $from) (i32.const 1)))
75 (return (local.get $from)))
78 (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 0))))
81 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 65536) (i32.const 0))
86 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
88 (if (i32.eq (local.get $from) (local.get $to))
90 (return (i32.const -1))))
91 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
93 (local.set $from (i32.add (local.get $from) (i32.const 1)))
95 (return (local.get $from)))
98 (memory.fill (i32.const 0x10000) (i32.const 0x55) (i32.const 0))))
104 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
106 (if (i32.eq (local.get $from) (local.get $to))
108 (return (i32.const -1))))
109 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
111 (local.set $from (i32.add (local.get $from) (i32.const 1)))
113 (return (local.get $from)))
115 (func (export "test")
116 (memory.fill (i32.const 0x20000) (i32.const 0x55) (i32.const 0))))
117 (assert_trap (invoke "test") "out of bounds")
122 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
124 (if (i32.eq (local.get $from) (local.get $to))
126 (return (i32.const -1))))
127 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
129 (local.set $from (i32.add (local.get $from) (i32.const 1)))
131 (return (local.get $from)))
133 (func (export "test")
134 (memory.fill (i32.const 0x1) (i32.const 0xAA) (i32.const 0xFFFE))))
137 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 1) (i32.const 0))
139 (assert_return (invoke "checkRange" (i32.const 1) (i32.const 65535) (i32.const 170))
141 (assert_return (invoke "checkRange" (i32.const 65535) (i32.const 65536) (i32.const 0))
147 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
149 (if (i32.eq (local.get $from) (local.get $to))
151 (return (i32.const -1))))
152 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
154 (local.set $from (i32.add (local.get $from) (i32.const 1)))
156 (return (local.get $from)))
158 (func (export "test")
159 (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 10))
160 (memory.fill (i32.const 0x15) (i32.const 0xAA) (i32.const 4))))
163 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 18) (i32.const 0))
165 (assert_return (invoke "checkRange" (i32.const 18) (i32.const 21) (i32.const 85))
167 (assert_return (invoke "checkRange" (i32.const 21) (i32.const 25) (i32.const 170))
169 (assert_return (invoke "checkRange" (i32.const 25) (i32.const 28) (i32.const 85))
171 (assert_return (invoke "checkRange" (i32.const 28) (i32.const 65536) (i32.const 0))
175 (func (export "testfn")
176 (memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))
182 (func (export "testfn")
183 (memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))
189 (func (export "testfn")
190 (memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))
196 (func (export "testfn")
197 (memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))
203 (func (export "testfn")
204 (memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))
210 (func (export "testfn")
211 (memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))
217 (func (export "testfn")
218 (memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))
224 (func (export "testfn")
225 (memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))
231 (func (export "testfn")
232 (memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))
238 (func (export "testfn")
239 (memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))
245 (func (export "testfn")
246 (memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))
252 (func (export "testfn")
253 (memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))
259 (func (export "testfn")
260 (memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))
266 (func (export "testfn")
267 (memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))
273 (func (export "testfn")
274 (memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))
280 (func (export "testfn")
281 (memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))
287 (func (export "testfn")
288 (memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))
294 (func (export "testfn")
295 (memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))
301 (func (export "testfn")
302 (memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))
308 (func (export "testfn")
309 (memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))
315 (func (export "testfn")
316 (memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))
322 (func (export "testfn")
323 (memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))
329 (func (export "testfn")
330 (memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))
336 (func (export "testfn")
337 (memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))
343 (func (export "testfn")
344 (memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))
350 (func (export "testfn")
351 (memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))
357 (func (export "testfn")
358 (memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))
364 (func (export "testfn")
365 (memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))
371 (func (export "testfn")
372 (memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))
378 (func (export "testfn")
379 (memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))
385 (func (export "testfn")
386 (memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))
392 (func (export "testfn")
393 (memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))
399 (func (export "testfn")
400 (memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))
406 (func (export "testfn")
407 (memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))
413 (func (export "testfn")
414 (memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))
420 (func (export "testfn")
421 (memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))
427 (func (export "testfn")
428 (memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))
434 (func (export "testfn")
435 (memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))
441 (func (export "testfn")
442 (memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))
448 (func (export "testfn")
449 (memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))
455 (func (export "testfn")
456 (memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))
462 (func (export "testfn")
463 (memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))
469 (func (export "testfn")
470 (memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))
476 (func (export "testfn")
477 (memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))
483 (func (export "testfn")
484 (memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))
490 (func (export "testfn")
491 (memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))
497 (func (export "testfn")
498 (memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))
504 (func (export "testfn")
505 (memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))
511 (func (export "testfn")
512 (memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))
518 (func (export "testfn")
519 (memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))
525 (func (export "testfn")
526 (memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))
532 (func (export "testfn")
533 (memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))
539 (func (export "testfn")
540 (memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))
546 (func (export "testfn")
547 (memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))
553 (func (export "testfn")
554 (memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))
560 (func (export "testfn")
561 (memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))
567 (func (export "testfn")
568 (memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))
574 (func (export "testfn")
575 (memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))
581 (func (export "testfn")
582 (memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))
588 (func (export "testfn")
589 (memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))
595 (func (export "testfn")
596 (memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))
602 (func (export "testfn")
603 (memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))
609 (func (export "testfn")
610 (memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))
616 (func (export "testfn")
617 (memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))
623 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
625 (if (i32.eq (local.get $from) (local.get $to))
627 (return (i32.const -1))))
628 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
630 (local.set $from (i32.add (local.get $from) (i32.const 1)))
632 (return (local.get $from)))
634 (func (export "run") (param $offs i32) (param $val i32) (param $len i32)
635 (memory.fill (local.get $offs) (local.get $val) (local.get $len))))
637 (assert_trap (invoke "run" (i32.const 65280) (i32.const 37) (i32.const 512))
640 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 1) (i32.const 0))
645 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
647 (if (i32.eq (local.get $from) (local.get $to))
649 (return (i32.const -1))))
650 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
652 (local.set $from (i32.add (local.get $from) (i32.const 1)))
654 (return (local.get $from)))
656 (func (export "run") (param $offs i32) (param $val i32) (param $len i32)
657 (memory.fill (local.get $offs) (local.get $val) (local.get $len))))
659 (assert_trap (invoke "run" (i32.const 65279) (i32.const 37) (i32.const 514))
662 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 1) (i32.const 0))
667 (func (export "checkRange") (param $from i32) (param $to i32) (param $expected i32) (result i32)
669 (if (i32.eq (local.get $from) (local.get $to))
671 (return (i32.const -1))))
672 (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))
674 (local.set $from (i32.add (local.get $from) (i32.const 1)))
676 (return (local.get $from)))
678 (func (export "run") (param $offs i32) (param $val i32) (param $len i32)
679 (memory.fill (local.get $offs) (local.get $val) (local.get $len))))
681 (assert_trap (invoke "run" (i32.const 65279) (i32.const 37) (i32.const 4294967295))
684 (assert_return (invoke "checkRange" (i32.const 0) (i32.const 1) (i32.const 0))