Skip to content

Commit 68c6f83

Browse files
github-actions[bot]WebAssembly/testsuite auto-update
and
WebAssembly/testsuite auto-update
authored
Update repos: (#114)
spec: WebAssembly/spec@1878739 wasm-3.0: WebAssembly/spec@9d91344 gc: WebAssembly/gc@756060f memory64: WebAssembly/memory64@334f93f This change was automatically generated by `update-testsuite.py` Co-authored-by: WebAssembly/testsuite auto-update <[email protected]>
1 parent c4adde8 commit 68c6f83

9 files changed

+3960
-3
lines changed

float_exprs.wast

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
(assert_return (invoke "f64.no_fma" (f64.const 0x1.7e2c44058a799p+52) (f64.const 0x1.c73b71765b8b2p+685) (f64.const -0x1.16c641df0b108p+690)) (f64.const 0x1.53ccb53de0bd1p+738))
3636

3737
;; Test that x+0.0 is not folded to x.
38-
;; See IEEE 754-2008 10.4 "Literal meaning and value-changing optimizations".
38+
;; See IEEE 754-2019 10.4 "Literal meaning and value-changing optimizations".
3939

4040
(module
4141
(func (export "f32.no_fold_add_zero") (param $x f32) (result f32)
@@ -94,7 +94,7 @@
9494
(assert_return (invoke "f64.no_fold_mul_zero" (f64.const nan:0x4000000000000)) (f64.const nan:arithmetic))
9595

9696
;; Test that x*1.0 is not folded to x.
97-
;; See IEEE 754-2008 10.4 "Literal meaning and value-changing optimizations".
97+
;; See IEEE 754-2019 10.4 "Literal meaning and value-changing optimizations".
9898

9999
(module
100100
(func (export "f32.no_fold_mul_one") (param $x f32) (result f32)
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(assert_invalid
2+
(module
3+
;; When fields are mutable, a subtype's reference fields cannot be subtypes of
4+
;; the supertype's fields, they must match exactly.
5+
(type $a (sub (struct (field (mut (ref null any))))))
6+
(type $b (sub $a (struct (field (mut (ref null none))))))
7+
)
8+
"sub type 1 does not match super type"
9+
)
10+
11+
(assert_invalid
12+
(module
13+
;; When fields are const, a subtype's reference fields cannot be supertypes of
14+
;; the supertype's fields, they must be subtypes.
15+
(type $a (sub (struct (field (ref null none)))))
16+
(type $b (sub $a (struct (field (ref null any)))))
17+
)
18+
"sub type 1 does not match super type"
19+
)
20+
21+
(assert_invalid
22+
(module
23+
;; The mutability of fields must be the same.
24+
(type $c (sub (struct (field (mut (ref null any))))))
25+
(type $d (sub $c (struct (field (ref null any)))))
26+
)
27+
"sub type 1 does not match super type"
28+
)
29+
30+
(assert_invalid
31+
(module
32+
;; The mutability of fields must be the same.
33+
(type $c (sub (struct (field (ref null any)))))
34+
(type $d (sub $c (struct (field (mut (ref null any))))))
35+
)
36+
"sub type 1 does not match super type"
37+
)

proposals/memory64/float_exprs.wast

+2,624
Large diffs are not rendered by default.

proposals/memory64/i31.wast

+228
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
(module
2+
(func (export "new") (param $i i32) (result (ref i31))
3+
(ref.i31 (local.get $i))
4+
)
5+
6+
(func (export "get_u") (param $i i32) (result i32)
7+
(i31.get_u (ref.i31 (local.get $i)))
8+
)
9+
(func (export "get_s") (param $i i32) (result i32)
10+
(i31.get_s (ref.i31 (local.get $i)))
11+
)
12+
13+
(func (export "get_u-null") (result i32)
14+
(i31.get_u (ref.null i31))
15+
)
16+
(func (export "get_s-null") (result i32)
17+
(i31.get_u (ref.null i31))
18+
)
19+
20+
(global $i (ref i31) (ref.i31 (i32.const 2)))
21+
(global $m (mut (ref i31)) (ref.i31 (i32.const 3)))
22+
23+
(func (export "get_globals") (result i32 i32)
24+
(i31.get_u (global.get $i))
25+
(i31.get_u (global.get $m))
26+
)
27+
28+
(func (export "set_global") (param i32)
29+
(global.set $m (ref.i31 (local.get 0)))
30+
)
31+
)
32+
33+
(assert_return (invoke "new" (i32.const 1)) (ref.i31))
34+
35+
(assert_return (invoke "get_u" (i32.const 0)) (i32.const 0))
36+
(assert_return (invoke "get_u" (i32.const 100)) (i32.const 100))
37+
(assert_return (invoke "get_u" (i32.const -1)) (i32.const 0x7fff_ffff))
38+
(assert_return (invoke "get_u" (i32.const 0x3fff_ffff)) (i32.const 0x3fff_ffff))
39+
(assert_return (invoke "get_u" (i32.const 0x4000_0000)) (i32.const 0x4000_0000))
40+
(assert_return (invoke "get_u" (i32.const 0x7fff_ffff)) (i32.const 0x7fff_ffff))
41+
(assert_return (invoke "get_u" (i32.const 0xaaaa_aaaa)) (i32.const 0x2aaa_aaaa))
42+
(assert_return (invoke "get_u" (i32.const 0xcaaa_aaaa)) (i32.const 0x4aaa_aaaa))
43+
44+
(assert_return (invoke "get_s" (i32.const 0)) (i32.const 0))
45+
(assert_return (invoke "get_s" (i32.const 100)) (i32.const 100))
46+
(assert_return (invoke "get_s" (i32.const -1)) (i32.const -1))
47+
(assert_return (invoke "get_s" (i32.const 0x3fff_ffff)) (i32.const 0x3fff_ffff))
48+
(assert_return (invoke "get_s" (i32.const 0x4000_0000)) (i32.const -0x4000_0000))
49+
(assert_return (invoke "get_s" (i32.const 0x7fff_ffff)) (i32.const -1))
50+
(assert_return (invoke "get_s" (i32.const 0xaaaa_aaaa)) (i32.const 0x2aaa_aaaa))
51+
(assert_return (invoke "get_s" (i32.const 0xcaaa_aaaa)) (i32.const 0xcaaa_aaaa))
52+
53+
(assert_trap (invoke "get_u-null") "null i31 reference")
54+
(assert_trap (invoke "get_s-null") "null i31 reference")
55+
56+
(assert_return (invoke "get_globals") (i32.const 2) (i32.const 3))
57+
58+
(invoke "set_global" (i32.const 1234))
59+
(assert_return (invoke "get_globals") (i32.const 2) (i32.const 1234))
60+
61+
(module $tables_of_i31ref
62+
(table $table 3 10 i31ref)
63+
(elem (table $table) (i32.const 0) i31ref (item (ref.i31 (i32.const 999)))
64+
(item (ref.i31 (i32.const 888)))
65+
(item (ref.i31 (i32.const 777))))
66+
67+
(func (export "size") (result i32)
68+
table.size $table
69+
)
70+
71+
(func (export "get") (param i32) (result i32)
72+
(i31.get_u (table.get $table (local.get 0)))
73+
)
74+
75+
(func (export "grow") (param i32 i32) (result i32)
76+
(table.grow $table (ref.i31 (local.get 1)) (local.get 0))
77+
)
78+
79+
(func (export "fill") (param i32 i32 i32)
80+
(table.fill $table (local.get 0) (ref.i31 (local.get 1)) (local.get 2))
81+
)
82+
83+
(func (export "copy") (param i32 i32 i32)
84+
(table.copy $table $table (local.get 0) (local.get 1) (local.get 2))
85+
)
86+
87+
(elem $elem i31ref (item (ref.i31 (i32.const 123)))
88+
(item (ref.i31 (i32.const 456)))
89+
(item (ref.i31 (i32.const 789))))
90+
(func (export "init") (param i32 i32 i32)
91+
(table.init $table $elem (local.get 0) (local.get 1) (local.get 2))
92+
)
93+
)
94+
95+
;; Initial state.
96+
(assert_return (invoke "size") (i32.const 3))
97+
(assert_return (invoke "get" (i32.const 0)) (i32.const 999))
98+
(assert_return (invoke "get" (i32.const 1)) (i32.const 888))
99+
(assert_return (invoke "get" (i32.const 2)) (i32.const 777))
100+
101+
;; Grow from size 3 to size 5.
102+
(assert_return (invoke "grow" (i32.const 2) (i32.const 333)) (i32.const 3))
103+
(assert_return (invoke "size") (i32.const 5))
104+
(assert_return (invoke "get" (i32.const 3)) (i32.const 333))
105+
(assert_return (invoke "get" (i32.const 4)) (i32.const 333))
106+
107+
;; Fill table[2..4] = 111.
108+
(invoke "fill" (i32.const 2) (i32.const 111) (i32.const 2))
109+
(assert_return (invoke "get" (i32.const 2)) (i32.const 111))
110+
(assert_return (invoke "get" (i32.const 3)) (i32.const 111))
111+
112+
;; Copy from table[0..2] to table[3..5].
113+
(invoke "copy" (i32.const 3) (i32.const 0) (i32.const 2))
114+
(assert_return (invoke "get" (i32.const 3)) (i32.const 999))
115+
(assert_return (invoke "get" (i32.const 4)) (i32.const 888))
116+
117+
;; Initialize the passive element at table[1..4].
118+
(invoke "init" (i32.const 1) (i32.const 0) (i32.const 3))
119+
(assert_return (invoke "get" (i32.const 1)) (i32.const 123))
120+
(assert_return (invoke "get" (i32.const 2)) (i32.const 456))
121+
(assert_return (invoke "get" (i32.const 3)) (i32.const 789))
122+
123+
(module $env
124+
(global (export "g") i32 (i32.const 42))
125+
)
126+
(register "env")
127+
128+
(module $i31ref_of_global_table_initializer
129+
(global $g (import "env" "g") i32)
130+
(table $t 3 3 (ref i31) (ref.i31 (global.get $g)))
131+
(func (export "get") (param i32) (result i32)
132+
(i31.get_u (local.get 0) (table.get $t))
133+
)
134+
)
135+
136+
(assert_return (invoke "get" (i32.const 0)) (i32.const 42))
137+
(assert_return (invoke "get" (i32.const 1)) (i32.const 42))
138+
(assert_return (invoke "get" (i32.const 2)) (i32.const 42))
139+
140+
(module $i31ref_of_global_global_initializer
141+
(global $g0 (import "env" "g") i32)
142+
(global $g1 i31ref (ref.i31 (global.get $g0)))
143+
(func (export "get") (result i32)
144+
(i31.get_u (global.get $g1))
145+
)
146+
)
147+
148+
(assert_return (invoke "get") (i32.const 42))
149+
150+
(module $anyref_global_of_i31ref
151+
(global $c anyref (ref.i31 (i32.const 1234)))
152+
(global $m (mut anyref) (ref.i31 (i32.const 5678)))
153+
154+
(func (export "get_globals") (result i32 i32)
155+
(i31.get_u (ref.cast i31ref (global.get $c)))
156+
(i31.get_u (ref.cast i31ref (global.get $m)))
157+
)
158+
159+
(func (export "set_global") (param i32)
160+
(global.set $m (ref.i31 (local.get 0)))
161+
)
162+
)
163+
164+
(assert_return (invoke "get_globals") (i32.const 1234) (i32.const 5678))
165+
(invoke "set_global" (i32.const 0))
166+
(assert_return (invoke "get_globals") (i32.const 1234) (i32.const 0))
167+
168+
(module $anyref_table_of_i31ref
169+
(table $table 3 10 anyref)
170+
(elem (table $table) (i32.const 0) i31ref (item (ref.i31 (i32.const 999)))
171+
(item (ref.i31 (i32.const 888)))
172+
(item (ref.i31 (i32.const 777))))
173+
174+
(func (export "size") (result i32)
175+
table.size $table
176+
)
177+
178+
(func (export "get") (param i32) (result i32)
179+
(i31.get_u (ref.cast i31ref (table.get $table (local.get 0))))
180+
)
181+
182+
(func (export "grow") (param i32 i32) (result i32)
183+
(table.grow $table (ref.i31 (local.get 1)) (local.get 0))
184+
)
185+
186+
(func (export "fill") (param i32 i32 i32)
187+
(table.fill $table (local.get 0) (ref.i31 (local.get 1)) (local.get 2))
188+
)
189+
190+
(func (export "copy") (param i32 i32 i32)
191+
(table.copy $table $table (local.get 0) (local.get 1) (local.get 2))
192+
)
193+
194+
(elem $elem i31ref (item (ref.i31 (i32.const 123)))
195+
(item (ref.i31 (i32.const 456)))
196+
(item (ref.i31 (i32.const 789))))
197+
(func (export "init") (param i32 i32 i32)
198+
(table.init $table $elem (local.get 0) (local.get 1) (local.get 2))
199+
)
200+
)
201+
202+
;; Initial state.
203+
(assert_return (invoke "size") (i32.const 3))
204+
(assert_return (invoke "get" (i32.const 0)) (i32.const 999))
205+
(assert_return (invoke "get" (i32.const 1)) (i32.const 888))
206+
(assert_return (invoke "get" (i32.const 2)) (i32.const 777))
207+
208+
;; Grow from size 3 to size 5.
209+
(assert_return (invoke "grow" (i32.const 2) (i32.const 333)) (i32.const 3))
210+
(assert_return (invoke "size") (i32.const 5))
211+
(assert_return (invoke "get" (i32.const 3)) (i32.const 333))
212+
(assert_return (invoke "get" (i32.const 4)) (i32.const 333))
213+
214+
;; Fill table[2..4] = 111.
215+
(invoke "fill" (i32.const 2) (i32.const 111) (i32.const 2))
216+
(assert_return (invoke "get" (i32.const 2)) (i32.const 111))
217+
(assert_return (invoke "get" (i32.const 3)) (i32.const 111))
218+
219+
;; Copy from table[0..2] to table[3..5].
220+
(invoke "copy" (i32.const 3) (i32.const 0) (i32.const 2))
221+
(assert_return (invoke "get" (i32.const 3)) (i32.const 999))
222+
(assert_return (invoke "get" (i32.const 4)) (i32.const 888))
223+
224+
;; Initialize the passive element at table[1..4].
225+
(invoke "init" (i32.const 1) (i32.const 0) (i32.const 3))
226+
(assert_return (invoke "get" (i32.const 1)) (i32.const 123))
227+
(assert_return (invoke "get" (i32.const 2)) (i32.const 456))
228+
(assert_return (invoke "get" (i32.const 3)) (i32.const 789))

0 commit comments

Comments
 (0)