summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/spec/multi-memory/load.wast.js
blob: 79d90437b9a19980e5f5a2ea17e2058627ae4f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
/* Copyright 2021 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// ./test/core/load.wast

// ./test/core/load.wast:3
let $0 = instantiate(`(module
  (memory $$mem1 1)
  (memory $$mem2 1)

  (func (export "load1") (param i32) (result i64)
    (i64.load $$mem1 (local.get 0))
  )
  (func (export "load2") (param i32) (result i64)
    (i64.load $$mem2 (local.get 0))
  )

  (data (memory $$mem1) (i32.const 0) "\\01")
  (data (memory $$mem2) (i32.const 0) "\\02")
)`);

// ./test/core/load.wast:18
assert_return(() => invoke($0, `load1`, [0]), [value("i64", 1n)]);

// ./test/core/load.wast:19
assert_return(() => invoke($0, `load2`, [0]), [value("i64", 2n)]);

// ./test/core/load.wast:22
let $1 = instantiate(`(module $$M
  (memory (export "mem") 2)

  (func (export "read") (param i32) (result i32)
    (i32.load8_u (local.get 0))
  )
)`);
register($1, `M`);

// ./test/core/load.wast:29
register($1, `M`);

// ./test/core/load.wast:31
let $2 = instantiate(`(module
  (memory $$mem1 (import "M" "mem") 2)
  (memory $$mem2 3)

  (data (memory $$mem1) (i32.const 20) "\\01\\02\\03\\04\\05")
  (data (memory $$mem2) (i32.const 50) "\\0A\\0B\\0C\\0D\\0E")

  (func (export "read1") (param i32) (result i32)
    (i32.load8_u $$mem1 (local.get 0))
  )
  (func (export "read2") (param i32) (result i32)
    (i32.load8_u $$mem2 (local.get 0))
  )
)`);

// ./test/core/load.wast:46
assert_return(() => invoke(`M`, `read`, [20]), [value("i32", 1)]);

// ./test/core/load.wast:47
assert_return(() => invoke(`M`, `read`, [21]), [value("i32", 2)]);

// ./test/core/load.wast:48
assert_return(() => invoke(`M`, `read`, [22]), [value("i32", 3)]);

// ./test/core/load.wast:49
assert_return(() => invoke(`M`, `read`, [23]), [value("i32", 4)]);

// ./test/core/load.wast:50
assert_return(() => invoke(`M`, `read`, [24]), [value("i32", 5)]);

// ./test/core/load.wast:52
assert_return(() => invoke($2, `read1`, [20]), [value("i32", 1)]);

// ./test/core/load.wast:53
assert_return(() => invoke($2, `read1`, [21]), [value("i32", 2)]);

// ./test/core/load.wast:54
assert_return(() => invoke($2, `read1`, [22]), [value("i32", 3)]);

// ./test/core/load.wast:55
assert_return(() => invoke($2, `read1`, [23]), [value("i32", 4)]);

// ./test/core/load.wast:56
assert_return(() => invoke($2, `read1`, [24]), [value("i32", 5)]);

// ./test/core/load.wast:58
assert_return(() => invoke($2, `read2`, [50]), [value("i32", 10)]);

// ./test/core/load.wast:59
assert_return(() => invoke($2, `read2`, [51]), [value("i32", 11)]);

// ./test/core/load.wast:60
assert_return(() => invoke($2, `read2`, [52]), [value("i32", 12)]);

// ./test/core/load.wast:61
assert_return(() => invoke($2, `read2`, [53]), [value("i32", 13)]);

// ./test/core/load.wast:62
assert_return(() => invoke($2, `read2`, [54]), [value("i32", 14)]);

// ./test/core/load.wast:67
let $3 = instantiate(`(module
  (memory 1)

  (func (export "as-br-value") (result i32)
    (block (result i32) (br 0 (i32.load (i32.const 0))))
  )

  (func (export "as-br_if-cond")
    (block (br_if 0 (i32.load (i32.const 0))))
  )
  (func (export "as-br_if-value") (result i32)
    (block (result i32)
      (drop (br_if 0 (i32.load (i32.const 0)) (i32.const 1))) (i32.const 7)
    )
  )
  (func (export "as-br_if-value-cond") (result i32)
    (block (result i32)
      (drop (br_if 0 (i32.const 6) (i32.load (i32.const 0)))) (i32.const 7)
    )
  )

  (func (export "as-br_table-index")
    (block (br_table 0 0 0 (i32.load (i32.const 0))))
  )
  (func (export "as-br_table-value") (result i32)
    (block (result i32)
      (br_table 0 0 0 (i32.load (i32.const 0)) (i32.const 1)) (i32.const 7)
    )
  )
  (func (export "as-br_table-value-index") (result i32)
    (block (result i32)
      (br_table 0 0 (i32.const 6) (i32.load (i32.const 0))) (i32.const 7)
    )
  )

  (func (export "as-return-value") (result i32)
    (return (i32.load (i32.const 0)))
  )

  (func (export "as-if-cond") (result i32)
    (if (result i32) (i32.load (i32.const 0))
      (then (i32.const 0)) (else (i32.const 1))
    )
  )
  (func (export "as-if-then") (result i32)
    (if (result i32) (i32.const 1)
      (then (i32.load (i32.const 0))) (else (i32.const 0))
    )
  )
  (func (export "as-if-else") (result i32)
    (if (result i32) (i32.const 0)
      (then (i32.const 0)) (else (i32.load (i32.const 0)))
    )
  )

  (func (export "as-select-first") (param i32 i32) (result i32)
    (select (i32.load (i32.const 0)) (local.get 0) (local.get 1))
  )
  (func (export "as-select-second") (param i32 i32) (result i32)
    (select (local.get 0) (i32.load (i32.const 0)) (local.get 1))
  )
  (func (export "as-select-cond") (result i32)
    (select (i32.const 0) (i32.const 1) (i32.load (i32.const 0)))
  )

  (func $$f (param i32 i32 i32) (result i32) (i32.const -1))
  (func (export "as-call-first") (result i32)
    (call $$f (i32.load (i32.const 0)) (i32.const 2) (i32.const 3))
  )
  (func (export "as-call-mid") (result i32)
    (call $$f (i32.const 1) (i32.load (i32.const 0)) (i32.const 3))
  )
  (func (export "as-call-last") (result i32)
    (call $$f (i32.const 1) (i32.const 2) (i32.load (i32.const 0)))
  )

  (type $$sig (func (param i32 i32 i32) (result i32)))
  (table funcref (elem $$f))
  (func (export "as-call_indirect-first") (result i32)
    (call_indirect (type $$sig)
      (i32.load (i32.const 0)) (i32.const 2) (i32.const 3) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-mid") (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (i32.load (i32.const 0)) (i32.const 3) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-last") (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (i32.const 2) (i32.load (i32.const 0)) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-index") (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (i32.const 2) (i32.const 3) (i32.load (i32.const 0))
    )
  )

  (func (export "as-local.set-value") (local i32)
    (local.set 0 (i32.load (i32.const 0)))
  )
  (func (export "as-local.tee-value") (result i32) (local i32)
    (local.tee 0 (i32.load (i32.const 0)))
  )
  (global $$g (mut i32) (i32.const 0))
  (func (export "as-global.set-value") (local i32)
    (global.set $$g (i32.load (i32.const 0)))
  )

  (func (export "as-load-address") (result i32)
    (i32.load (i32.load (i32.const 0)))
  )
  (func (export "as-loadN-address") (result i32)
    (i32.load8_s (i32.load (i32.const 0)))
  )

  (func (export "as-store-address")
    (i32.store (i32.load (i32.const 0)) (i32.const 7))
  )
  (func (export "as-store-value")
    (i32.store (i32.const 2) (i32.load (i32.const 0)))
  )

  (func (export "as-storeN-address")
    (i32.store8 (i32.load8_s (i32.const 0)) (i32.const 7))
  )
  (func (export "as-storeN-value")
    (i32.store16 (i32.const 2) (i32.load (i32.const 0)))
  )

  (func (export "as-unary-operand") (result i32)
    (i32.clz (i32.load (i32.const 100)))
  )

  (func (export "as-binary-left") (result i32)
    (i32.add (i32.load (i32.const 100)) (i32.const 10))
  )
  (func (export "as-binary-right") (result i32)
    (i32.sub (i32.const 10) (i32.load (i32.const 100)))
  )

  (func (export "as-test-operand") (result i32)
    (i32.eqz (i32.load (i32.const 100)))
  )

  (func (export "as-compare-left") (result i32)
    (i32.le_s (i32.load (i32.const 100)) (i32.const 10))
  )
  (func (export "as-compare-right") (result i32)
    (i32.ne (i32.const 10) (i32.load (i32.const 100)))
  )

  (func (export "as-memory.grow-size") (result i32)
    (memory.grow (i32.load (i32.const 100)))
  )
)`);

// ./test/core/load.wast:225
assert_return(() => invoke($3, `as-br-value`, []), [value("i32", 0)]);

// ./test/core/load.wast:227
assert_return(() => invoke($3, `as-br_if-cond`, []), []);

// ./test/core/load.wast:228
assert_return(() => invoke($3, `as-br_if-value`, []), [value("i32", 0)]);

// ./test/core/load.wast:229
assert_return(() => invoke($3, `as-br_if-value-cond`, []), [value("i32", 7)]);

// ./test/core/load.wast:231
assert_return(() => invoke($3, `as-br_table-index`, []), []);

// ./test/core/load.wast:232
assert_return(() => invoke($3, `as-br_table-value`, []), [value("i32", 0)]);

// ./test/core/load.wast:233
assert_return(() => invoke($3, `as-br_table-value-index`, []), [value("i32", 6)]);

// ./test/core/load.wast:235
assert_return(() => invoke($3, `as-return-value`, []), [value("i32", 0)]);

// ./test/core/load.wast:237
assert_return(() => invoke($3, `as-if-cond`, []), [value("i32", 1)]);

// ./test/core/load.wast:238
assert_return(() => invoke($3, `as-if-then`, []), [value("i32", 0)]);

// ./test/core/load.wast:239
assert_return(() => invoke($3, `as-if-else`, []), [value("i32", 0)]);

// ./test/core/load.wast:241
assert_return(() => invoke($3, `as-select-first`, [0, 1]), [value("i32", 0)]);

// ./test/core/load.wast:242
assert_return(() => invoke($3, `as-select-second`, [0, 0]), [value("i32", 0)]);

// ./test/core/load.wast:243
assert_return(() => invoke($3, `as-select-cond`, []), [value("i32", 1)]);

// ./test/core/load.wast:245
assert_return(() => invoke($3, `as-call-first`, []), [value("i32", -1)]);

// ./test/core/load.wast:246
assert_return(() => invoke($3, `as-call-mid`, []), [value("i32", -1)]);

// ./test/core/load.wast:247
assert_return(() => invoke($3, `as-call-last`, []), [value("i32", -1)]);

// ./test/core/load.wast:249
assert_return(() => invoke($3, `as-call_indirect-first`, []), [value("i32", -1)]);

// ./test/core/load.wast:250
assert_return(() => invoke($3, `as-call_indirect-mid`, []), [value("i32", -1)]);

// ./test/core/load.wast:251
assert_return(() => invoke($3, `as-call_indirect-last`, []), [value("i32", -1)]);

// ./test/core/load.wast:252
assert_return(() => invoke($3, `as-call_indirect-index`, []), [value("i32", -1)]);

// ./test/core/load.wast:254
assert_return(() => invoke($3, `as-local.set-value`, []), []);

// ./test/core/load.wast:255
assert_return(() => invoke($3, `as-local.tee-value`, []), [value("i32", 0)]);

// ./test/core/load.wast:256
assert_return(() => invoke($3, `as-global.set-value`, []), []);

// ./test/core/load.wast:258
assert_return(() => invoke($3, `as-load-address`, []), [value("i32", 0)]);

// ./test/core/load.wast:259
assert_return(() => invoke($3, `as-loadN-address`, []), [value("i32", 0)]);

// ./test/core/load.wast:260
assert_return(() => invoke($3, `as-store-address`, []), []);

// ./test/core/load.wast:261
assert_return(() => invoke($3, `as-store-value`, []), []);

// ./test/core/load.wast:262
assert_return(() => invoke($3, `as-storeN-address`, []), []);

// ./test/core/load.wast:263
assert_return(() => invoke($3, `as-storeN-value`, []), []);

// ./test/core/load.wast:265
assert_return(() => invoke($3, `as-unary-operand`, []), [value("i32", 32)]);

// ./test/core/load.wast:267
assert_return(() => invoke($3, `as-binary-left`, []), [value("i32", 10)]);

// ./test/core/load.wast:268
assert_return(() => invoke($3, `as-binary-right`, []), [value("i32", 10)]);

// ./test/core/load.wast:270
assert_return(() => invoke($3, `as-test-operand`, []), [value("i32", 1)]);

// ./test/core/load.wast:272
assert_return(() => invoke($3, `as-compare-left`, []), [value("i32", 1)]);

// ./test/core/load.wast:273
assert_return(() => invoke($3, `as-compare-right`, []), [value("i32", 1)]);

// ./test/core/load.wast:275
assert_return(() => invoke($3, `as-memory.grow-size`, []), [value("i32", 1)]);

// ./test/core/load.wast:277
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load32 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:284
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load32_u (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:291
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load32_s (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:298
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load64 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:305
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load64_u (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:312
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i32) (i32.load64_s (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:320
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i64) (i64.load64 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:327
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i64) (i64.load64_u (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:334
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result i64) (i64.load64_s (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:342
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result f32) (f32.load32 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:349
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result f32) (f32.load64 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:357
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result f64) (f64.load32 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:364
assert_malformed(
  () => instantiate(`(memory 1) (func (param i32) (result f64) (f64.load64 (local.get 0))) `),
  `unknown operator`,
);

// ./test/core/load.wast:375
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load_i32 (i32.load (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:379
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load8_s_i32 (i32.load8_s (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:383
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load8_u_i32 (i32.load8_u (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:387
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load16_s_i32 (i32.load16_s (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:391
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load16_u_i32 (i32.load16_u (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:395
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load_i64 (i64.load (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:399
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load8_s_i64 (i64.load8_s (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:403
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load8_u_i64 (i64.load8_u (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:407
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load16_s_i64 (i64.load16_s (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:411
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load16_u_i64 (i64.load16_u (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:415
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load32_s_i64 (i64.load32_s (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:419
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load32_u_i64 (i64.load32_u (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:423
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load_f32 (f32.load (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:427
assert_invalid(
  () => instantiate(`(module (memory 1) (func $$load_f64 (f64.load (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:435
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i32) (i32.load (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:436
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i32) (i32.load8_s (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:437
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i32) (i32.load8_u (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:438
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i32) (i32.load16_s (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:439
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i32) (i32.load16_u (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:440
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:441
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load8_s (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:442
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load8_u (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:443
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load16_s (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:444
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load16_u (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:445
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load32_s (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:446
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result i64) (i64.load32_u (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:447
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result f32) (f32.load (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:448
assert_invalid(
  () => instantiate(`(module (memory 1) (func (result f64) (f64.load (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/load.wast:451
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty
      (i32.load) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:460
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-block
      (i32.const 0)
      (block (i32.load) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:470
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-loop
      (i32.const 0)
      (loop (i32.load) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:480
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-then
      (i32.const 0) (i32.const 0)
      (if (then (i32.load) (drop)))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:490
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-else
      (i32.const 0) (i32.const 0)
      (if (result i32) (then (i32.const 0)) (else (i32.load))) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:500
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-br
      (i32.const 0)
      (block (br 0 (i32.load)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:510
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-br_if
      (i32.const 0)
      (block (br_if 0 (i32.load) (i32.const 1)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:520
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-br_table
      (i32.const 0)
      (block (br_table 0 (i32.load)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:530
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-return
      (return (i32.load)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:539
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-select
      (select (i32.load) (i32.const 1) (i32.const 2)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:548
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-call
      (call 1 (i32.load)) (drop)
    )
    (func (param i32) (result i32) (local.get 0))
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:558
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$f (param i32) (result i32) (local.get 0))
    (type $$sig (func (param i32) (result i32)))
    (table funcref (elem $$f))
    (func $$type-address-empty-in-call_indirect
      (block (result i32)
        (call_indirect (type $$sig)
          (i32.load) (i32.const 0)
        )
        (drop)
      )
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:575
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-local.set
      (local i32)
      (local.set 0 (i32.load)) (local.get 0) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:585
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-local.tee
      (local i32)
      (local.tee 0 (i32.load)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:595
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (global $$x (mut i32) (i32.const 0))
    (func $$type-address-empty-in-global.set
      (global.set $$x (i32.load)) (global.get $$x) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:605
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-memory.grow
      (memory.grow (i32.load)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:614
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-address-empty-in-load
      (i32.load (i32.load)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/load.wast:623
assert_invalid(
  () => instantiate(`(module
    (memory 1)
    (func $$type-address-empty-in-store
      (i32.store (i32.load) (i32.const 1))
    )
  )`),
  `type mismatch`,
);