1 (module binary "\00asm\01\00\00\00")
2 (module binary "\00asm" "\01\00\00\00")
3 (module $M1 binary "\00asm\01\00\00\00")
4 (module $M2 binary "\00asm" "\01\00\00\00")
6 (assert_malformed (module binary "") "unexpected end")
7 (assert_malformed (module binary "\01") "unexpected end")
8 (assert_malformed (module binary "\00as") "unexpected end")
9 (assert_malformed (module binary "asm\00") "magic header not detected")
10 (assert_malformed (module binary "msa\00") "magic header not detected")
11 (assert_malformed (module binary "msa\00\01\00\00\00") "magic header not detected")
12 (assert_malformed (module binary "msa\00\00\00\00\01") "magic header not detected")
13 (assert_malformed (module binary "asm\01\00\00\00\00") "magic header not detected")
14 (assert_malformed (module binary "wasm\01\00\00\00") "magic header not detected")
15 (assert_malformed (module binary "\7fasm\01\00\00\00") "magic header not detected")
16 (assert_malformed (module binary "\80asm\01\00\00\00") "magic header not detected")
17 (assert_malformed (module binary "\82asm\01\00\00\00") "magic header not detected")
18 (assert_malformed (module binary "\ffasm\01\00\00\00") "magic header not detected")
20 ;; 8-byte endian-reversed.
21 (assert_malformed (module binary "\00\00\00\01msa\00") "magic header not detected")
23 ;; Middle-endian byte orderings.
24 (assert_malformed (module binary "a\00ms\00\01\00\00") "magic header not detected")
25 (assert_malformed (module binary "sm\00a\00\00\01\00") "magic header not detected")
28 (assert_malformed (module binary "\00ASM\01\00\00\00") "magic header not detected")
30 ;; EBCDIC-encoded magic.
31 (assert_malformed (module binary "\00\81\a2\94\01\00\00\00") "magic header not detected")
34 (assert_malformed (module binary "\ef\bb\bf\00asm\01\00\00\00") "magic header not detected")
36 ;; Malformed binary version.
37 (assert_malformed (module binary "\00asm") "unexpected end")
38 (assert_malformed (module binary "\00asm\01") "unexpected end")
39 (assert_malformed (module binary "\00asm\01\00\00") "unexpected end")
40 (assert_malformed (module binary "\00asm\00\00\00\00") "unknown binary version")
41 (assert_malformed (module binary "\00asm\0d\00\00\00") "unknown binary version")
42 (assert_malformed (module binary "\00asm\0e\00\00\00") "unknown binary version")
43 (assert_malformed (module binary "\00asm\00\01\00\00") "unknown binary version")
44 (assert_malformed (module binary "\00asm\00\00\01\00") "unknown binary version")
45 (assert_malformed (module binary "\00asm\00\00\00\01") "unknown binary version")
47 ;; Invalid section id.
48 (assert_malformed (module binary "\00asm" "\01\00\00\00" "\0d\00") "malformed section id")
49 (assert_malformed (module binary "\00asm" "\01\00\00\00" "\7f\00") "malformed section id")
50 (assert_malformed (module binary "\00asm" "\01\00\00\00" "\80\00\01\00") "malformed section id")
51 (assert_malformed (module binary "\00asm" "\01\00\00\00" "\81\00\01\00") "malformed section id")
52 (assert_malformed (module binary "\00asm" "\01\00\00\00" "\ff\00\01\00") "malformed section id")
54 ;; call_indirect reserved byte equal to zero.
57 "\00asm" "\01\00\00\00"
58 "\01\04\01\60\00\00" ;; Type section
59 "\03\02\01\00" ;; Function section
60 "\04\04\01\70\00\00" ;; Table section
61 "\0a\09\01" ;; Code section
65 "\41\00" ;; i32.const 0
66 "\11\00" ;; call_indirect (type 0)
67 "\01" ;; call_indirect reserved byte is not equal to zero!
73 ;; call_indirect reserved byte should not be a "long" LEB128 zero.
76 "\00asm" "\01\00\00\00"
77 "\01\04\01\60\00\00" ;; Type section
78 "\03\02\01\00" ;; Function section
79 "\04\04\01\70\00\00" ;; Table section
80 "\0a\0a\01" ;; Code section
84 "\41\00" ;; i32.const 0
85 "\11\00" ;; call_indirect (type 0)
86 "\80\00" ;; call_indirect reserved byte
92 ;; Same as above for 3, 4, and 5-byte zero encodings.
95 "\00asm" "\01\00\00\00"
96 "\01\04\01\60\00\00" ;; Type section
97 "\03\02\01\00" ;; Function section
98 "\04\04\01\70\00\00" ;; Table section
99 "\0a\0b\01" ;; Code section
103 "\41\00" ;; i32.const 0
104 "\11\00" ;; call_indirect (type 0)
105 "\80\80\00" ;; call_indirect reserved byte
113 "\00asm" "\01\00\00\00"
114 "\01\04\01\60\00\00" ;; Type section
115 "\03\02\01\00" ;; Function section
116 "\04\04\01\70\00\00" ;; Table section
117 "\0a\0c\01" ;; Code section
121 "\41\00" ;; i32.const 0
122 "\11\00" ;; call_indirect (type 0)
123 "\80\80\80\00" ;; call_indirect reserved byte
131 "\00asm" "\01\00\00\00"
132 "\01\04\01\60\00\00" ;; Type section
133 "\03\02\01\00" ;; Function section
134 "\04\04\01\70\00\00" ;; Table section
135 "\0a\0d\01" ;; Code section
139 "\41\00" ;; i32.const 0
140 "\11\00" ;; call_indirect (type 0)
141 "\80\80\80\80\00" ;; call_indirect reserved byte
147 ;; memory.grow reserved byte equal to zero.
150 "\00asm" "\01\00\00\00"
151 "\01\04\01\60\00\00" ;; Type section
152 "\03\02\01\00" ;; Function section
153 "\05\03\01\00\00" ;; Memory section
154 "\0a\09\01" ;; Code section
158 "\41\00" ;; i32.const 0
160 "\01" ;; memory.grow reserved byte is not equal to zero!
167 ;; memory.grow reserved byte should not be a "long" LEB128 zero.
170 "\00asm" "\01\00\00\00"
171 "\01\04\01\60\00\00" ;; Type section
172 "\03\02\01\00" ;; Function section
173 "\05\03\01\00\00" ;; Memory section
174 "\0a\0a\01" ;; Code section
178 "\41\00" ;; i32.const 0
180 "\80\00" ;; memory.grow reserved byte
187 ;; Same as above for 3, 4, and 5-byte zero encodings.
190 "\00asm" "\01\00\00\00"
191 "\01\04\01\60\00\00" ;; Type section
192 "\03\02\01\00" ;; Function section
193 "\05\03\01\00\00" ;; Memory section
194 "\0a\0b\01" ;; Code section
198 "\41\00" ;; i32.const 0
200 "\80\80\00" ;; memory.grow reserved byte
209 "\00asm" "\01\00\00\00"
210 "\01\04\01\60\00\00" ;; Type section
211 "\03\02\01\00" ;; Function section
212 "\05\03\01\00\00" ;; Memory section
213 "\0a\0c\01" ;; Code section
217 "\41\00" ;; i32.const 0
219 "\80\80\80\00" ;; memory.grow reserved byte
228 "\00asm" "\01\00\00\00"
229 "\01\04\01\60\00\00" ;; Type section
230 "\03\02\01\00" ;; Function section
231 "\05\03\01\00\00" ;; Memory section
232 "\0a\0d\01" ;; Code section
236 "\41\00" ;; i32.const 0
238 "\80\80\80\80\00" ;; memory.grow reserved byte
245 ;; memory.size reserved byte equal to zero.
248 "\00asm" "\01\00\00\00"
249 "\01\04\01\60\00\00" ;; Type section
250 "\03\02\01\00" ;; Function section
251 "\05\03\01\00\00" ;; Memory section
252 "\0a\07\01" ;; Code section
257 "\01" ;; memory.size reserved byte is not equal to zero!
264 ;; memory.size reserved byte should not be a "long" LEB128 zero.
267 "\00asm" "\01\00\00\00"
268 "\01\04\01\60\00\00" ;; Type section
269 "\03\02\01\00" ;; Function section
270 "\05\03\01\00\00" ;; Memory section
271 "\0a\08\01" ;; Code section
276 "\80\00" ;; memory.size reserved byte
283 ;; Same as above for 3, 4, and 5-byte zero encodings.
286 "\00asm" "\01\00\00\00"
287 "\01\04\01\60\00\00" ;; Type section
288 "\03\02\01\00" ;; Function section
289 "\05\03\01\00\00" ;; Memory section
290 "\0a\09\01" ;; Code section
295 "\80\80\00" ;; memory.size reserved byte
304 "\00asm" "\01\00\00\00"
305 "\01\04\01\60\00\00" ;; Type section
306 "\03\02\01\00" ;; Function section
307 "\05\03\01\00\00" ;; Memory section
308 "\0a\0a\01" ;; Code section
313 "\80\80\80\00" ;; memory.size reserved byte
322 "\00asm" "\01\00\00\00"
323 "\01\04\01\60\00\00" ;; Type section
324 "\03\02\01\00" ;; Function section
325 "\05\03\01\00\00" ;; Memory section
326 "\0a\0b\01" ;; Code section
331 "\80\80\80\80\00" ;; memory.size reserved byte
338 ;; No more than 2^32 locals.
341 "\00asm" "\01\00\00\00"
342 "\01\04\01\60\00\00" ;; Type section
343 "\03\02\01\00" ;; Function section
344 "\0a\0c\01" ;; Code section
348 "\ff\ff\ff\ff\0f\7f" ;; 0xFFFFFFFF i32
349 "\02\7e" ;; 0x00000002 i64
355 ;; Local count can be 0.
357 "\00asm" "\01\00\00\00"
358 "\01\04\01\60\00\00" ;; Type section
359 "\03\02\01\00" ;; Function section
360 "\0a\0a\01" ;; Code section
370 ;; Function section has non-zero count, but code section is absent.
373 "\00asm" "\01\00\00\00"
374 "\01\04\01\60\00\00" ;; Type section
375 "\03\03\02\00\00" ;; Function section with 2 functions
377 "function and code section have inconsistent lengths"
380 ;; Code section has non-zero count, but function section is absent.
383 "\00asm" "\01\00\00\00"
384 "\0a\04\01\02\00\0b" ;; Code section with 1 empty function
386 "function and code section have inconsistent lengths"
389 ;; Function section count > code section count
392 "\00asm" "\01\00\00\00"
393 "\01\04\01\60\00\00" ;; Type section
394 "\03\03\02\00\00" ;; Function section with 2 functions
395 "\0a\04\01\02\00\0b" ;; Code section with 1 empty function
397 "function and code section have inconsistent lengths"
400 ;; Function section count < code section count
403 "\00asm" "\01\00\00\00"
404 "\01\04\01\60\00\00" ;; Type section
405 "\03\02\01\00" ;; Function section with 1 function
406 "\0a\07\02\02\00\0b\02\00\0b" ;; Code section with 2 empty functions
408 "function and code section have inconsistent lengths"
411 ;; Function section has zero count, and code section is absent.
413 "\00asm" "\01\00\00\00"
414 "\03\01\00" ;; Function section with 0 functions
417 ;; Code section has zero count, and function section is absent.
419 "\00asm" "\01\00\00\00"
420 "\0a\01\00" ;; Code section with 0 functions
423 ;; Fewer passive segments than datacount
426 "\00asm" "\01\00\00\00"
427 "\0c\01\03" ;; Datacount section with value "3"
428 "\0b\05\02" ;; Data section with two entries
429 "\01\00" ;; Passive data section
430 "\01\00") ;; Passive data section
431 "data count and data section have inconsistent lengths")
433 ;; More passive segments than datacount
436 "\00asm" "\01\00\00\00"
437 "\0c\01\01" ;; Datacount section with value "1"
438 "\0b\05\02" ;; Data section with two entries
439 "\01\00" ;; Passive data section
440 "\01\00") ;; Passive data section
441 "data count and data section have inconsistent lengths")
443 ;; memory.init requires a datacount section
446 "\00asm" "\01\00\00\00"
448 "\01\04\01\60\00\00" ;; Type section
449 "\03\02\01\00" ;; Function section
450 "\05\03\01\00\00" ;; Memory section
451 "\0a\0e\01" ;; Code section
455 "\41\00" ;; zero args
458 "\fc\08\00\00" ;; memory.init
461 "\0b\03\01\01\00" ;; Data section
463 "data count section required")
465 ;; data.drop requires a datacount section
468 "\00asm" "\01\00\00\00"
470 "\01\04\01\60\00\00" ;; Type section
471 "\03\02\01\00" ;; Function section
472 "\05\03\01\00\00" ;; Memory section
473 "\0a\07\01" ;; Code section
477 "\fc\09\00" ;; data.drop
480 "\0b\03\01\01\00" ;; Data section
482 "data count section required")
484 ;; passive element segment containing opcode other than ref.func or ref.null
487 "\00asm" "\01\00\00\00"
489 "\01\04\01\60\00\00" ;; Type section
491 "\03\02\01\00" ;; Function section
493 "\04\04\01" ;; Table section with 1 entry
494 "\70\00\00" ;; no max, minimum 0, funcref
496 "\05\03\01\00\00" ;; Memory section
498 "\09\07\01" ;; Element section with one segment
499 "\05\70" ;; Passive, funcref
501 "\d3\00\0b" ;; bad opcode, index 0, end
503 "\0a\04\01" ;; Code section
510 ;; passive element segment containing type other than funcref
513 "\00asm" "\01\00\00\00"
515 "\01\04\01\60\00\00" ;; Type section
517 "\03\02\01\00" ;; Function section
519 "\04\04\01" ;; Table section with 1 entry
520 "\70\00\00" ;; no max, minimum 0, funcref
522 "\05\03\01\00\00" ;; Memory section
524 "\09\07\01" ;; Element section with one segment
525 "\05\7f" ;; Passive, i32
527 "\d2\00\0b" ;; ref.func, index 0, end
529 "\0a\04\01" ;; Code section
534 "malformed element type")
536 ;; passive element segment containing opcode ref.func
538 "\00asm" "\01\00\00\00"
540 "\01\04\01\60\00\00" ;; Type section
542 "\03\02\01\00" ;; Function section
544 "\04\04\01" ;; Table section with 1 entry
545 "\70\00\00" ;; no max, minimum 0, funcref
547 "\05\03\01\00\00" ;; Memory section
549 "\09\07\01" ;; Element section with one segment
550 "\05\70" ;; Passive, funcref
552 "\d2\00\0b" ;; ref.func, index 0, end
554 "\0a\04\01" ;; Code section
560 ;; passive element segment containing opcode ref.null
562 "\00asm" "\01\00\00\00"
564 "\01\04\01\60\00\00" ;; Type section
566 "\03\02\01\00" ;; Function section
568 "\04\04\01" ;; Table section with 1 entry
569 "\70\00\00" ;; no max, minimum 0, funcref
571 "\05\03\01\00\00" ;; Memory section
573 "\09\07\01" ;; Element section with one segment
574 "\05\70" ;; Passive, funcref
576 "\d0\70\0b" ;; ref.null, end
578 "\0a\04\01" ;; Code section
585 ;; Type count can be zero
587 "\00asm" "\01\00\00\00"
588 "\01\01\00" ;; type count can be zero
591 ;; 2 type declared, 1 given
594 "\00asm" "\01\00\00\00"
595 "\01\07\02" ;; type section with inconsistent count (2 declared, 1 given)
596 "\60\00\00" ;; 1st type
597 ;; "\60\00\00" ;; 2nd type (missed)
599 "unexpected end of section or function"
602 ;; 1 type declared, 2 given
605 "\00asm" "\01\00\00\00"
606 "\01\07\01" ;; type section with inconsistent count (1 declared, 2 given)
607 "\60\00\00" ;; 1st type
608 "\60\00\00" ;; 2nd type (redundant)
610 "section size mismatch"
613 ;; Import count can be zero
615 "\00asm" "\01\00\00\00"
616 "\01\05\01" ;; type section
617 "\60\01\7f\00" ;; type 0
618 "\02\01\00" ;; import count can be zero
621 ;; Malformed import kind
624 "\00asm" "\01\00\00\00"
625 "\02\04\01" ;; import section with single entry
626 "\00" ;; string length 0
627 "\00" ;; string length 0
628 "\04" ;; malformed import kind
630 "malformed import kind"
634 "\00asm" "\01\00\00\00"
635 "\02\05\01" ;; import section with single entry
636 "\00" ;; string length 0
637 "\00" ;; string length 0
638 "\04" ;; malformed import kind
641 "malformed import kind"
645 "\00asm" "\01\00\00\00"
646 "\02\04\01" ;; import section with single entry
647 "\00" ;; string length 0
648 "\00" ;; string length 0
649 "\05" ;; malformed import kind
651 "malformed import kind"
655 "\00asm" "\01\00\00\00"
656 "\02\05\01" ;; import section with single entry
657 "\00" ;; string length 0
658 "\00" ;; string length 0
659 "\05" ;; malformed import kind
662 "malformed import kind"
666 "\00asm" "\01\00\00\00"
667 "\02\04\01" ;; import section with single entry
668 "\00" ;; string length 0
669 "\00" ;; string length 0
670 "\80" ;; malformed import kind
672 "malformed import kind"
676 "\00asm" "\01\00\00\00"
677 "\02\05\01" ;; import section with single entry
678 "\00" ;; string length 0
679 "\00" ;; string length 0
680 "\80" ;; malformed import kind
683 "malformed import kind"
686 ;; 2 import declared, 1 given
689 "\00asm" "\01\00\00\00"
690 "\01\05\01" ;; type section
691 "\60\01\7f\00" ;; type 0
692 "\02\16\02" ;; import section with inconsistent count (2 declared, 1 given)
694 "\08" ;; string length
695 "\73\70\65\63\74\65\73\74" ;; spectest
696 "\09" ;; string length
697 "\70\72\69\6e\74\5f\69\33\32" ;; print_i32
698 "\00\00" ;; import kind, import signature index
702 "unexpected end of section or function"
705 ;; 1 import declared, 2 given
708 "\00asm" "\01\00\00\00"
709 "\01\09\02" ;; type section
710 "\60\01\7f\00" ;; type 0
711 "\60\01\7d\00" ;; type 1
712 "\02\2b\01" ;; import section with inconsistent count (1 declared, 2 given)
714 "\08" ;; string length
715 "\73\70\65\63\74\65\73\74" ;; spectest
716 "\09" ;; string length
717 "\70\72\69\6e\74\5f\69\33\32" ;; print_i32
718 "\00\00" ;; import kind, import signature index
721 "\08" ;; string length
722 "\73\70\65\63\74\65\73\74" ;; spectest
723 "\09" ;; string length
724 "\70\72\69\6e\74\5f\66\33\32" ;; print_f32
725 "\00\01" ;; import kind, import signature index
727 "section size mismatch"
730 ;; Table count can be zero
732 "\00asm" "\01\00\00\00"
733 "\04\01\00" ;; table count can be zero
736 ;; 1 table declared, 0 given
739 "\00asm" "\01\00\00\00"
740 "\04\01\01" ;; table section with inconsistent count (1 declared, 0 given)
741 ;; "\70\01\00\00" ;; table entity
743 "unexpected end of section or function"
746 ;; Malformed table limits flag
749 "\00asm" "\01\00\00\00"
750 "\05\03\01" ;; table section with one entry
752 "\02" ;; malformed table limits flag
758 "\00asm" "\01\00\00\00"
759 "\05\04\01" ;; table section with one entry
761 "\02" ;; malformed table limits flag
768 "\00asm" "\01\00\00\00"
769 "\05\06\01" ;; table section with one entry
771 "\81\00" ;; malformed table limits flag as LEB128
772 "\00\00" ;; dummy bytes
777 ;; Memory count can be zero
779 "\00asm" "\01\00\00\00"
780 "\05\01\00" ;; memory count can be zero
783 ;; 1 memory declared, 0 given
786 "\00asm" "\01\00\00\00"
787 "\05\01\01" ;; memory section with inconsistent count (1 declared, 0 given)
788 ;; "\00\00" ;; memory 0 (missed)
790 "unexpected end of section or function"
793 ;; Malformed memory limits flag
796 "\00asm" "\01\00\00\00"
797 "\05\02\01" ;; memory section with one entry
798 "\02" ;; malformed memory limits flag
804 "\00asm" "\01\00\00\00"
805 "\05\03\01" ;; memory section with one entry
806 "\02" ;; malformed memory limits flag
813 "\00asm" "\01\00\00\00"
814 "\05\05\01" ;; memory section with one entry
815 "\81\00" ;; malformed memory limits flag as LEB128
816 "\00\00" ;; dummy bytes
818 "integer representation too long"
822 "\00asm" "\01\00\00\00"
823 "\05\05\01" ;; memory section with one entry
824 "\81\01" ;; malformed memory limits flag as LEB128
825 "\00\00" ;; dummy bytes
827 "integer representation too long"
830 ;; Global count can be zero
832 "\00asm" "\01\00\00\00"
833 "\06\01\00" ;; global count can be zero
836 ;; 2 global declared, 1 given
839 "\00asm" "\01\00\00\00"
840 "\06\06\02" ;; global section with inconsistent count (2 declared, 1 given)
841 "\7f\00\41\00\0b" ;; global 0
842 ;; "\7f\00\41\00\0b" ;; global 1 (missed)
844 "unexpected end of section or function"
847 ;; 1 global declared, 2 given
850 "\00asm" "\01\00\00\00"
851 "\06\0b\01" ;; global section with inconsistent count (1 declared, 2 given)
852 "\7f\00\41\00\0b" ;; global 0
853 "\7f\00\41\00\0b" ;; global 1 (redundant)
855 "section size mismatch"
858 ;; Export count can be 0
860 "\00asm" "\01\00\00\00"
861 "\01\04\01" ;; type section
862 "\60\00\00" ;; type 0
863 "\03\03\02\00\00" ;; func section
864 "\07\01\00" ;; export count can be zero
865 "\0a\07\02" ;; code section
866 "\02\00\0b" ;; function body 0
867 "\02\00\0b" ;; function body 1
870 ;; 2 export declared, 1 given
873 "\00asm" "\01\00\00\00"
874 "\01\04\01" ;; type section
875 "\60\00\00" ;; type 0
876 "\03\03\02\00\00" ;; func section
877 "\07\06\02" ;; export section with inconsistent count (2 declared, 1 given)
879 "\66\31" ;; export name
880 "\00\00" ;; export kind, export func index
881 ;; "\02" ;; export 1 (missed)
882 ;; "\66\32" ;; export name
883 ;; "\00\01" ;; export kind, export func index
884 "\0a\07\02" ;; code section
885 "\02\00\0b" ;; function body 0
886 "\02\00\0b" ;; function body 1
888 "unexpected end of section or function"
891 ;; 1 export declared, 2 given
894 "\00asm" "\01\00\00\00"
895 "\01\04\01" ;; type section
896 "\60\00\00" ;; type 0
897 "\03\03\02\00\00" ;; func section
898 "\07\0b\01" ;; export section with inconsistent count (1 declared, 2 given)
900 "\66\31" ;; export name
901 "\00\00" ;; export kind, export func index
902 "\02" ;; export 1 (redundant)
903 "\66\32" ;; export name
904 "\00\01" ;; export kind, export func index
905 "\0a\07\02" ;; code section
906 "\02\00\0b" ;; function body 0
907 "\02\00\0b" ;; function body 1
909 "section size mismatch"
912 ;; elem segment count can be zero
914 "\00asm" "\01\00\00\00"
915 "\01\04\01" ;; type section
916 "\60\00\00" ;; type 0
917 "\03\02\01\00" ;; func section
918 "\04\04\01" ;; table section
919 "\70\00\01" ;; table 0
920 "\09\01\00" ;; elem segment count can be zero
921 "\0a\04\01" ;; code section
922 "\02\00\0b" ;; function body
925 ;; 2 elem segment declared, 1 given
928 "\00asm" "\01\00\00\00"
929 "\01\04\01" ;; type section
930 "\60\00\00" ;; type 0
931 "\03\02\01\00" ;; func section
932 "\04\04\01" ;; table section
933 "\70\00\01" ;; table 0
934 "\09\07\02" ;; elem with inconsistent segment count (2 declared, 1 given)
935 "\00\41\00\0b\01\00" ;; elem 0
936 ;; "\00\41\00\0b\01\00" ;; elem 1 (missed)
937 "\0a\04\01" ;; code section
938 "\02\00\0b" ;; function body
940 "invalid elements segment kind"
943 ;; 1 elem segment declared, 2 given
946 "\00asm" "\01\00\00\00"
947 "\01\04\01" ;; type section
948 "\60\00\00" ;; type 0
949 "\03\02\01\00" ;; func section
950 "\04\04\01" ;; table section
951 "\70\00\01" ;; table 0
952 "\09\0d\01" ;; elem with inconsistent segment count (1 declared, 2 given)
953 "\00\41\00\0b\01\00" ;; elem 0
954 "\00\41\00\0b\01\00" ;; elem 1 (redundant)
955 "\0a\04\01" ;; code section
956 "\02\00\0b" ;; function body
958 "section size mismatch"
961 ;; data segment count can be zero
963 "\00asm" "\01\00\00\00"
964 "\05\03\01" ;; memory section
966 "\0b\01\00" ;; data segment count can be zero
969 ;; 2 data segment declared, 1 given
972 "\00asm" "\01\00\00\00"
973 "\05\03\01" ;; memory section
975 "\0b\07\02" ;; data with inconsistent segment count (2 declared, 1 given)
976 "\00\41\00\0b\01\61" ;; data 0
977 ;; "\00\41\01\0b\01\62" ;; data 1 (missed)
979 "unexpected end of section or function"
982 ;; 1 data segment declared, 2 given
985 "\00asm" "\01\00\00\00"
986 "\05\03\01" ;; memory section
988 "\0b\0d\01" ;; data with inconsistent segment count (1 declared, 2 given)
989 "\00\41\00\0b\01\61" ;; data 0
990 "\00\41\01\0b\01\62" ;; data 1 (redundant)
992 "section size mismatch"
995 ;; data segment has 7 bytes declared, but 6 bytes given
998 "\00asm" "\01\00\00\00"
999 "\05\03\01" ;; memory section
1000 "\00\01" ;; memory 0
1001 "\0b\0c\01" ;; data section
1002 "\00\41\03\0b" ;; data segment 0
1003 "\07" ;; data segment size with inconsistent lengths (7 declared, 6 given)
1004 "\61\62\63\64\65\66" ;; 6 bytes given
1006 "unexpected end of section or function"
1009 ;; data segment has 5 bytes declared, but 6 bytes given
1012 "\00asm" "\01\00\00\00"
1013 "\05\03\01" ;; memory section
1014 "\00\01" ;; memory 0
1015 "\0b\0c\01" ;; data section
1016 "\00\41\00\0b" ;; data segment 0
1017 "\05" ;; data segment size with inconsistent lengths (5 declared, 6 given)
1018 "\61\62\63\64\65\66" ;; 6 bytes given
1020 "section size mismatch"
1023 ;; br_table target count can be zero
1025 "\00asm" "\01\00\00\00"
1026 "\01\04\01" ;; type section
1027 "\60\00\00" ;; type 0
1028 "\03\02\01\00" ;; func section
1029 "\0a\11\01" ;; code section
1032 "\41\01" ;; condition of if 0
1034 "\41\01" ;; index of br_table element
1035 "\0e\00" ;; br_table target count can be zero
1036 "\02" ;; break depth for default
1040 ;; 1 br_table target declared, 2 given
1043 "\00asm" "\01\00\00\00"
1044 "\01\04\01" ;; type section
1045 "\60\00\00" ;; type 0
1046 "\03\02\01\00" ;; func section
1047 "\0a\12\01" ;; code section
1050 "\41\01" ;; condition of if 0
1052 "\41\01" ;; index of br_table element
1053 "\0e\01" ;; br_table with inconsistent target count (1 declared, 2 given)
1054 "\00" ;; break depth 0
1055 "\01" ;; break depth 1
1056 "\02" ;; break depth for default
1064 "\00asm" "\01\00\00\00"
1065 "\01\04\01\60\00\00" ;; Type section
1066 "\03\02\01\00" ;; Function section
1067 "\08\01\00" ;; Start section: function 0
1069 "\0a\04\01" ;; Code section
1075 ;; Multiple start sections
1078 "\00asm" "\01\00\00\00"
1079 "\01\04\01\60\00\00" ;; Type section
1080 "\03\02\01\00" ;; Function section
1081 "\08\01\00" ;; Start section: function 0
1082 "\08\01\00" ;; Start section: function 0
1084 "\0a\04\01" ;; Code section
1089 "junk after last section"