@@ -138,10 +138,30 @@ index bc1cc324..14af14ae 100644
138138 (assert_return (invoke "call_imported_elem") (i32.const 42))
139139+ ;;)
140140diff --git a/test/core/gc/array.wast b/test/core/gc/array.wast
141- index 6ad95c08..a184435d 100644
141+ index 6ad95c08..17672d33 100644
142142--- a/test/core/gc/array.wast
143143+++ b/test/core/gc/array.wast
144- @@ -95,7 +95,10 @@
144+ @@ -7,7 +7,8 @@
145+ (type (array i64))
146+ (type (array f32))
147+ (type (array f64))
148+ - (type (array anyref))
149+ + ;; Disable because `anyref` in fileds of composite types is not supported yet
150+ + ;; (type (array anyref))
151+ (type (array (ref struct)))
152+ (type (array (ref 0)))
153+ (type (array (ref null 1)))
154+ @@ -17,7 +18,8 @@
155+ (type (array (mut i64)))
156+ (type (array (mut i32)))
157+ (type (array (mut i64)))
158+ - (type (array (mut anyref)))
159+ + ;; Disable because `anyref` in fileds of composite types is not supported yet
160+ + ;; (type (array (mut anyref)))
161+ (type (array (mut (ref struct))))
162+ (type (array (mut (ref 0))))
163+ (type (array (mut (ref null i31))))
164+ @@ -95,7 +97,10 @@
145165 )
146166
147167 (assert_return (invoke "new") (ref.array))
@@ -153,7 +173,7 @@ index 6ad95c08..a184435d 100644
153173 (assert_return (invoke "get" (i32.const 0)) (f32.const 0))
154174 (assert_return (invoke "set_get" (i32.const 1) (f32.const 7)) (f32.const 7))
155175 (assert_return (invoke "len") (i32.const 3))
156- @@ -140,7 +143 ,10 @@
176+ @@ -140,7 +145 ,10 @@
157177 )
158178
159179 (assert_return (invoke "new") (ref.array))
@@ -165,7 +185,7 @@ index 6ad95c08..a184435d 100644
165185 (assert_return (invoke "get" (i32.const 0)) (f32.const 1))
166186 (assert_return (invoke "set_get" (i32.const 1) (f32.const 7)) (f32.const 7))
167187 (assert_return (invoke "len") (i32.const 2))
168- @@ -192,7 +198 ,10 @@
188+ @@ -192,7 +200 ,10 @@
169189 )
170190
171191 (assert_return (invoke "new") (ref.array))
@@ -177,22 +197,49 @@ index 6ad95c08..a184435d 100644
177197 (assert_return (invoke "get_u" (i32.const 2)) (i32.const 0xff))
178198 (assert_return (invoke "get_s" (i32.const 2)) (i32.const -1))
179199 (assert_return (invoke "set_get" (i32.const 1) (i32.const 7)) (i32.const 7))
180- @@ -202,6 +211 ,7 @@
200+ @@ -202,6 +213 ,7 @@
181201 (assert_trap (invoke "get_s" (i32.const 10)) "out of bounds array access")
182202 (assert_trap (invoke "set_get" (i32.const 10) (i32.const 7)) "out of bounds array access")
183203
184204+ (;; Activate once aligned `array.new_elem`
185205 (module
186206 (type $bvec (array i8))
187207 (type $vec (array (ref $bvec)))
188- @@ -260,6 +270 ,7 @@
208+ @@ -260,6 +272 ,7 @@
189209
190210 (assert_trap (invoke "get" (i32.const 10) (i32.const 0)) "out of bounds array access")
191211 (assert_trap (invoke "set_get" (i32.const 10) (i32.const 0) (i32.const 0)) "out of bounds array access")
192212+ ;;)
193213
194214 (assert_invalid
195215 (module
216+ diff --git a/test/core/gc/array_fill.wast b/test/core/gc/array_fill.wast
217+ index 0379ad53..73122178 100644
218+ --- a/test/core/gc/array_fill.wast
219+ +++ b/test/core/gc/array_fill.wast
220+ @@ -79,3 +79,22 @@
221+ (assert_return (invoke "array_get_nth" (i32.const 2)) (i32.const 11))
222+ (assert_return (invoke "array_get_nth" (i32.const 3)) (i32.const 11))
223+ (assert_return (invoke "array_get_nth" (i32.const 4)) (i32.const 0))
224+ +
225+ + ;; fill the whole array
226+ + (assert_return (invoke "array_fill" (i32.const 0) (i32.const 42) (i32.const 12)))
227+ + (assert_return (invoke "array_get_nth" (i32.const 0)) (i32.const 42))
228+ + (assert_return (invoke "array_get_nth" (i32.const 2)) (i32.const 42))
229+ + (assert_return (invoke "array_get_nth" (i32.const 5)) (i32.const 42))
230+ + (assert_return (invoke "array_get_nth" (i32.const 11)) (i32.const 42))
231+ +
232+ + ;; fill the first element
233+ + (assert_return (invoke "array_fill" (i32.const 0) (i32.const 7) (i32.const 1)))
234+ + (assert_return (invoke "array_get_nth" (i32.const 0)) (i32.const 7))
235+ + (assert_return (invoke "array_get_nth" (i32.const 1)) (i32.const 42))
236+ + (assert_return (invoke "array_get_nth" (i32.const 11)) (i32.const 42))
237+ +
238+ + ;; fill the last 2 elements
239+ + (assert_return (invoke "array_fill" (i32.const 10) (i32.const 9) (i32.const 2)))
240+ + (assert_return (invoke "array_get_nth" (i32.const 9)) (i32.const 42))
241+ + (assert_return (invoke "array_get_nth" (i32.const 10)) (i32.const 9))
242+ + (assert_return (invoke "array_get_nth" (i32.const 11)) (i32.const 9))
196243diff --git a/test/core/gc/br_on_cast.wast b/test/core/gc/br_on_cast.wast
197244index 3c895c07..147f9a1a 100644
198245--- a/test/core/gc/br_on_cast.wast
@@ -309,6 +356,100 @@ index 6309e72b..39f35692 100644
309356 (assert_return (invoke "get" (i32.const 3)) (i32.const 789))
310357+ ;;
311358+ ;;)
359+ diff --git a/test/core/gc/struct.wast b/test/core/gc/struct.wast
360+ index 6151fe10..d501cd3c 100644
361+ --- a/test/core/gc/struct.wast
362+ +++ b/test/core/gc/struct.wast
363+ @@ -6,8 +6,9 @@
364+ (type (struct (field i8)))
365+ (type (struct (field i8 i8 i8 i8)))
366+ (type (struct (field $x1 i32) (field $y1 i32)))
367+ - (type (struct (field i8 i16 i32 i64 f32 f64 anyref funcref (ref 0) (ref null 1))))
368+ - (type (struct (field i32 i64 i8) (field) (field) (field (ref null i31) anyref)))
369+ + ;; Disable because `anyref` in fileds of composite types is not supported yet
370+ + ;; (type (struct (field i8 i16 i32 i64 f32 f64 anyref funcref (ref 0) (ref null 1))))
371+ + ;; (type (struct (field i32 i64 i8) (field) (field) (field (ref null i31) anyref)))
372+ (type (struct (field $x2 i32) (field f32 f64) (field $y2 i32)))
373+ )
374+
375+ diff --git a/test/core/gc/type-subtyping.wast b/test/core/gc/type-subtyping.wast
376+ index f2b33d7c..a61560c2 100644
377+ --- a/test/core/gc/type-subtyping.wast
378+ +++ b/test/core/gc/type-subtyping.wast
379+ @@ -4,7 +4,8 @@
380+ (type $e0 (sub (array i32)))
381+ (type $e1 (sub $e0 (array i32)))
382+
383+ - (type $e2 (sub (array anyref)))
384+ + ;; Disable because `anyref` in fileds of composite types is not supported yet
385+ + ;; (type $e2 (sub (array anyref)))
386+ (type $e3 (sub (array (ref null $e0))))
387+ (type $e4 (sub (array (ref $e1))))
388+
389+ @@ -32,35 +33,36 @@
390+ )
391+
392+
393+ + ;; Disable because `anyref` in fileds of composite types is not supported yet
394+ ;; Recursive definitions
395+
396+ - (module
397+ - (type $t (sub (struct (field anyref))))
398+ - (rec (type $r (sub $t (struct (field (ref $r))))))
399+ - (type $t' (sub $r (struct (field (ref $r) i32))))
400+ - )
401+ -
402+ - (module
403+ - (rec
404+ - (type $r1 (sub (struct (field i32 (ref $r1)))))
405+ - )
406+ - (rec
407+ - (type $r2 (sub $r1 (struct (field i32 (ref $r3)))))
408+ - (type $r3 (sub $r1 (struct (field i32 (ref $r2)))))
409+ - )
410+ - )
411+ -
412+ - (module
413+ - (rec
414+ - (type $a1 (sub (struct (field i32 (ref $a2)))))
415+ - (type $a2 (sub (struct (field i64 (ref $a1)))))
416+ - )
417+ - (rec
418+ - (type $b1 (sub $a2 (struct (field i64 (ref $a1) i32))))
419+ - (type $b2 (sub $a1 (struct (field i32 (ref $a2) i32))))
420+ - (type $b3 (sub $a2 (struct (field i64 (ref $b2) i32))))
421+ - )
422+ - )
423+ + ;; (module
424+ + ;; (type $t (sub (struct (field anyref))))
425+ + ;; (rec (type $r (sub $t (struct (field (ref $r))))))
426+ + ;; (type $t' (sub $r (struct (field (ref $r) i32))))
427+ + ;; )
428+ +
429+ + ;; (module
430+ + ;; (rec
431+ + ;; (type $r1 (sub (struct (field i32 (ref $r1)))))
432+ + ;; )
433+ + ;; (rec
434+ + ;; (type $r2 (sub $r1 (struct (field i32 (ref $r3)))))
435+ + ;; (type $r3 (sub $r1 (struct (field i32 (ref $r2)))))
436+ + ;; )
437+ + ;; )
438+ +
439+ + ;; (module
440+ + ;; (rec
441+ + ;; (type $a1 (sub (struct (field i32 (ref $a2)))))
442+ + ;; (type $a2 (sub (struct (field i64 (ref $a1)))))
443+ + ;; )
444+ + ;; (rec
445+ + ;; (type $b1 (sub $a2 (struct (field i64 (ref $a1) i32))))
446+ + ;; (type $b2 (sub $a1 (struct (field i32 (ref $a2) i32))))
447+ + ;; (type $b3 (sub $a2 (struct (field i64 (ref $b2) i32))))
448+ + ;; )
449+ + ;; )
450+
451+
452+ ;; Subsumption
312453diff --git a/test/core/global.wast b/test/core/global.wast
313454index 8c47fde2..8d3d8228 100644
314455--- a/test/core/global.wast
0 commit comments