diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-02-03 10:48:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 10:48:11 -0800 |
commit | abc1df9fa0b36cc5cd5aa473c3809cd39cebc653 (patch) | |
tree | fe8c67b4141d21f1f757916e312383eb17e934f5 /test | |
parent | 13a9d521bce7780032b33c51725876e69f297bde (diff) | |
download | binaryen-abc1df9fa0b36cc5cd5aa473c3809cd39cebc653.tar.gz binaryen-abc1df9fa0b36cc5cd5aa473c3809cd39cebc653.tar.bz2 binaryen-abc1df9fa0b36cc5cd5aa473c3809cd39cebc653.zip |
Isorecursive binary format (#4494)
Write and parse recursion groups in binary type sections. Unlike in the text
format, where we ignore recursion groups when not using isorecursive types, do
not allow parsing binary recursion group when using other type systems. Doing so
would produce incorrect results because recursions groups only count as single
entries in the type system vector so we dynamically grow the TypeBuilder when we
encounter them. That would change the mapping of later indices to types, and
would change the meaning of previous type definitions that use those later
indices. This is not a problem in the isorecursive system because in that system
type definitions are not allowed to use later indices.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/isorecursive-good.wast | 3 | ||||
-rw-r--r-- | test/lit/isorecursive-output-ordering.wast | 1 | ||||
-rw-r--r-- | test/lit/isorecursive-singleton-group.wast | 1 | ||||
-rw-r--r-- | test/lit/isorecursive-whole-group.wast | 1 |
4 files changed, 4 insertions, 2 deletions
diff --git a/test/lit/isorecursive-good.wast b/test/lit/isorecursive-good.wast index 353905c4f..7ced0d8d3 100644 --- a/test/lit/isorecursive-good.wast +++ b/test/lit/isorecursive-good.wast @@ -1,10 +1,9 @@ ;; TODO: Autogenerate these checks! The current script cannot handle `rec`. ;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s --check-prefix HYBRID +;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s --check-prefix HYBRID ;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s --check-prefix NOMINAL -;; TDOO: test with --roundtrip as well - (module ;; HYBRID: (rec diff --git a/test/lit/isorecursive-output-ordering.wast b/test/lit/isorecursive-output-ordering.wast index 6aaa7ba39..ae965123f 100644 --- a/test/lit/isorecursive-output-ordering.wast +++ b/test/lit/isorecursive-output-ordering.wast @@ -1,6 +1,7 @@ ;; TODO: Autogenerate these checks! The current script cannot handle `rec`. ;; RUN: foreach %s %t wasm-opt -all --hybrid -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt -all --hybrid --roundtrip -S -o - | filecheck %s (module ;; Test that we order groups by average uses. diff --git a/test/lit/isorecursive-singleton-group.wast b/test/lit/isorecursive-singleton-group.wast index adb40b141..eeb92ac09 100644 --- a/test/lit/isorecursive-singleton-group.wast +++ b/test/lit/isorecursive-singleton-group.wast @@ -1,6 +1,7 @@ ;; TODO: Autogenerate these checks! The current script cannot handle `rec`. ;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s ;; Check that everything works correctly when a recursion group has only a ;; single member. The rec group is implicit, so does not need to be printed. diff --git a/test/lit/isorecursive-whole-group.wast b/test/lit/isorecursive-whole-group.wast index 625025b23..4d349a3cb 100644 --- a/test/lit/isorecursive-whole-group.wast +++ b/test/lit/isorecursive-whole-group.wast @@ -1,6 +1,7 @@ ;; TODO: Autogenerate these checks! The current script cannot handle `rec`. ;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s ;; Check that unused types are still included in the output when they are part ;; of a recursion group with used types. |