From 2d6122038af4a3c2bb4014010d5a597bdc649b63 Mon Sep 17 00:00:00 2001 From: WebAssembly/testsuite auto-update Date: Wed, 26 Nov 2025 20:08:37 +0000 Subject: [PATCH] Auto-update for 2025-11-26 Update repos: custom-descriptors: https://github.com/WebAssembly/custom-descriptors/commit/da3a2907e6c8be35665e7b7d6e8dfeee82789169 This change was automatically generated by `update-testsuite.py` --- .../custom-descriptors/br_on_cast_desc.wast | 6 +- .../br_on_cast_desc_fail.wast | 6 +- .../custom-descriptors/ref_cast_desc.wast | 4 +- .../custom-descriptors/ref_get_desc.wast | 26 +- .../custom-descriptors/struct_new_desc.wast | 265 ++++++++++++++---- 5 files changed, 226 insertions(+), 81 deletions(-) diff --git a/proposals/custom-descriptors/br_on_cast_desc.wast b/proposals/custom-descriptors/br_on_cast_desc.wast index e5d4358..e888ff3 100644 --- a/proposals/custom-descriptors/br_on_cast_desc.wast +++ b/proposals/custom-descriptors/br_on_cast_desc.wast @@ -1126,13 +1126,13 @@ (global $b2-exact (ref null (exact $b)) (struct.new $b)) (global $b1 (ref null $b) (global.get $b1-exact)) (global $b2 (ref null $b) (global.get $b2-exact)) - (global $a1 (ref null $a) (struct.new $a (global.get $b1-exact))) + (global $a1 (ref null $a) (struct.new_desc $a (global.get $b1-exact))) (global $d1-exact (ref null (exact $d)) (struct.new $d)) (global $d2-exact (ref null (exact $d)) (struct.new $d)) (global $d1 (ref null $d) (global.get $d1-exact)) (global $d2 (ref null $d) (global.get $d2-exact)) - (global $c1 (ref null $c) (struct.new $c (global.get $d1-exact))) + (global $c1 (ref null $c) (struct.new_desc $c (global.get $d1-exact))) (global $c1-as-a (ref null $a) (global.get $c1)) @@ -1916,7 +1916,7 @@ (global $b1 (ref (exact $b)) (struct.new $b)) (global $b2 (ref (exact $b)) (struct.new $b)) - (global $a1 (ref (exact $a)) (struct.new $a (global.get $b1))) + (global $a1 (ref (exact $a)) (struct.new_desc $a (global.get $b1))) (func $assert-eq-i32 (param i32 i32) (if diff --git a/proposals/custom-descriptors/br_on_cast_desc_fail.wast b/proposals/custom-descriptors/br_on_cast_desc_fail.wast index 268f691..d85e983 100644 --- a/proposals/custom-descriptors/br_on_cast_desc_fail.wast +++ b/proposals/custom-descriptors/br_on_cast_desc_fail.wast @@ -1112,13 +1112,13 @@ (global $b2-exact (ref null (exact $b)) (struct.new $b)) (global $b1 (ref null $b) (global.get $b1-exact)) (global $b2 (ref null $b) (global.get $b2-exact)) - (global $a1 (ref null $a) (struct.new $a (global.get $b1-exact))) + (global $a1 (ref null $a) (struct.new_desc $a (global.get $b1-exact))) (global $d1-exact (ref null (exact $d)) (struct.new $d)) (global $d2-exact (ref null (exact $d)) (struct.new $d)) (global $d1 (ref null $d) (global.get $d1-exact)) (global $d2 (ref null $d) (global.get $d2-exact)) - (global $c1 (ref null $c) (struct.new $c (global.get $d1-exact))) + (global $c1 (ref null $c) (struct.new_desc $c (global.get $d1-exact))) (global $c1-as-a (ref null $a) (global.get $c1)) @@ -1902,7 +1902,7 @@ (global $b1 (ref (exact $b)) (struct.new $b)) (global $b2 (ref (exact $b)) (struct.new $b)) - (global $a1 (ref (exact $a)) (struct.new $a (global.get $b1))) + (global $a1 (ref (exact $a)) (struct.new_desc $a (global.get $b1))) (func $assert-eq-i32 (param i32 i32) (if diff --git a/proposals/custom-descriptors/ref_cast_desc.wast b/proposals/custom-descriptors/ref_cast_desc.wast index 71897e1..722965a 100644 --- a/proposals/custom-descriptors/ref_cast_desc.wast +++ b/proposals/custom-descriptors/ref_cast_desc.wast @@ -497,13 +497,13 @@ (global $b2-exact (ref null (exact $b)) (struct.new $b)) (global $b1 (ref null $b) (global.get $b1-exact)) (global $b2 (ref null $b) (global.get $b2-exact)) - (global $a1 (ref null $a) (struct.new $a (global.get $b1-exact))) + (global $a1 (ref null $a) (struct.new_desc $a (global.get $b1-exact))) (global $d1-exact (ref null (exact $d)) (struct.new $d)) (global $d2-exact (ref null (exact $d)) (struct.new $d)) (global $d1 (ref null $d) (global.get $d1-exact)) (global $d2 (ref null $d) (global.get $d2-exact)) - (global $c1 (ref null $c) (struct.new $c (global.get $d1-exact))) + (global $c1 (ref null $c) (struct.new_desc $c (global.get $d1-exact))) (global $c1-as-a (ref null $a) (global.get $c1)) diff --git a/proposals/custom-descriptors/ref_get_desc.wast b/proposals/custom-descriptors/ref_get_desc.wast index 97c8039..5d10b1b 100644 --- a/proposals/custom-descriptors/ref_get_desc.wast +++ b/proposals/custom-descriptors/ref_get_desc.wast @@ -305,9 +305,9 @@ (global $b1 (ref (exact $b)) (struct.new $b (i32.const 1))) (global $b2 (ref (exact $b)) (struct.new $b (i32.const 2))) - (global $a1 (ref null $a) (struct.new $a (global.get $b1))) - (global $a2 (ref null (exact $a)) (struct.new $a (global.get $b2))) - (global $a3 (ref (exact $a)) (struct.new $a (struct.new $b (i32.const 3)))) + (global $a1 (ref null $a) (struct.new_desc $a (global.get $b1))) + (global $a2 (ref null (exact $a)) (struct.new_desc $a (global.get $b2))) + (global $a3 (ref (exact $a)) (struct.new_desc $a (struct.new $b (i32.const 3)))) (global $null (ref null $a) (ref.null none)) (global $null-exact (ref null (exact $a)) (ref.null (exact $a))) @@ -315,10 +315,10 @@ (func $null (result (ref null $a)) (ref.null none)) (func $null-exact (result (ref null (exact $a))) (ref.null (exact $a))) (func $alloc-i32 (param i32) (result (ref (exact $a))) - (struct.new $a (struct.new $b (local.get 0))) + (struct.new_desc $a (struct.new $b (local.get 0))) ) (func $alloc-desc (param (ref (exact $b))) (result (ref (exact $a))) - (struct.new $a (local.get 0)) + (struct.new_desc $a (local.get 0)) ) (func (export "null") (result anyref) @@ -346,7 +346,7 @@ (func (export "alloc-0") (result i32) (struct.get $b 0 (ref.get_desc $a - (struct.new $a + (struct.new_desc $a (struct.new $b (i32.const 0) ) @@ -374,13 +374,13 @@ (local.set 0 (struct.new_default $b)) (ref.eq (local.get 0) - (ref.get_desc $a (struct.new $a (local.get 0))) + (ref.get_desc $a (struct.new_desc $a (local.get 0))) ) ) (func (export "not-equal") (result i32) (ref.eq (struct.new_default $b) - (ref.get_desc $a (struct.new $a (struct.new_default $b))) + (ref.get_desc $a (struct.new_desc $a (struct.new_default $b))) ) ) (func (export "chain-equal") (result i32) @@ -388,8 +388,8 @@ (local $two (ref null (exact $two))) (local $one (ref null (exact $one))) (local.set $three (struct.new $three)) - (local.set $two (struct.new $two (local.get $three))) - (local.set $one (struct.new $one (local.get $two))) + (local.set $two (struct.new_desc $two (local.get $three))) + (local.set $one (struct.new_desc $one (local.get $two))) (ref.eq (local.get $three) (ref.get_desc $two (ref.get_desc $one (local.get $one))) @@ -426,7 +426,7 @@ (global (export "b") (ref null (exact $b)) (struct.new $b)) (func (export "make-a") (result (ref null $a)) - (struct.new $a (global.get 0)) + (struct.new_desc $a (global.get 0)) ) (func (export "check-eq") (param (ref null $a)) (result i32) @@ -453,11 +453,11 @@ ) (func (export "imported-check-equal") (result i32) - (call $check-eq (struct.new $a (global.get $b))) + (call $check-eq (struct.new_desc $a (global.get $b))) ) (func (export "imported-check-not-equal") (result i32) - (call $check-eq (struct.new $a (struct.new $b))) + (call $check-eq (struct.new_desc $a (struct.new $b))) ) ) diff --git a/proposals/custom-descriptors/struct_new_desc.wast b/proposals/custom-descriptors/struct_new_desc.wast index e4dedc1..41c9c7e 100644 --- a/proposals/custom-descriptors/struct_new_desc.wast +++ b/proposals/custom-descriptors/struct_new_desc.wast @@ -11,78 +11,78 @@ ) (func (param (ref null (exact $empty.desc))) (result (ref (exact $empty))) - (struct.new $empty (local.get 0)) + (struct.new_desc $empty (local.get 0)) ) (func (param (ref null (exact $empty.desc))) (result (ref (exact $empty))) - (struct.new_default $empty (local.get 0)) + (struct.new_default_desc $empty (local.get 0)) ) (func (param (ref (exact $empty.desc))) (result (ref (exact $empty))) - (struct.new $empty (local.get 0)) + (struct.new_desc $empty (local.get 0)) ) (func (param (ref (exact $empty.desc))) (result (ref (exact $empty))) - (struct.new_default $empty (local.get 0)) + (struct.new_default_desc $empty (local.get 0)) ) (func (result (ref (exact $empty))) - (struct.new $empty (ref.null none)) + (struct.new_desc $empty (ref.null none)) ) (func (result (ref (exact $empty))) - (struct.new_default $empty (ref.null none)) + (struct.new_default_desc $empty (ref.null none)) ) (func (result (ref (exact $empty))) - (struct.new $empty (unreachable)) + (struct.new_desc $empty (unreachable)) ) (func (result (ref (exact $empty))) - (struct.new_default $empty (unreachable)) + (struct.new_default_desc $empty (unreachable)) ) (func (param (ref null (exact $one.desc))) (result (ref (exact $one))) - (struct.new $one (i32.const 0) (local.get 0)) + (struct.new_desc $one (i32.const 0) (local.get 0)) ) (func (param (ref null (exact $one.desc))) (result (ref (exact $one))) - (struct.new_default $one (local.get 0)) + (struct.new_default_desc $one (local.get 0)) ) (func (param (ref (exact $one.desc))) (result (ref (exact $one))) - (struct.new $one (i32.const 0) (local.get 0)) + (struct.new_desc $one (i32.const 0) (local.get 0)) ) (func (param (ref (exact $one.desc))) (result (ref (exact $one))) - (struct.new_default $one (local.get 0)) + (struct.new_default_desc $one (local.get 0)) ) (func (result (ref (exact $one))) - (struct.new $one (i32.const 0) (ref.null none)) + (struct.new_desc $one (i32.const 0) (ref.null none)) ) (func (result (ref (exact $one))) - (struct.new_default $one (ref.null none)) + (struct.new_default_desc $one (ref.null none)) ) (func (result (ref (exact $one))) - (struct.new $one (i32.const 0) (unreachable)) + (struct.new_desc $one (i32.const 0) (unreachable)) ) (func (result (ref (exact $one))) - (struct.new_default $one (unreachable)) + (struct.new_default_desc $one (unreachable)) ) (func (param (ref null (exact $pair.desc))) (result (ref (exact $pair))) - (struct.new $pair (i32.const 1) (i64.const 2) (local.get 0)) + (struct.new_desc $pair (i32.const 1) (i64.const 2) (local.get 0)) ) (func (param (ref null (exact $pair.desc))) (result (ref (exact $pair))) - (struct.new_default $pair (local.get 0)) + (struct.new_default_desc $pair (local.get 0)) ) (func (param (ref (exact $pair.desc))) (result (ref (exact $pair))) - (struct.new $pair (i32.const 1) (i64.const 2) (local.get 0)) + (struct.new_desc $pair (i32.const 1) (i64.const 2) (local.get 0)) ) (func (param (ref (exact $pair.desc))) (result (ref (exact $pair))) - (struct.new_default $pair (local.get 0)) + (struct.new_default_desc $pair (local.get 0)) ) (func (result (ref (exact $pair))) - (struct.new $pair (i32.const 1) (i64.const 2) (ref.null none)) + (struct.new_desc $pair (i32.const 1) (i64.const 2) (ref.null none)) ) (func (result (ref (exact $pair))) - (struct.new_default $pair (ref.null none)) + (struct.new_default_desc $pair (ref.null none)) ) (func (result (ref (exact $pair))) - (struct.new $pair (i32.const 1) (i64.const 2) (unreachable)) + (struct.new_desc $pair (i32.const 1) (i64.const 2) (unreachable)) ) (func (result (ref (exact $pair))) - (struct.new_default $pair (unreachable)) + (struct.new_default_desc $pair (unreachable)) ) ) @@ -95,14 +95,14 @@ ) (global $d (ref (exact $d)) (struct.new $d)) - (global $c (ref (exact $c)) (struct.new $c (global.get $d))) - (global $b (ref (exact $b)) (struct.new $b (global.get $c))) - (global $a (ref (exact $a)) (struct.new $a (global.get $b))) + (global $c (ref (exact $c)) (struct.new_desc $c (global.get $d))) + (global $b (ref (exact $b)) (struct.new_desc $b (global.get $c))) + (global $a (ref (exact $a)) (struct.new_desc $a (global.get $b))) (func (result (ref (exact $a))) - (struct.new $a - (struct.new $b - (struct.new $c + (struct.new_desc $a + (struct.new_desc $b + (struct.new_desc $c (struct.new $d) ) ) @@ -116,14 +116,84 @@ (type $a (descriptor $b) (struct (field i32))) (type $b (describes $a) (struct)) ) - ;; Missing descriptor. + ;; Missing descriptor and wrong allocation. (func (result anyref) (struct.new $a (i32.const 0)) ) ) + "type with descriptor requires descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Missing descriptor with correct allocation. + (func (result anyref) + (struct.new_desc $a (i32.const 0)) + ) + ) "type mismatch" ) +(assert_invalid + (module + (rec + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Wrong allocation. + (func (result anyref) + (struct.new $a (i32.const 0) (ref.null none)) + ) + ) + "type with descriptor requires descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Missing descriptor and wrong allocation. + (func (result anyref) + (struct.new_default $a) + ) + ) + "type with descriptor requires descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Missing descriptor with correct allocation. + (func (result anyref) + (struct.new_default_desc $a) + ) + ) + "type mismatch" +) + +(assert_invalid + (module + (rec + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Wrong allocation. + (func (result anyref) + (struct.new_default $a (ref.null none)) + ) + ) + "type with descriptor requires descriptor allocation" +) + (assert_invalid (module (rec @@ -139,6 +209,81 @@ "type mismatch" ) +(assert_invalid + (module + (rec + (type $struct (struct (field i32))) + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Descriptor provided and wrong allocation for a type without a descriptor. + (func (result anyref) + (struct.new_desc $struct (i32.const 0) (struct.new $b)) + ) + ) + "type without descriptor requires non-descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $struct (struct (field i32))) + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Wrong allocation for a type without a descriptor. + (func (result anyref) + (struct.new_desc $struct (i32.const 0)) + ) + ) + "type without descriptor requires non-descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $struct (struct (field i32))) + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Descriptor provided when allocating a type without a descriptor. + (func (result anyref) + (struct.new_default $struct (struct.new $b)) + ) + ) + "type mismatch" +) + +(assert_invalid + (module + (rec + (type $struct (struct (field i32))) + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Descriptor provided and wrong allocation for a type without a descriptor. + (func (result anyref) + (struct.new_default_desc $struct (struct.new $b)) + ) + ) + "type without descriptor requires non-descriptor allocation" +) + +(assert_invalid + (module + (rec + (type $struct (struct (field i32))) + (type $a (descriptor $b) (struct (field i32))) + (type $b (describes $a) (struct)) + ) + ;; Wrong allocation for a type without a descriptor. + (func (result anyref) + (struct.new_default_desc $struct) + ) + ) + "type without descriptor requires non-descriptor allocation" +) + (assert_invalid (module (rec @@ -147,7 +292,7 @@ ) ;; Descriptor does not have expected type. (func (param (ref struct)) (result anyref) - (struct.new $a (i32.const 0) (local.get 0)) + (struct.new_desc $a (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -161,7 +306,7 @@ ) ;; Descriptor must be exact. (func (param (ref $b)) (result anyref) - (struct.new $a (i32.const 0) (local.get 0)) + (struct.new_desc $a (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -175,7 +320,7 @@ ) ;; Allocated type cannot be used as descriptor. (func (param (ref (exact $a))) (result anyref) - (struct.new $a (i32.const 0) (local.get 0)) + (struct.new_desc $a (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -191,7 +336,7 @@ ) ;; Unrelated descriptor cannot be used as desciptor. (func (param (ref (exact $d))) (result anyref) - (struct.new $a (i32.const 0) (local.get 0)) + (struct.new_desc $a (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -207,7 +352,7 @@ ) ;; Subtype descriptor cannot be used as desciptor. (func (param (ref (exact $d))) (result anyref) - (struct.new $a (i32.const 0) (local.get 0)) + (struct.new_desc $a (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -223,7 +368,7 @@ ) ;; Supertype descriptor cannot be used as desciptor. (func (param (ref (exact $b))) (result anyref) - (struct.new $c (i32.const 0) (local.get 0)) + (struct.new_desc $c (i32.const 0) (local.get 0)) ) ) "type mismatch" @@ -237,7 +382,7 @@ ) ;; The correct descriptor is supplied, but the fields are missing. (func (result anyref) - (struct.new $a (struct.new $b)) + (struct.new_desc $a (struct.new $b)) ) ) "type mismatch" @@ -261,20 +406,20 @@ ) (global $b (export "b") (ref null (exact $b)) (struct.new $b)) - (global $a (export "a") (ref (exact $a)) (struct.new $a (global.get $b))) + (global $a (export "a") (ref (exact $a)) (struct.new_desc $a (global.get $b))) (global $null-b (ref null (exact $b)) (ref.null none)) (func (export "new-new") (result (ref (exact $a))) - (struct.new $a (struct.new $b)) + (struct.new_desc $a (struct.new $b)) ) (func (export "new-global") (result (ref (exact $a))) - (struct.new $a (global.get $b)) + (struct.new_desc $a (global.get $b)) ) (func (export "new-call") (result (ref (exact $a))) - (struct.new $a (call $new-b)) + (struct.new_desc $a (call $new-b)) ) (func $new-b (result (ref null (exact $b))) @@ -282,7 +427,7 @@ ) (func (export "new-pair") (result (ref (exact $pair))) - (struct.new $pair + (struct.new_desc $pair (i32.const 0) (i64.const 1) (struct.new $pair.desc @@ -292,23 +437,23 @@ ) (func (export "new-chain") (result (ref (exact $one))) - (struct.new $one - (struct.new $two + (struct.new_desc $one + (struct.new_desc $two (struct.new $three) ) ) ) (func (export "new-null") (result (ref (exact $a))) - (struct.new $a (ref.null none)) + (struct.new_desc $a (ref.null none)) ) (func (export "new-null-global") (result (ref (exact $a))) - (struct.new $a (global.get $null-b)) + (struct.new_desc $a (global.get $null-b)) ) (func (export "new-null-call") (result (ref (exact $a))) - (struct.new $a (call $null)) + (struct.new_desc $a (call $null)) ) (func $null (result (ref null (exact $b))) @@ -316,7 +461,7 @@ ) (func (export "new-null-pair") (result (ref (exact $pair))) - (struct.new $pair + (struct.new_desc $pair (i32.const 0) (i64.const 1) (ref.null (exact $pair.desc)) @@ -324,14 +469,14 @@ ) (func (export "new-null-chain-1") (result (ref (exact $one))) - (struct.new $one + (struct.new_desc $one (ref.null (exact $two)) ) ) (func (export "new-null-chain-2") (result (ref (exact $one))) - (struct.new $one - (struct.new $two + (struct.new_desc $one + (struct.new_desc $two (ref.null (exact $three)) ) ) @@ -357,7 +502,7 @@ (type $a (descriptor $b) (struct)) (type $b (describes $a) (struct)) ) - (global (ref (exact $a)) (struct.new $a (ref.null none))) + (global (ref (exact $a)) (struct.new_desc $a (ref.null none))) ) "null descriptor reference" ) @@ -368,7 +513,7 @@ (type $a (descriptor $b) (struct)) (type $b (describes $a) (struct)) ) - (global (ref (exact $a)) (struct.new $a (ref.null (exact $b)))) + (global (ref (exact $a)) (struct.new_desc $a (ref.null (exact $b)))) ) "null descriptor reference" ) @@ -380,7 +525,7 @@ (type $b (describes $a) (struct)) ) (global (ref null (exact $b)) (ref.null none)) - (global (ref (exact $a)) (struct.new $a (global.get 0))) + (global (ref (exact $a)) (struct.new_desc $a (global.get 0))) ) "null descriptor reference" ) @@ -421,22 +566,22 @@ (import "A" "new-b" (func $new-b (result (ref null (exact $b))))) (import "A" "new-null-b" (func $new-null-b (result (ref null (exact $b))))) - (global (export "a") (ref (exact $a)) (struct.new $a (global.get $b))) + (global (export "a") (ref (exact $a)) (struct.new_desc $a (global.get $b))) (func (export "new-global") (result (ref (exact $a))) - (struct.new $a (global.get $b)) + (struct.new_desc $a (global.get $b)) ) (func (export "new-call") (result (ref (exact $a))) - (struct.new $a (call $new-b)) + (struct.new_desc $a (call $new-b)) ) (func (export "null-global") (result (ref (exact $a))) - (struct.new $a (global.get $null-b)) + (struct.new_desc $a (global.get $null-b)) ) (func (export "null-call") (result (ref (exact $a))) - (struct.new $a (call $new-null-b)) + (struct.new_desc $a (call $new-null-b)) ) )