summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-05-04 17:50:29 -0700
committerGitHub <noreply@github.com>2022-05-04 17:50:29 -0700
commit996cbd861c0cae4c942cc57b1915af5ea7b4d5f5 (patch)
treee0318d1a61c31a8498b8a68e3e175758800deb5b /test
parentef4011c665f225f895861ce555c9347eb505c89f (diff)
downloadbinaryen-996cbd861c0cae4c942cc57b1915af5ea7b4d5f5.tar.gz
binaryen-996cbd861c0cae4c942cc57b1915af5ea7b4d5f5.tar.bz2
binaryen-996cbd861c0cae4c942cc57b1915af5ea7b4d5f5.zip
Parse the prototype nominal binary format (#4644)
In f124a11ca3 we removed support for the prototype nominal binary format entirely, but that means that we can no longer parse older binary modules that used that format. Fix this regression by restoring the ability to parse the prototype binary format.
Diffstat (limited to 'test')
-rw-r--r--test/lit/binary/prototype-nominal-format.test27
-rw-r--r--test/lit/binary/prototype-nominal-format.test.wasmbin0 -> 211 bytes
2 files changed, 27 insertions, 0 deletions
diff --git a/test/lit/binary/prototype-nominal-format.test b/test/lit/binary/prototype-nominal-format.test
new file mode 100644
index 000000000..def3e1473
--- /dev/null
+++ b/test/lit/binary/prototype-nominal-format.test
@@ -0,0 +1,27 @@
+;; Test the we can properly parse the prototype nominal binary format that we no
+;; longer emit.
+
+;; RUN: wasm-dis %s.wasm -all | filecheck %s
+
+;; CHECK: (module
+;; CHECK-NEXT: (type $super-struct (struct (field i32)))
+;; CHECK-NEXT: (type $sub-struct (struct (field i32) (field i64)))
+;; CHECK-NEXT: (type $none_=>_ref|$super-struct| (func (result (ref $super-struct))))
+;; CHECK-NEXT: (type $none_=>_ref|$sub-struct| (func (result (ref $sub-struct))))
+;; CHECK-NEXT: (type $none_=>_ref|$super-array| (func (result (ref $super-array))))
+;; CHECK-NEXT: (type $none_=>_ref|$sub-array| (func (result (ref $sub-array))))
+;; CHECK-NEXT: (type $super-array (array (ref $super-struct)))
+;; CHECK-NEXT: (type $sub-array (array (ref $sub-struct)))
+;; CHECK-NEXT: (func $make-super-struct (result (ref $super-struct))
+;; CHECK-NEXT: (call $make-sub-struct)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (func $make-sub-struct (result (ref $sub-struct))
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (func $make-super-array (result (ref $super-array))
+;; CHECK-NEXT: (call $make-sub-array)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (func $make-sub-array (result (ref $sub-array))
+;; CHECK-NEXT: (unreachable)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
diff --git a/test/lit/binary/prototype-nominal-format.test.wasm b/test/lit/binary/prototype-nominal-format.test.wasm
new file mode 100644
index 000000000..97485ae4f
--- /dev/null
+++ b/test/lit/binary/prototype-nominal-format.test.wasm
Binary files differ