summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/spec/memory64/align64.wast.js
blob: 34b4990f8f960257e06c8eac638e4b9c921a6e31 (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
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
/* 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/align64.wast

// ./test/core/align64.wast:3
let $0 = instantiate(`(module (memory i64 0) (func (drop (i32.load8_s align=1 (i64.const 0)))))`);

// ./test/core/align64.wast:4
let $1 = instantiate(`(module (memory i64 0) (func (drop (i32.load8_u align=1 (i64.const 0)))))`);

// ./test/core/align64.wast:5
let $2 = instantiate(`(module (memory i64 0) (func (drop (i32.load16_s align=2 (i64.const 0)))))`);

// ./test/core/align64.wast:6
let $3 = instantiate(`(module (memory i64 0) (func (drop (i32.load16_u align=2 (i64.const 0)))))`);

// ./test/core/align64.wast:7
let $4 = instantiate(`(module (memory i64 0) (func (drop (i32.load align=4 (i64.const 0)))))`);

// ./test/core/align64.wast:8
let $5 = instantiate(`(module (memory i64 0) (func (drop (i64.load8_s align=1 (i64.const 0)))))`);

// ./test/core/align64.wast:9
let $6 = instantiate(`(module (memory i64 0) (func (drop (i64.load8_u align=1 (i64.const 0)))))`);

// ./test/core/align64.wast:10
let $7 = instantiate(`(module (memory i64 0) (func (drop (i64.load16_s align=2 (i64.const 0)))))`);

// ./test/core/align64.wast:11
let $8 = instantiate(`(module (memory i64 0) (func (drop (i64.load16_u align=2 (i64.const 0)))))`);

// ./test/core/align64.wast:12
let $9 = instantiate(`(module (memory i64 0) (func (drop (i64.load32_s align=4 (i64.const 0)))))`);

// ./test/core/align64.wast:13
let $10 = instantiate(`(module (memory i64 0) (func (drop (i64.load32_u align=4 (i64.const 0)))))`);

// ./test/core/align64.wast:14
let $11 = instantiate(`(module (memory i64 0) (func (drop (i64.load align=8 (i64.const 0)))))`);

// ./test/core/align64.wast:15
let $12 = instantiate(`(module (memory i64 0) (func (drop (f32.load align=4 (i64.const 0)))))`);

// ./test/core/align64.wast:16
let $13 = instantiate(`(module (memory i64 0) (func (drop (f64.load align=8 (i64.const 0)))))`);

// ./test/core/align64.wast:17
let $14 = instantiate(`(module (memory i64 0) (func (i32.store8 align=1 (i64.const 0) (i32.const 1))))`);

// ./test/core/align64.wast:18
let $15 = instantiate(`(module (memory i64 0) (func (i32.store16 align=2 (i64.const 0) (i32.const 1))))`);

// ./test/core/align64.wast:19
let $16 = instantiate(`(module (memory i64 0) (func (i32.store align=4 (i64.const 0) (i32.const 1))))`);

// ./test/core/align64.wast:20
let $17 = instantiate(`(module (memory i64 0) (func (i64.store8 align=1 (i64.const 0) (i64.const 1))))`);

// ./test/core/align64.wast:21
let $18 = instantiate(`(module (memory i64 0) (func (i64.store16 align=2 (i64.const 0) (i64.const 1))))`);

// ./test/core/align64.wast:22
let $19 = instantiate(`(module (memory i64 0) (func (i64.store32 align=4 (i64.const 0) (i64.const 1))))`);

// ./test/core/align64.wast:23
let $20 = instantiate(`(module (memory i64 0) (func (i64.store align=8 (i64.const 0) (i64.const 1))))`);

// ./test/core/align64.wast:24
let $21 = instantiate(`(module (memory i64 0) (func (f32.store align=4 (i64.const 0) (f32.const 1.0))))`);

// ./test/core/align64.wast:25
let $22 = instantiate(`(module (memory i64 0) (func (f64.store align=8 (i64.const 0) (f64.const 1.0))))`);

// ./test/core/align64.wast:27
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_s align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:33
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_s align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:39
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_u align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:45
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_u align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:51
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_s align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:57
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_s align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:63
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_u align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:69
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_u align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:75
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:81
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:87
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_s align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:93
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_s align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:99
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_u align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:105
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_u align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:111
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_s align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:117
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_s align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:123
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_u align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:129
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_u align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:135
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_s align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:141
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_s align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:147
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_u align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:153
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_u align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:159
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:165
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:171
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (f32.load align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:177
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (f32.load align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:183
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (f64.load align=0 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:189
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (drop (f64.load align=7 (i64.const 0))))) `),
  `alignment`,
);

// ./test/core/align64.wast:196
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store8 align=0 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:202
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store8 align=7 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:208
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store16 align=0 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:214
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store16 align=7 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:220
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store align=0 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:226
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i32.store align=7 (i64.const 0) (i32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:232
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store8 align=0 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:238
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store8 align=7 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:244
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store16 align=0 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:250
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store16 align=7 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:256
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store32 align=0 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:262
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store32 align=7 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:268
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store align=0 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:274
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (i64.store align=7 (i64.const 0) (i64.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:280
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (f32.store align=0 (i64.const 0) (f32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:286
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (f32.store align=7 (i64.const 0) (f32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:292
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (f64.store align=0 (i64.const 0) (f32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:298
assert_malformed(
  () => instantiate(`(module (memory i64 0) (func (f64.store align=7 (i64.const 0) (f32.const 0)))) `),
  `alignment`,
);

// ./test/core/align64.wast:305
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_s align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:309
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_u align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:313
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_s align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:317
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_u align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:321
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:325
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_s align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:329
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_u align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:333
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_s align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:337
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_u align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:341
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_s align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:345
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_u align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:349
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load align=16 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:353
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (f32.load align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:357
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (f64.load align=16 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:362
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_s align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:366
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load8_u align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:370
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_s align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:374
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load16_u align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:378
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i32.load align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:382
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_s align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:386
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load8_u align=2 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:390
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_s align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:394
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load16_u align=4 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:398
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_s align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:402
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load32_u align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:406
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (i64.load align=16 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:410
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (f32.load align=8 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:414
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (drop (f64.load align=16 (i64.const 0)))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:419
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i32.store8 align=2 (i64.const 0) (i32.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:423
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i32.store16 align=4 (i64.const 0) (i32.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:427
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i32.store align=8 (i64.const 0) (i32.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:431
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i64.store8 align=2 (i64.const 0) (i64.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:435
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i64.store16 align=4 (i64.const 0) (i64.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:439
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i64.store32 align=8 (i64.const 0) (i64.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:443
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (i64.store align=16 (i64.const 0) (i64.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:447
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (f32.store align=8 (i64.const 0) (f32.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:451
assert_invalid(
  () => instantiate(`(module (memory i64 0) (func (f64.store align=16 (i64.const 0) (f64.const 0))))`),
  `alignment must not be larger than natural`,
);

// ./test/core/align64.wast:458
let $23 = instantiate(`(module
  (memory i64 1)

  ;; $$default: natural alignment, $$1: align=1, $$2: align=2, $$4: align=4, $$8: align=8

  (func (export "f32_align_switch") (param i32) (result f32)
    (local f32 f32)
    (local.set 1 (f32.const 10.0))
    (block $$4
      (block $$2
        (block $$1
          (block $$default
            (block $$0
              (br_table $$0 $$default $$1 $$2 $$4 (local.get 0))
            ) ;; 0
            (f32.store (i64.const 0) (local.get 1))
            (local.set 2 (f32.load (i64.const 0)))
            (br $$4)
          ) ;; default
          (f32.store align=1 (i64.const 0) (local.get 1))
          (local.set 2 (f32.load align=1 (i64.const 0)))
          (br $$4)
        ) ;; 1
        (f32.store align=2 (i64.const 0) (local.get 1))
        (local.set 2 (f32.load align=2 (i64.const 0)))
        (br $$4)
      ) ;; 2
      (f32.store align=4 (i64.const 0) (local.get 1))
      (local.set 2 (f32.load align=4 (i64.const 0)))
    ) ;; 4
    (local.get 2)
  )

  (func (export "f64_align_switch") (param i32) (result f64)
    (local f64 f64)
    (local.set 1 (f64.const 10.0))
    (block $$8
      (block $$4
        (block $$2
          (block $$1
            (block $$default
              (block $$0
                (br_table $$0 $$default $$1 $$2 $$4 $$8 (local.get 0))
              ) ;; 0
              (f64.store (i64.const 0) (local.get 1))
              (local.set 2 (f64.load (i64.const 0)))
              (br $$8)
            ) ;; default
            (f64.store align=1 (i64.const 0) (local.get 1))
            (local.set 2 (f64.load align=1 (i64.const 0)))
            (br $$8)
          ) ;; 1
          (f64.store align=2 (i64.const 0) (local.get 1))
          (local.set 2 (f64.load align=2 (i64.const 0)))
          (br $$8)
        ) ;; 2
        (f64.store align=4 (i64.const 0) (local.get 1))
        (local.set 2 (f64.load align=4 (i64.const 0)))
        (br $$8)
      ) ;; 4
      (f64.store align=8 (i64.const 0) (local.get 1))
      (local.set 2 (f64.load align=8 (i64.const 0)))
    ) ;; 8
    (local.get 2)
  )

  ;; $$8s: i32/i64.load8_s, $$8u: i32/i64.load8_u, $$16s: i32/i64.load16_s, $$16u: i32/i64.load16_u, $$32: i32.load
  ;; $$32s: i64.load32_s, $$32u: i64.load32_u, $$64: i64.load

  (func (export "i32_align_switch") (param i32 i32) (result i32)
    (local i32 i32)
    (local.set 2 (i32.const 10))
    (block $$32
      (block $$16u
        (block $$16s
          (block $$8u
            (block $$8s
              (block $$0
                (br_table $$0 $$8s $$8u $$16s $$16u $$32 (local.get 0))
              ) ;; 0
              (if (i32.eq (local.get 1) (i32.const 0))
                (then
                  (i32.store8 (i64.const 0) (local.get 2))
                  (local.set 3 (i32.load8_s (i64.const 0)))
                )
              )
              (if (i32.eq (local.get 1) (i32.const 1))
                (then
                  (i32.store8 align=1 (i64.const 0) (local.get 2))
                  (local.set 3 (i32.load8_s align=1 (i64.const 0)))
                )
              )
              (br $$32)
            ) ;; 8s
            (if (i32.eq (local.get 1) (i32.const 0))
              (then
                (i32.store8 (i64.const 0) (local.get 2))
                (local.set 3 (i32.load8_u (i64.const 0)))
              )
            )
            (if (i32.eq (local.get 1) (i32.const 1))
              (then
                (i32.store8 align=1 (i64.const 0) (local.get 2))
                (local.set 3 (i32.load8_u align=1 (i64.const 0)))
              )
            )
            (br $$32)
          ) ;; 8u
          (if (i32.eq (local.get 1) (i32.const 0))
            (then
              (i32.store16 (i64.const 0) (local.get 2))
              (local.set 3 (i32.load16_s (i64.const 0)))
            )
          )
          (if (i32.eq (local.get 1) (i32.const 1))
            (then
              (i32.store16 align=1 (i64.const 0) (local.get 2))
              (local.set 3 (i32.load16_s align=1 (i64.const 0)))
            )
          )
          (if (i32.eq (local.get 1) (i32.const 2))
            (then
              (i32.store16 align=2 (i64.const 0) (local.get 2))
              (local.set 3 (i32.load16_s align=2 (i64.const 0)))
            )
          )
          (br $$32)
        ) ;; 16s
        (if (i32.eq (local.get 1) (i32.const 0))
          (then
            (i32.store16 (i64.const 0) (local.get 2))
            (local.set 3 (i32.load16_u (i64.const 0)))
          )
        )
        (if (i32.eq (local.get 1) (i32.const 1))
          (then
            (i32.store16 align=1 (i64.const 0) (local.get 2))
            (local.set 3 (i32.load16_u align=1 (i64.const 0)))
          )
        )
        (if (i32.eq (local.get 1) (i32.const 2))
          (then
            (i32.store16 align=2 (i64.const 0) (local.get 2))
            (local.set 3 (i32.load16_u align=2 (i64.const 0)))
          )
        )
        (br $$32)
      ) ;; 16u
      (if (i32.eq (local.get 1) (i32.const 0))
        (then
          (i32.store (i64.const 0) (local.get 2))
          (local.set 3 (i32.load (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 1))
        (then
          (i32.store align=1 (i64.const 0) (local.get 2))
          (local.set 3 (i32.load align=1 (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 2))
        (then
          (i32.store align=2 (i64.const 0) (local.get 2))
          (local.set 3 (i32.load align=2 (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 4))
        (then
          (i32.store align=4 (i64.const 0) (local.get 2))
          (local.set 3 (i32.load align=4 (i64.const 0)))
        )
      )
    ) ;; 32
    (local.get 3)
  )

  (func (export "i64_align_switch") (param i32 i32) (result i64)
    (local i64 i64)
    (local.set 2 (i64.const 10))
    (block $$64
      (block $$32u
        (block $$32s
          (block $$16u
            (block $$16s
              (block $$8u
                (block $$8s
                  (block $$0
                    (br_table $$0 $$8s $$8u $$16s $$16u $$32s $$32u $$64 (local.get 0))
                  ) ;; 0
                  (if (i32.eq (local.get 1) (i32.const 0))
                    (then
                      (i64.store8 (i64.const 0) (local.get 2))
                      (local.set 3 (i64.load8_s (i64.const 0)))
                    )
                  )
                  (if (i32.eq (local.get 1) (i32.const 1))
                    (then
                      (i64.store8 align=1 (i64.const 0) (local.get 2))
                      (local.set 3 (i64.load8_s align=1 (i64.const 0)))
                    )
                  )
                  (br $$64)
                ) ;; 8s
                (if (i32.eq (local.get 1) (i32.const 0))
                  (then
                    (i64.store8 (i64.const 0) (local.get 2))
                    (local.set 3 (i64.load8_u (i64.const 0)))
                  )
                )
                (if (i32.eq (local.get 1) (i32.const 1))
                  (then
                    (i64.store8 align=1 (i64.const 0) (local.get 2))
                    (local.set 3 (i64.load8_u align=1 (i64.const 0)))
                  )
                )
                (br $$64)
              ) ;; 8u
              (if (i32.eq (local.get 1) (i32.const 0))
                (then
                  (i64.store16 (i64.const 0) (local.get 2))
                  (local.set 3 (i64.load16_s (i64.const 0)))
                )
              )
              (if (i32.eq (local.get 1) (i32.const 1))
                (then
                  (i64.store16 align=1 (i64.const 0) (local.get 2))
                  (local.set 3 (i64.load16_s align=1 (i64.const 0)))
                )
              )
              (if (i32.eq (local.get 1) (i32.const 2))
                (then
                  (i64.store16 align=2 (i64.const 0) (local.get 2))
                  (local.set 3 (i64.load16_s align=2 (i64.const 0)))
                )
              )
              (br $$64)
            ) ;; 16s
            (if (i32.eq (local.get 1) (i32.const 0))
              (then
                (i64.store16 (i64.const 0) (local.get 2))
                (local.set 3 (i64.load16_u (i64.const 0)))
              )
            )
            (if (i32.eq (local.get 1) (i32.const 1))
              (then
                (i64.store16 align=1 (i64.const 0) (local.get 2))
                (local.set 3 (i64.load16_u align=1 (i64.const 0)))
              )
            )
            (if (i32.eq (local.get 1) (i32.const 2))
              (then
                (i64.store16 align=2 (i64.const 0) (local.get 2))
                (local.set 3 (i64.load16_u align=2 (i64.const 0)))
              )
            )
            (br $$64)
          ) ;; 16u
          (if (i32.eq (local.get 1) (i32.const 0))
            (then
              (i64.store32 (i64.const 0) (local.get 2))
              (local.set 3 (i64.load32_s (i64.const 0)))
            )
          )
          (if (i32.eq (local.get 1) (i32.const 1))
            (then
              (i64.store32 align=1 (i64.const 0) (local.get 2))
              (local.set 3 (i64.load32_s align=1 (i64.const 0)))
            )
          )
          (if (i32.eq (local.get 1) (i32.const 2))
            (then
              (i64.store32 align=2 (i64.const 0) (local.get 2))
              (local.set 3 (i64.load32_s align=2 (i64.const 0)))
            )
          )
          (if (i32.eq (local.get 1) (i32.const 4))
            (then
              (i64.store32 align=4 (i64.const 0) (local.get 2))
              (local.set 3 (i64.load32_s align=4 (i64.const 0)))
            )
          )
          (br $$64)
        ) ;; 32s
        (if (i32.eq (local.get 1) (i32.const 0))
          (then
            (i64.store32 (i64.const 0) (local.get 2))
            (local.set 3 (i64.load32_u (i64.const 0)))
          )
        )
        (if (i32.eq (local.get 1) (i32.const 1))
          (then
            (i64.store32 align=1 (i64.const 0) (local.get 2))
            (local.set 3 (i64.load32_u align=1 (i64.const 0)))
          )
        )
        (if (i32.eq (local.get 1) (i32.const 2))
          (then
            (i64.store32 align=2 (i64.const 0) (local.get 2))
            (local.set 3 (i64.load32_u align=2 (i64.const 0)))
          )
        )
        (if (i32.eq (local.get 1) (i32.const 4))
          (then
            (i64.store32 align=4 (i64.const 0) (local.get 2))
            (local.set 3 (i64.load32_u align=4 (i64.const 0)))
          )
        )
        (br $$64)
      ) ;; 32u
      (if (i32.eq (local.get 1) (i32.const 0))
        (then
          (i64.store (i64.const 0) (local.get 2))
          (local.set 3 (i64.load (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 1))
        (then
          (i64.store align=1 (i64.const 0) (local.get 2))
          (local.set 3 (i64.load align=1 (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 2))
        (then
          (i64.store align=2 (i64.const 0) (local.get 2))
          (local.set 3 (i64.load align=2 (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 4))
        (then
          (i64.store align=4 (i64.const 0) (local.get 2))
          (local.set 3 (i64.load align=4 (i64.const 0)))
        )
      )
      (if (i32.eq (local.get 1) (i32.const 8))
        (then
          (i64.store align=8 (i64.const 0) (local.get 2))
          (local.set 3 (i64.load align=8 (i64.const 0)))
        )
      )
    ) ;; 64
    (local.get 3)
  )
)`);

// ./test/core/align64.wast:802
assert_return(() => invoke($23, `f32_align_switch`, [0]), [value("f32", 10)]);

// ./test/core/align64.wast:803
assert_return(() => invoke($23, `f32_align_switch`, [1]), [value("f32", 10)]);

// ./test/core/align64.wast:804
assert_return(() => invoke($23, `f32_align_switch`, [2]), [value("f32", 10)]);

// ./test/core/align64.wast:805
assert_return(() => invoke($23, `f32_align_switch`, [3]), [value("f32", 10)]);

// ./test/core/align64.wast:807
assert_return(() => invoke($23, `f64_align_switch`, [0]), [value("f64", 10)]);

// ./test/core/align64.wast:808
assert_return(() => invoke($23, `f64_align_switch`, [1]), [value("f64", 10)]);

// ./test/core/align64.wast:809
assert_return(() => invoke($23, `f64_align_switch`, [2]), [value("f64", 10)]);

// ./test/core/align64.wast:810
assert_return(() => invoke($23, `f64_align_switch`, [3]), [value("f64", 10)]);

// ./test/core/align64.wast:811
assert_return(() => invoke($23, `f64_align_switch`, [4]), [value("f64", 10)]);

// ./test/core/align64.wast:813
assert_return(() => invoke($23, `i32_align_switch`, [0, 0]), [value("i32", 10)]);

// ./test/core/align64.wast:814
assert_return(() => invoke($23, `i32_align_switch`, [0, 1]), [value("i32", 10)]);

// ./test/core/align64.wast:815
assert_return(() => invoke($23, `i32_align_switch`, [1, 0]), [value("i32", 10)]);

// ./test/core/align64.wast:816
assert_return(() => invoke($23, `i32_align_switch`, [1, 1]), [value("i32", 10)]);

// ./test/core/align64.wast:817
assert_return(() => invoke($23, `i32_align_switch`, [2, 0]), [value("i32", 10)]);

// ./test/core/align64.wast:818
assert_return(() => invoke($23, `i32_align_switch`, [2, 1]), [value("i32", 10)]);

// ./test/core/align64.wast:819
assert_return(() => invoke($23, `i32_align_switch`, [2, 2]), [value("i32", 10)]);

// ./test/core/align64.wast:820
assert_return(() => invoke($23, `i32_align_switch`, [3, 0]), [value("i32", 10)]);

// ./test/core/align64.wast:821
assert_return(() => invoke($23, `i32_align_switch`, [3, 1]), [value("i32", 10)]);

// ./test/core/align64.wast:822
assert_return(() => invoke($23, `i32_align_switch`, [3, 2]), [value("i32", 10)]);

// ./test/core/align64.wast:823
assert_return(() => invoke($23, `i32_align_switch`, [4, 0]), [value("i32", 10)]);

// ./test/core/align64.wast:824
assert_return(() => invoke($23, `i32_align_switch`, [4, 1]), [value("i32", 10)]);

// ./test/core/align64.wast:825
assert_return(() => invoke($23, `i32_align_switch`, [4, 2]), [value("i32", 10)]);

// ./test/core/align64.wast:826
assert_return(() => invoke($23, `i32_align_switch`, [4, 4]), [value("i32", 10)]);

// ./test/core/align64.wast:828
assert_return(() => invoke($23, `i64_align_switch`, [0, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:829
assert_return(() => invoke($23, `i64_align_switch`, [0, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:830
assert_return(() => invoke($23, `i64_align_switch`, [1, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:831
assert_return(() => invoke($23, `i64_align_switch`, [1, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:832
assert_return(() => invoke($23, `i64_align_switch`, [2, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:833
assert_return(() => invoke($23, `i64_align_switch`, [2, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:834
assert_return(() => invoke($23, `i64_align_switch`, [2, 2]), [value("i64", 10n)]);

// ./test/core/align64.wast:835
assert_return(() => invoke($23, `i64_align_switch`, [3, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:836
assert_return(() => invoke($23, `i64_align_switch`, [3, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:837
assert_return(() => invoke($23, `i64_align_switch`, [3, 2]), [value("i64", 10n)]);

// ./test/core/align64.wast:838
assert_return(() => invoke($23, `i64_align_switch`, [4, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:839
assert_return(() => invoke($23, `i64_align_switch`, [4, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:840
assert_return(() => invoke($23, `i64_align_switch`, [4, 2]), [value("i64", 10n)]);

// ./test/core/align64.wast:841
assert_return(() => invoke($23, `i64_align_switch`, [4, 4]), [value("i64", 10n)]);

// ./test/core/align64.wast:842
assert_return(() => invoke($23, `i64_align_switch`, [5, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:843
assert_return(() => invoke($23, `i64_align_switch`, [5, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:844
assert_return(() => invoke($23, `i64_align_switch`, [5, 2]), [value("i64", 10n)]);

// ./test/core/align64.wast:845
assert_return(() => invoke($23, `i64_align_switch`, [5, 4]), [value("i64", 10n)]);

// ./test/core/align64.wast:846
assert_return(() => invoke($23, `i64_align_switch`, [6, 0]), [value("i64", 10n)]);

// ./test/core/align64.wast:847
assert_return(() => invoke($23, `i64_align_switch`, [6, 1]), [value("i64", 10n)]);

// ./test/core/align64.wast:848
assert_return(() => invoke($23, `i64_align_switch`, [6, 2]), [value("i64", 10n)]);

// ./test/core/align64.wast:849
assert_return(() => invoke($23, `i64_align_switch`, [6, 4]), [value("i64", 10n)]);

// ./test/core/align64.wast:850
assert_return(() => invoke($23, `i64_align_switch`, [6, 8]), [value("i64", 10n)]);

// ./test/core/align64.wast:854
let $24 = instantiate(`(module
  (memory i64 1)
  (func (export "store") (param i64 i64)
    (i64.store align=4 (local.get 0) (local.get 1))
  )
  (func (export "load") (param i64) (result i32)
    (i32.load (local.get 0))
  )
)`);

// Bug 1737225 - do not observe the partial store caused by bug 1666747 on
// some native platforms.
if (!partialOobWriteMayWritePartialData()) {
    // ./test/core/align64.wast:864
    assert_trap(
        () => invoke($24, `store`, [65532n, -1n]),
        `out of bounds memory access`,
    );

    // ./test/core/align64.wast:866
    assert_return(() => invoke($24, `load`, [65532n]), [value("i32", 0)]);
}