summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js')
-rw-r--r--js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js b/js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js
new file mode 100644
index 0000000000..6f5ce48282
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/gc/supertype_later_in_group.js
@@ -0,0 +1,15 @@
+// |jit-test| skip-if: !wasmGcEnabled()
+
+// Checking that we are correctly validating all subtyping rules.
+// In this example, $b should be a subtype of $a, even if their field types
+// will be loaded later.
+wasmValidateText(`
+(module
+ (rec
+ (type $a (struct (field (ref $notParsedYet))))
+ (type $b (sub $a (struct (field (ref $notParsedYet2)))))
+
+ (type $notParsedYet (struct))
+ (type $notParsedYet2 (sub $notParsedYet (struct (field i32))))
+ )
+)`);