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" "\0c\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")
55 ;; Type section with signed LEB128 encoded type
58 "\00asm" "\01\00\00\00"
59 "\01" ;; Type section id
60 "\05" ;; Type section length
61 "\01" ;; Types vector length
62 "\e0\7f" ;; Malformed functype, -0x20 in signed LEB128 encoding
65 "integer representation too long"
69 ;; call_indirect reserved byte equal to zero.
72 "\00asm" "\01\00\00\00"
73 "\01\04\01\60\00\00" ;; Type section
74 "\03\02\01\00" ;; Function section
75 "\04\04\01\70\00\00" ;; Table section
76 "\0a\09\01" ;; Code section
80 "\41\00" ;; i32.const 0
81 "\11\00" ;; call_indirect (type 0)
82 "\01" ;; call_indirect reserved byte is not equal to zero!
88 ;; call_indirect reserved byte should not be a "long" LEB128 zero.
91 "\00asm" "\01\00\00\00"
92 "\01\04\01\60\00\00" ;; Type section
93 "\03\02\01\00" ;; Function section
94 "\04\04\01\70\00\00" ;; Table section
95 "\0a\0a\01" ;; Code section
99 "\41\00" ;; i32.const 0
100 "\11\00" ;; call_indirect (type 0)
101 "\80\00" ;; call_indirect reserved byte
107 ;; Same as above for 3, 4, and 5-byte zero encodings.
110 "\00asm" "\01\00\00\00"
111 "\01\04\01\60\00\00" ;; Type section
112 "\03\02\01\00" ;; Function section
113 "\04\04\01\70\00\00" ;; Table section
114 "\0a\0b\01" ;; Code section
118 "\41\00" ;; i32.const 0
119 "\11\00" ;; call_indirect (type 0)
120 "\80\80\00" ;; call_indirect reserved byte
128 "\00asm" "\01\00\00\00"
129 "\01\04\01\60\00\00" ;; Type section
130 "\03\02\01\00" ;; Function section
131 "\04\04\01\70\00\00" ;; Table section
132 "\0a\0c\01" ;; Code section
136 "\41\00" ;; i32.const 0
137 "\11\00" ;; call_indirect (type 0)
138 "\80\80\80\00" ;; call_indirect reserved byte
146 "\00asm" "\01\00\00\00"
147 "\01\04\01\60\00\00" ;; Type section
148 "\03\02\01\00" ;; Function section
149 "\04\04\01\70\00\00" ;; Table section
150 "\0a\0d\01" ;; Code section
154 "\41\00" ;; i32.const 0
155 "\11\00" ;; call_indirect (type 0)
156 "\80\80\80\80\00" ;; call_indirect reserved byte
162 ;; memory.grow reserved byte equal to zero.
165 "\00asm" "\01\00\00\00"
166 "\01\04\01\60\00\00" ;; Type section
167 "\03\02\01\00" ;; Function section
168 "\05\03\01\00\00" ;; Memory section
169 "\0a\09\01" ;; Code section
173 "\41\00" ;; i32.const 0
175 "\01" ;; memory.grow reserved byte is not equal to zero!
182 ;; memory.grow reserved byte should not be a "long" LEB128 zero.
185 "\00asm" "\01\00\00\00"
186 "\01\04\01\60\00\00" ;; Type section
187 "\03\02\01\00" ;; Function section
188 "\05\03\01\00\00" ;; Memory section
189 "\0a\0a\01" ;; Code section
193 "\41\00" ;; i32.const 0
195 "\80\00" ;; memory.grow reserved byte
202 ;; Same as above for 3, 4, and 5-byte zero encodings.
205 "\00asm" "\01\00\00\00"
206 "\01\04\01\60\00\00" ;; Type section
207 "\03\02\01\00" ;; Function section
208 "\05\03\01\00\00" ;; Memory section
209 "\0a\0b\01" ;; Code section
213 "\41\00" ;; i32.const 0
215 "\80\80\00" ;; memory.grow reserved byte
224 "\00asm" "\01\00\00\00"
225 "\01\04\01\60\00\00" ;; Type section
226 "\03\02\01\00" ;; Function section
227 "\05\03\01\00\00" ;; Memory section
228 "\0a\0c\01" ;; Code section
232 "\41\00" ;; i32.const 0
234 "\80\80\80\00" ;; memory.grow reserved byte
243 "\00asm" "\01\00\00\00"
244 "\01\04\01\60\00\00" ;; Type section
245 "\03\02\01\00" ;; Function section
246 "\05\03\01\00\00" ;; Memory section
247 "\0a\0d\01" ;; Code section
251 "\41\00" ;; i32.const 0
253 "\80\80\80\80\00" ;; memory.grow reserved byte
260 ;; memory.size reserved byte equal to zero.
263 "\00asm" "\01\00\00\00"
264 "\01\04\01\60\00\00" ;; Type section
265 "\03\02\01\00" ;; Function section
266 "\05\03\01\00\00" ;; Memory section
267 "\0a\07\01" ;; Code section
272 "\01" ;; memory.size reserved byte is not equal to zero!
279 ;; memory.size reserved byte should not be a "long" LEB128 zero.
282 "\00asm" "\01\00\00\00"
283 "\01\04\01\60\00\00" ;; Type section
284 "\03\02\01\00" ;; Function section
285 "\05\03\01\00\00" ;; Memory section
286 "\0a\08\01" ;; Code section
291 "\80\00" ;; memory.size reserved byte
298 ;; Same as above for 3, 4, and 5-byte zero encodings.
301 "\00asm" "\01\00\00\00"
302 "\01\04\01\60\00\00" ;; Type section
303 "\03\02\01\00" ;; Function section
304 "\05\03\01\00\00" ;; Memory section
305 "\0a\09\01" ;; Code section
310 "\80\80\00" ;; memory.size reserved byte
319 "\00asm" "\01\00\00\00"
320 "\01\04\01\60\00\00" ;; Type section
321 "\03\02\01\00" ;; Function section
322 "\05\03\01\00\00" ;; Memory section
323 "\0a\0a\01" ;; Code section
328 "\80\80\80\00" ;; memory.size reserved byte
337 "\00asm" "\01\00\00\00"
338 "\01\04\01\60\00\00" ;; Type section
339 "\03\02\01\00" ;; Function section
340 "\05\03\01\00\00" ;; Memory section
341 "\0a\0b\01" ;; Code section
346 "\80\80\80\80\00" ;; memory.size reserved byte
353 ;; Local number is unsigned 32 bit
356 "\00asm" "\01\00\00\00"
357 "\01\04\01\60\00\00" ;; Type section
358 "\03\02\01\00" ;; Function section
359 "\0a\0c\01" ;; Code section
363 "\80\80\80\80\10\7f" ;; 0x100000000 i32
364 "\02\7e" ;; 0x00000002 i64
370 ;; No more than 2^32-1 locals.
373 "\00asm" "\01\00\00\00"
374 "\01\04\01\60\00\00" ;; Type section
375 "\03\02\01\00" ;; Function section
376 "\0a\0c\01" ;; Code section
380 "\ff\ff\ff\ff\0f\7f" ;; 0xFFFFFFFF i32
381 "\02\7e" ;; 0x00000002 i64
389 "\00asm" "\01\00\00\00"
390 "\01\06\01\60\02\7f\7f\00" ;; Type section: (param i32 i32)
391 "\03\02\01\00" ;; Function section
392 "\0a\1c\01" ;; Code section
396 "\80\80\80\80\04\7f" ;; 0x40000000 i32
397 "\80\80\80\80\04\7e" ;; 0x40000000 i64
398 "\80\80\80\80\04\7d" ;; 0x40000000 f32
399 "\80\80\80\80\04\7c" ;; 0x40000000 f64
405 ;; Local count can be 0.
407 "\00asm" "\01\00\00\00"
408 "\01\04\01\60\00\00" ;; Type section
409 "\03\02\01\00" ;; Function section
410 "\0a\0a\01" ;; Code section
420 ;; Function section has non-zero count, but code section is absent.
423 "\00asm" "\01\00\00\00"
424 "\01\04\01\60\00\00" ;; Type section
425 "\03\03\02\00\00" ;; Function section with 2 functions
427 "function and code section have inconsistent lengths"
430 ;; Code section has non-zero count, but function section is absent.
433 "\00asm" "\01\00\00\00"
434 "\0a\04\01\02\00\0b" ;; Code section with 1 empty function
436 "function and code section have inconsistent lengths"
439 ;; Function section count > code section count
442 "\00asm" "\01\00\00\00"
443 "\01\04\01\60\00\00" ;; Type section
444 "\03\03\02\00\00" ;; Function section with 2 functions
445 "\0a\04\01\02\00\0b" ;; Code section with 1 empty function
447 "function and code section have inconsistent lengths"
450 ;; Function section count < code section count
453 "\00asm" "\01\00\00\00"
454 "\01\04\01\60\00\00" ;; Type section
455 "\03\02\01\00" ;; Function section with 1 function
456 "\0a\07\02\02\00\0b\02\00\0b" ;; Code section with 2 empty functions
458 "function and code section have inconsistent lengths"
461 ;; Function section has zero count, and code section is absent.
463 "\00asm" "\01\00\00\00"
464 "\03\01\00" ;; Function section with 0 functions
467 ;; Code section has zero count, and function section is absent.
469 "\00asm" "\01\00\00\00"
470 "\0a\01\00" ;; Code section with 0 functions
473 ;; Type count can be zero
475 "\00asm" "\01\00\00\00"
476 "\01\01\00" ;; type count can be zero
479 ;; 2 type declared, 1 given
482 "\00asm" "\01\00\00\00"
483 "\01\07\02" ;; type section with inconsistent count (2 declared, 1 given)
484 "\60\00\00" ;; 1st type
485 ;; "\60\00\00" ;; 2nd type (missed)
487 "unexpected end of section or function"
490 ;; 1 type declared, 2 given
493 "\00asm" "\01\00\00\00"
494 "\01\07\01" ;; type section with inconsistent count (1 declared, 2 given)
495 "\60\00\00" ;; 1st type
496 "\60\00\00" ;; 2nd type (redundant)
498 "section size mismatch"
501 ;; Import count can be zero
503 "\00asm" "\01\00\00\00"
504 "\01\05\01" ;; type section
505 "\60\01\7f\00" ;; type 0
506 "\02\01\00" ;; import count can be zero
509 ;; Malformed import kind
512 "\00asm" "\01\00\00\00"
513 "\02\04\01" ;; import section with single entry
514 "\00" ;; string length 0
515 "\00" ;; string length 0
516 "\04" ;; malformed import kind
518 "malformed import kind"
522 "\00asm" "\01\00\00\00"
523 "\02\05\01" ;; import section with single entry
524 "\00" ;; string length 0
525 "\00" ;; string length 0
526 "\04" ;; malformed import kind
529 "malformed import kind"
533 "\00asm" "\01\00\00\00"
534 "\02\04\01" ;; import section with single entry
535 "\00" ;; string length 0
536 "\00" ;; string length 0
537 "\05" ;; malformed import kind
539 "malformed import kind"
543 "\00asm" "\01\00\00\00"
544 "\02\05\01" ;; import section with single entry
545 "\00" ;; string length 0
546 "\00" ;; string length 0
547 "\05" ;; malformed import kind
550 "malformed import kind"
554 "\00asm" "\01\00\00\00"
555 "\02\04\01" ;; import section with single entry
556 "\00" ;; string length 0
557 "\00" ;; string length 0
558 "\80" ;; malformed import kind
560 "malformed import kind"
564 "\00asm" "\01\00\00\00"
565 "\02\05\01" ;; import section with single entry
566 "\00" ;; string length 0
567 "\00" ;; string length 0
568 "\80" ;; malformed import kind
571 "malformed import kind"
574 ;; 2 import declared, 1 given
577 "\00asm" "\01\00\00\00"
578 "\01\05\01" ;; type section
579 "\60\01\7f\00" ;; type 0
580 "\02\16\02" ;; import section with inconsistent count (2 declared, 1 given)
582 "\08" ;; string length
583 "\73\70\65\63\74\65\73\74" ;; spectest
584 "\09" ;; string length
585 "\70\72\69\6e\74\5f\69\33\32" ;; print_i32
586 "\00\00" ;; import kind, import signature index
590 "unexpected end of section or function"
593 ;; 1 import declared, 2 given
596 "\00asm" "\01\00\00\00"
597 "\01\09\02" ;; type section
598 "\60\01\7f\00" ;; type 0
599 "\60\01\7d\00" ;; type 1
600 "\02\2b\01" ;; import section with inconsistent count (1 declared, 2 given)
602 "\08" ;; string length
603 "\73\70\65\63\74\65\73\74" ;; spectest
604 "\09" ;; string length
605 "\70\72\69\6e\74\5f\69\33\32" ;; print_i32
606 "\00\00" ;; import kind, import signature index
609 "\08" ;; string length
610 "\73\70\65\63\74\65\73\74" ;; spectest
611 "\09" ;; string length
612 "\70\72\69\6e\74\5f\66\33\32" ;; print_f32
613 "\00\01" ;; import kind, import signature index
615 "section size mismatch"
618 ;; Table count can be zero
620 "\00asm" "\01\00\00\00"
621 "\04\01\00" ;; table count can be zero
624 ;; 1 table declared, 0 given
627 "\00asm" "\01\00\00\00"
628 "\04\01\01" ;; table section with inconsistent count (1 declared, 0 given)
629 ;; "\70\01\00\00" ;; table entity
631 "unexpected end of section or function"
634 ;; Malformed table limits flag
637 "\00asm" "\01\00\00\00"
638 "\05\03\01" ;; table section with one entry
640 "\08" ;; malformed table limits flag
642 "malformed limits flags"
646 "\00asm" "\01\00\00\00"
647 "\05\04\01" ;; table section with one entry
649 "\08" ;; malformed table limits flag
652 "malformed limits flags"
656 "\00asm" "\01\00\00\00"
657 "\05\06\01" ;; table section with one entry
659 "\81\00" ;; malformed table limits flag as LEB128
660 "\00\00" ;; dummy bytes
662 "malformed limits flags"
665 ;; Memory count can be zero
667 "\00asm" "\01\00\00\00"
668 "\05\01\00" ;; memory count can be zero
671 ;; 1 memory declared, 0 given
674 "\00asm" "\01\00\00\00"
675 "\05\01\01" ;; memory section with inconsistent count (1 declared, 0 given)
676 ;; "\00\00" ;; memory 0 (missed)
678 "unexpected end of section or function"
681 ;; Malformed memory limits flag
684 "\00asm" "\01\00\00\00"
685 "\05\02\01" ;; memory section with one entry
686 "\08" ;; malformed memory limits flag
688 "malformed limits flags"
692 "\00asm" "\01\00\00\00"
693 "\05\03\01" ;; memory section with one entry
694 "\08" ;; malformed memory limits flag
697 "malformed limits flags"
701 "\00asm" "\01\00\00\00"
702 "\05\05\01" ;; memory section with one entry
703 "\81\00" ;; malformed memory limits flag as LEB128
704 "\00\00" ;; dummy bytes
706 "malformed limits flags"
710 "\00asm" "\01\00\00\00"
711 "\05\05\01" ;; memory section with one entry
712 "\81\01" ;; malformed memory limits flag as LEB128
713 "\00\00" ;; dummy bytes
715 "malformed limits flags"
718 ;; Global count can be zero
720 "\00asm" "\01\00\00\00"
721 "\06\01\00" ;; global count can be zero
724 ;; 2 global declared, 1 given
727 "\00asm" "\01\00\00\00"
728 "\06\06\02" ;; global section with inconsistent count (2 declared, 1 given)
729 "\7f\00\41\00\0b" ;; global 0
730 ;; "\7f\00\41\00\0b" ;; global 1 (missed)
732 "unexpected end of section or function"
735 ;; 1 global declared, 2 given
738 "\00asm" "\01\00\00\00"
739 "\06\0b\01" ;; global section with inconsistent count (1 declared, 2 given)
740 "\7f\00\41\00\0b" ;; global 0
741 "\7f\00\41\00\0b" ;; global 1 (redundant)
743 "section size mismatch"
746 ;; Export count can be 0
748 "\00asm" "\01\00\00\00"
749 "\01\04\01" ;; type section
750 "\60\00\00" ;; type 0
751 "\03\03\02\00\00" ;; func section
752 "\07\01\00" ;; export count can be zero
753 "\0a\07\02" ;; code section
754 "\02\00\0b" ;; function body 0
755 "\02\00\0b" ;; function body 1
758 ;; 2 export declared, 1 given
761 "\00asm" "\01\00\00\00"
762 "\01\04\01" ;; type section
763 "\60\00\00" ;; type 0
764 "\03\03\02\00\00" ;; func section
765 "\07\06\02" ;; export section with inconsistent count (2 declared, 1 given)
767 "\66\31" ;; export name
768 "\00\00" ;; export kind, export func index
769 ;; "\02" ;; export 1 (missed)
770 ;; "\66\32" ;; export name
771 ;; "\00\01" ;; export kind, export func index
772 "\0a\07\02" ;; code section
773 "\02\00\0b" ;; function body 0
774 "\02\00\0b" ;; function body 1
776 "unexpected end of section or function"
779 ;; 1 export declared, 2 given
782 "\00asm" "\01\00\00\00"
783 "\01\04\01" ;; type section
784 "\60\00\00" ;; type 0
785 "\03\03\02\00\00" ;; func section
786 "\07\0b\01" ;; export section with inconsistent count (1 declared, 2 given)
788 "\66\31" ;; export name
789 "\00\00" ;; export kind, export func index
790 "\02" ;; export 1 (redundant)
791 "\66\32" ;; export name
792 "\00\01" ;; export kind, export func index
793 "\0a\07\02" ;; code section
794 "\02\00\0b" ;; function body 0
795 "\02\00\0b" ;; function body 1
797 "section size mismatch"
800 ;; elem segment count can be zero
802 "\00asm" "\01\00\00\00"
803 "\01\04\01" ;; type section
804 "\60\00\00" ;; type 0
805 "\03\02\01\00" ;; func section
806 "\04\04\01" ;; table section
807 "\70\00\01" ;; table 0
808 "\09\01\00" ;; elem segment count can be zero
809 "\0a\04\01" ;; code section
810 "\02\00\0b" ;; function body
813 ;; 2 elem segment declared, 1 given
816 "\00asm" "\01\00\00\00"
817 "\01\04\01" ;; type section
818 "\60\00\00" ;; type 0
819 "\03\02\01\00" ;; func section
820 "\04\04\01" ;; table section
821 "\70\00\01" ;; table 0
822 "\09\07\02" ;; elem with inconsistent segment count (2 declared, 1 given)
823 "\00\41\00\0b\01\00" ;; elem 0
824 ;; "\00\41\00\0b\01\00" ;; elem 1 (missed)
829 ;; 2 elem segment declared, 1.5 given
832 "\00asm" "\01\00\00\00"
833 "\01\04\01" ;; type section
834 "\60\00\00" ;; type 0
835 "\03\02\01\00" ;; func section
836 "\04\04\01" ;; table section
837 "\70\00\01" ;; table 0
838 "\09\07\02" ;; elem with inconsistent segment count (2 declared, 1 given)
839 "\00\41\00\0b\01\00" ;; elem 0
840 "\00\41\00" ;; elem 1 (partial)
841 ;; "\0b\01\00" ;; elem 1 (missing part)
846 ;; 1 elem segment declared, 2 given
849 "\00asm" "\01\00\00\00"
850 "\01\04\01" ;; type section
851 "\60\00\00" ;; type 0
852 "\03\02\01\00" ;; func section
853 "\04\04\01" ;; table section
854 "\70\00\01" ;; table 0
855 "\09\0d\01" ;; elem with inconsistent segment count (1 declared, 2 given)
856 "\00\41\00\0b\01\00" ;; elem 0
857 "\00\41\00\0b\01\00" ;; elem 1 (redundant)
858 "\0a\04\01" ;; code section
859 "\02\00\0b" ;; function body
861 "section size mismatch"
864 ;; data segment count can be zero
866 "\00asm" "\01\00\00\00"
867 "\05\03\01" ;; memory section
869 "\0b\01\00" ;; data segment count can be zero
872 ;; 2 data segment declared, 1 given
875 "\00asm" "\01\00\00\00"
876 "\05\03\01" ;; memory section
878 "\0b\07\02" ;; data with inconsistent segment count (2 declared, 1 given)
879 "\00\41\00\0b\01\61" ;; data 0
880 ;; "\00\41\01\0b\01\62" ;; data 1 (missed)
882 "unexpected end of section or function"
885 ;; 1 data segment declared, 2 given
888 "\00asm" "\01\00\00\00"
889 "\05\03\01" ;; memory section
891 "\0b\0d\01" ;; data with inconsistent segment count (1 declared, 2 given)
892 "\00\41\00\0b\01\61" ;; data 0
893 "\00\41\01\0b\01\62" ;; data 1 (redundant)
895 "section size mismatch"
898 ;; data segment has 7 bytes declared, but 6 bytes given
901 "\00asm" "\01\00\00\00"
902 "\05\03\01" ;; memory section
904 "\0b\0c\01" ;; data section
905 "\00\41\03\0b" ;; data segment 0
906 "\07" ;; data segment size with inconsistent lengths (7 declared, 6 given)
907 "\61\62\63\64\65\66" ;; 6 bytes given
909 "unexpected end of section or function"
912 ;; data segment has 5 bytes declared, but 6 bytes given
915 "\00asm" "\01\00\00\00"
916 "\05\03\01" ;; memory section
918 "\0b\0c\01" ;; data section
919 "\00\41\00\0b" ;; data segment 0
920 "\05" ;; data segment size with inconsistent lengths (5 declared, 6 given)
921 "\61\62\63\64\65\66" ;; 6 bytes given
923 "section size mismatch"
926 ;; br_table target count can be zero
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 "\0a\11\01" ;; code section
935 "\41\01" ;; condition of if 0
937 "\41\01" ;; index of br_table element
938 "\0e\00" ;; br_table target count can be zero
939 "\02" ;; break depth for default
943 ;; 1 br_table target 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 "\0a\12\01" ;; code section
953 "\41\01" ;; condition of if 0
955 "\41\01" ;; index of br_table element
956 "\0e\01" ;; br_table with inconsistent target count (1 declared, 2 given)
957 "\00" ;; break depth 0
958 "\01" ;; break depth 1
959 "\02" ;; break depth for default
967 "\00asm" "\01\00\00\00"
968 "\01\04\01\60\00\00" ;; Type section
969 "\03\02\01\00" ;; Function section
970 "\08\01\00" ;; Start section: function 0
972 "\0a\04\01" ;; Code section
978 ;; Multiple start sections
981 "\00asm" "\01\00\00\00"
982 "\01\04\01\60\00\00" ;; Type section
983 "\03\02\01\00" ;; Function section
984 "\08\01\00" ;; Start section: function 0
985 "\08\01\00" ;; Start section: function 0
987 "\0a\04\01" ;; Code section
992 "junk after last section"