Skip to content

Commit d7f5078

Browse files
github-actions[bot]WebAssembly/testsuite auto-update
andauthored
Auto-update for 2025-10-10 (#139)
Update repos: custom-descriptors: WebAssembly/custom-descriptors@b9d6399 This change was automatically generated by `update-testsuite.py` Co-authored-by: WebAssembly/testsuite auto-update <github-actions@users.noreply.github.com>
1 parent 1d77fd1 commit d7f5078

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
;; Descriptor and describes pair.
3+
(module binary
4+
"\00asm" "\01\00\00\00"
5+
"\01" ;; Type section id
6+
"\0b" ;; Type section length
7+
"\01" ;; Types vector length
8+
"\4e" ;; Recursion group
9+
"\02" ;; Rec group size
10+
"\4d" ;; Descriptor
11+
"\01" ;; Descriptor type index
12+
"\5f" ;; Struct
13+
"\00" ;; Number of fields
14+
"\4c" ;; Describes
15+
"\00" ;; Describes type index
16+
"\5f" ;; Struct
17+
"\00" ;; Number of fields
18+
)
19+
20+
;; Descriptor chain with three types.
21+
(module binary
22+
"\00asm" "\01\00\00\00"
23+
"\01" ;; Type section id
24+
"\11" ;; Type section length
25+
"\01" ;; Types vector length
26+
"\4e" ;; Recursion group
27+
"\03" ;; Rec group size
28+
"\4d" ;; Descriptor
29+
"\01" ;; Descriptor type index
30+
"\5f" ;; Struct
31+
"\00" ;; Number of fields
32+
"\4c" ;; Describes
33+
"\00" ;; Describes type index
34+
"\4d" ;; Descriptor
35+
"\02" ;; Descriptor type index
36+
"\5f" ;; Struct
37+
"\00" ;; Number of fields
38+
"\4c" ;; Describes
39+
"\01" ;; Describes type index
40+
"\5f" ;; Struct
41+
"\00" ;; Number of fields
42+
)
43+
44+
;; Descriptor chain with three types, but middle type has descriptor before
45+
;; describes.
46+
(assert_malformed
47+
(module binary
48+
"\00asm" "\01\00\00\00"
49+
"\01" ;; Type section id
50+
"\11" ;; Type section length
51+
"\01" ;; Types vector length
52+
"\4e" ;; Recursion group
53+
"\03" ;; Rec group size
54+
"\4d" ;; Descriptor
55+
"\01" ;; Descriptor type index
56+
"\5f" ;; Struct
57+
"\00" ;; Number of fields
58+
"\4d" ;; Descriptor - This is out of order
59+
"\02" ;; Descriptor type index
60+
"\4c" ;; Describes
61+
"\00" ;; Describes type index
62+
"\5f" ;; Struct
63+
"\00" ;; Number of fields
64+
"\4c" ;; Describes
65+
"\01" ;; Describes type index
66+
"\5f" ;; Struct
67+
"\00" ;; Number of fields
68+
)
69+
"malformed definition type"
70+
)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
;; Type syntax
2+
3+
(module
4+
(rec
5+
(type (descriptor 1) (struct))
6+
(type (describes 0) (struct))
7+
)
8+
)
9+
10+
(module
11+
(rec
12+
(type (descriptor 1) (struct))
13+
(type (describes 0) (struct))
14+
)
15+
(rec
16+
(type $a (descriptor $b) (struct))
17+
(type $b (describes $a) (struct))
18+
)
19+
(rec
20+
(type $c (sub (descriptor $d) (struct)))
21+
(type $d (sub (describes $c) (struct)))
22+
)
23+
(rec
24+
(type $e (sub final (descriptor $f) (struct)))
25+
(type $f (sub final (describes $e) (struct)))
26+
)
27+
(rec
28+
(type $g (sub $c (descriptor $h) (struct)))
29+
(type $h (sub $d (describes $g) (struct)))
30+
)
31+
(rec
32+
(type $i (sub final $g (descriptor $j) (struct (field i32))))
33+
(type $j (sub final $h (describes $i) (struct (field f32))))
34+
)
35+
(rec
36+
(type $k (descriptor $l) (struct))
37+
(type $l (describes $k) (descriptor $m) (struct))
38+
(type $m (describes $l) (struct))
39+
)
40+
)
41+
42+
;; Describes clause must precede descriptor clause.
43+
(assert_malformed
44+
(module quote
45+
"(rec"
46+
" (type $a (descriptor $b) (struct))"
47+
" (type $b (descriptor $c) (describes $a) (struct))"
48+
" (type $c (describes $b) (struct))"
49+
")"
50+
)
51+
"unexpected token"
52+
)
53+
54+
;; Cannot have multiple descriptor clauses.
55+
(assert_malformed
56+
(module quote
57+
"(rec"
58+
" (type $a (descriptor $b) (descriptor $b) (struct))"
59+
" (type $b (describes $a) (struct))"
60+
")"
61+
)
62+
"unexpected token"
63+
)
64+
65+
;; Cannot have multiple describes clauses.
66+
(assert_malformed
67+
(module quote
68+
"(rec"
69+
" (type $a (descriptor $b) (struct))"
70+
" (type $b (describes $a) (describes $a) (struct))"
71+
")"
72+
)
73+
"unexpected token"
74+
)

0 commit comments

Comments
 (0)