diff options
38 files changed, 44 insertions, 373 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 878ae9dd3..f2d76ec92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Current Trunk - Some C and JS API functions now refer to data and element segments by name instead of index. +- The --nominal and --hybrid command line options have been removed. The only + supported type system is now the standard isorecursive (i.e. hybrid) type + system. v112 ---- diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 4c39671d4..25d06c148 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -43,8 +43,6 @@ assert sys.version_info.major == 3, 'requires Python 3!' # parameters -TYPE_SYSTEM_FLAG = '--hybrid' - # feature options that are always passed to the tools. CONSTANT_FEATURE_OPTS = ['--all-features'] @@ -129,9 +127,6 @@ def randomize_feature_opts(): if possible in IMPLIED_FEATURE_OPTS: FEATURE_OPTS.extend(IMPLIED_FEATURE_OPTS[possible]) print('randomized feature opts:', '\n ' + '\n '.join(FEATURE_OPTS)) - # Type system flags only make sense when GC is enabled - if '--disable-gc' not in FEATURE_OPTS: - FEATURE_OPTS.append(TYPE_SYSTEM_FLAG) # Pick closed or open with equal probability as both matter. # diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 6ce299822..062e66260 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -2260,14 +2260,12 @@ Expression* TranslateToFuzzReader::makeBasicRef(Type type) { assert(wasm.features.hasGC()); // TODO: Construct nontrivial types. For now just create a hard coded // struct. - // Use a local static to avoid creating a fresh nominal types in - // --nominal mode. + // Use a local static to avoid the expense of canonicalizing a new type + // every time. static HeapType trivialStruct = HeapType(Struct()); return builder.makeStructNew(trivialStruct, std::vector<Expression*>{}); } case HeapType::array: { - // Use a local static to avoid creating a fresh nominal types in - // --nominal mode. static HeapType trivialArray = HeapType(Array(Field(Field::PackedType::i8, Immutable))); return builder.makeArrayNewFixed(trivialArray, {}); diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 02b825079..4e9d85d00 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -140,23 +140,6 @@ struct ToolOptions : public Options { } passOptions.arguments[key] = value; }) - .add("--nominal", - "", - "Force all GC type definitions to be parsed as nominal.", - ToolOptionsCategory, - Options::Arguments::Zero, - [](Options* o, const std::string& argument) { - setTypeSystem(TypeSystem::Nominal); - }) - .add("--hybrid", - "", - "Force all GC type definitions to be parsed using the isorecursive " - "hybrid type system.", - ToolOptionsCategory, - Options::Arguments::Zero, - [](Options* o, const std::string& argument) { - setTypeSystem(TypeSystem::Isorecursive); - }) .add( "--closed-world", "-cw", diff --git a/src/tools/wasm-fuzz-types.cpp b/src/tools/wasm-fuzz-types.cpp index 44572c85d..ce393d133 100644 --- a/src/tools/wasm-fuzz-types.cpp +++ b/src/tools/wasm-fuzz-types.cpp @@ -559,27 +559,8 @@ int main(int argc, const char* argv[]) { Options::Arguments::Zero, [&](Options*, const std::string& arg) { verbose = true; }); - TypeSystem system = TypeSystem::Isorecursive; - options.add( - "--nominal", - "", - "Use the nominal type system", - WasmFuzzTypesOption, - Options::Arguments::Zero, - [&](Options*, const std::string& arg) { system = TypeSystem::Nominal; }); - options.add("--hybrid", - "", - "Use the isorecursive hybrid type system (default)", - WasmFuzzTypesOption, - Options::Arguments::Zero, - [&](Options*, const std::string& arg) { - system = TypeSystem::Isorecursive; - }); - options.parse(argc, argv); - setTypeSystem(system); - Fuzzer fuzzer{verbose}; if (seed) { // Run just a single workload with the given seed. diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 895b7d8bc..40d9aba6a 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -1296,13 +1296,6 @@ int main(int argc, const char* argv[]) { if (debugInfo) { extraFlags += " -g "; } - if (getTypeSystem() == TypeSystem::Nominal) { - extraFlags += " --nominal"; - } else if (getTypeSystem() == TypeSystem::Isorecursive) { - extraFlags += " --hybrid"; - } else { - WASM_UNREACHABLE("unexpected type system"); - } if (test.size() == 0) { Fatal() << "test file not provided\n"; diff --git a/test/lit/binary/prototype-nominal-format.test b/test/lit/binary/prototype-nominal-format.test deleted file mode 100644 index 1f9d27951..000000000 --- a/test/lit/binary/prototype-nominal-format.test +++ /dev/null @@ -1,27 +0,0 @@ -;; Test the we can properly parse the prototype nominal binary format that we no -;; longer emit. - -;; RUN: wasm-dis %s.wasm -all --nominal | 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 (type $none_=>_ref|$super-struct|) (result (ref $super-struct)) -;; CHECK-NEXT: (call $make-sub-struct) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (func $make-sub-struct (type $none_=>_ref|$sub-struct|) (result (ref $sub-struct)) -;; CHECK-NEXT: (unreachable) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (func $make-super-array (type $none_=>_ref|$super-array|) (result (ref $super-array)) -;; CHECK-NEXT: (call $make-sub-array) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (func $make-sub-array (type $none_=>_ref|$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 Binary files differdeleted file mode 100644 index 97485ae4f..000000000 --- a/test/lit/binary/prototype-nominal-format.test.wasm +++ /dev/null diff --git a/test/lit/exec/no-compare-refs.wast b/test/lit/exec/no-compare-refs.wast index d456ab118..95afa51dc 100644 --- a/test/lit/exec/no-compare-refs.wast +++ b/test/lit/exec/no-compare-refs.wast @@ -1,6 +1,6 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited. -;; RUN: wasm-opt %s --hybrid -all --signature-pruning --closed-world --fuzz-exec -q -o /dev/null 2>&1 | filecheck %s +;; RUN: wasm-opt %s -all --signature-pruning --closed-world --fuzz-exec -q -o /dev/null 2>&1 | filecheck %s (module (type $f (func (param i32))) diff --git a/test/lit/fuzz-types/isorecursive.test b/test/lit/fuzz-types.test index 78adf1bbc..b10df152b 100644 --- a/test/lit/fuzz-types/isorecursive.test +++ b/test/lit/fuzz-types.test @@ -1,4 +1,4 @@ -;; RUN: wasm-fuzz-types --hybrid -v --seed=1 | filecheck %s +;; RUN: wasm-fuzz-types -v --seed=1 | filecheck %s ;; CHECK: (type $0 (struct)) ;; CHECK-NEXT: (rec diff --git a/test/lit/fuzz-types/nominal.test b/test/lit/fuzz-types/nominal.test deleted file mode 100644 index 062900b62..000000000 --- a/test/lit/fuzz-types/nominal.test +++ /dev/null @@ -1,46 +0,0 @@ -;; RUN: wasm-fuzz-types --nominal -v --seed=0 | filecheck %s - -;; CHECK: (type $0 (struct (field (mut i16) i31ref f32 f32 f64))) -;; CHECK-NEXT: (type $1 (func (param f64 v128))) -;; CHECK-NEXT: (type $2 (struct (field (mut (ref null $19)) f64 arrayref))) -;; CHECK-NEXT: (type $3 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64) $0)) -;; CHECK-NEXT: (type $4 (struct)) -;; CHECK-NEXT: (type $5 none) -;; CHECK-NEXT: (type $6 (array (mut eqref))) -;; CHECK-NEXT: (type $7 (func_subtype (param f64 v128) $1)) -;; CHECK-NEXT: (type $8 (array anyref)) -;; CHECK-NEXT: (type $9 (array f32)) -;; CHECK-NEXT: (type $10 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64) $0)) -;; CHECK-NEXT: (type $11 (func (result f64))) -;; CHECK-NEXT: (type $12 (func_subtype (param f64 v128) $1)) -;; CHECK-NEXT: (type $13 (func_subtype (param f64 v128) $12)) -;; CHECK-NEXT: (type $14 (func_subtype (result f64) $11)) -;; CHECK-NEXT: (type $15 (func_subtype (result f64) $14)) -;; CHECK-NEXT: (type $16 (func (param (ref struct)) (result structref))) -;; CHECK-NEXT: (type $17 (array (mut (ref $2)))) -;; CHECK-NEXT: (type $18 (array (ref $10))) -;; CHECK-NEXT: (type $19 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64 (mut f32)) $0)) -;; CHECK-NEXT: -;; CHECK-NEXT: Inhabitable types: -;; CHECK-NEXT: -;; CHECK-NEXT: Built 20 types: -;; CHECK-NEXT: (type $0 (struct (field (mut i16) i31ref f32 f32 f64))) -;; CHECK-NEXT: (type $1 (func (param f64 v128))) -;; CHECK-NEXT: (type $2 (struct (field (mut (ref null $19)) f64 arrayref))) -;; CHECK-NEXT: (type $3 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64) $0)) -;; CHECK-NEXT: (type $4 (struct)) -;; CHECK-NEXT: (type $5 none) -;; CHECK-NEXT: (type $6 (array (mut eqref))) -;; CHECK-NEXT: (type $7 (func_subtype (param f64 v128) $1)) -;; CHECK-NEXT: (type $8 (array anyref)) -;; CHECK-NEXT: (type $9 (array f32)) -;; CHECK-NEXT: (type $10 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64) $0)) -;; CHECK-NEXT: (type $11 (func (result f64))) -;; CHECK-NEXT: (type $12 (func_subtype (param f64 v128) $1)) -;; CHECK-NEXT: (type $13 (func_subtype (param f64 v128) $12)) -;; CHECK-NEXT: (type $14 (func_subtype (result f64) $11)) -;; CHECK-NEXT: (type $15 (func_subtype (result f64) $14)) -;; CHECK-NEXT: (type $16 (func (param (ref struct)) (result structref))) -;; CHECK-NEXT: (type $17 (array (mut (ref $2)))) -;; CHECK-NEXT: (type $18 (array (ref $10))) -;; CHECK-NEXT: (type $19 (struct_subtype (field (mut i16) (ref i31) f32 f32 f64 (mut f32)) $0)) diff --git a/test/lit/help/wasm-as.test b/test/lit/help/wasm-as.test index 976c66225..97f11a7d6 100644 --- a/test/lit/help/wasm-as.test +++ b/test/lit/help/wasm-as.test @@ -119,13 +119,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-ctor-eval.test b/test/lit/help/wasm-ctor-eval.test index 34281ea42..2d27f619a 100644 --- a/test/lit/help/wasm-ctor-eval.test +++ b/test/lit/help/wasm-ctor-eval.test @@ -126,13 +126,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-dis.test b/test/lit/help/wasm-dis.test index ce2328452..0d5cd8dc2 100644 --- a/test/lit/help/wasm-dis.test +++ b/test/lit/help/wasm-dis.test @@ -112,13 +112,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-emscripten-finalize.test b/test/lit/help/wasm-emscripten-finalize.test index 5bcf2c469..8ce4d94f0 100644 --- a/test/lit/help/wasm-emscripten-finalize.test +++ b/test/lit/help/wasm-emscripten-finalize.test @@ -159,13 +159,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-fuzz-types.test b/test/lit/help/wasm-fuzz-types.test index 49e491358..5bd5974fd 100644 --- a/test/lit/help/wasm-fuzz-types.test +++ b/test/lit/help/wasm-fuzz-types.test @@ -13,10 +13,6 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --verbose,-v Print extra information ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Use the nominal type system -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Use the isorecursive hybrid type system (default) -;; CHECK-NEXT: ;; CHECK-NEXT: ;; CHECK-NEXT: General options: ;; CHECK-NEXT: ---------------- diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test index 59cbcc216..5a2f22c01 100644 --- a/test/lit/help/wasm-metadce.test +++ b/test/lit/help/wasm-metadce.test @@ -160,13 +160,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index 351f2c93e..ae1768f9f 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -676,13 +676,6 @@ ;; CHECK-NEXT: optimization passes being run. ;; CHECK-NEXT: Must be in the form KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to -;; CHECK-NEXT: be parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to -;; CHECK-NEXT: be parsed using the isorecursive -;; CHECK-NEXT: hybrid type system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the ;; CHECK-NEXT: module does not inspect or ;; CHECK-NEXT: interact with GC and function diff --git a/test/lit/help/wasm-reduce.test b/test/lit/help/wasm-reduce.test index 333cae9ae..5fb79bf88 100644 --- a/test/lit/help/wasm-reduce.test +++ b/test/lit/help/wasm-reduce.test @@ -148,13 +148,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm-split.test b/test/lit/help/wasm-split.test index e0cdf3ca4..8b017d43d 100644 --- a/test/lit/help/wasm-split.test +++ b/test/lit/help/wasm-split.test @@ -228,13 +228,6 @@ ;; CHECK-NEXT: passes being run. Must be in the form ;; CHECK-NEXT: KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to be -;; CHECK-NEXT: parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to be -;; CHECK-NEXT: parsed using the isorecursive hybrid type -;; CHECK-NEXT: system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the module does ;; CHECK-NEXT: not inspect or interact with GC and ;; CHECK-NEXT: function references, even if they are diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 502419cf2..f75d37965 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -635,13 +635,6 @@ ;; CHECK-NEXT: optimization passes being run. ;; CHECK-NEXT: Must be in the form KEY@VALUE ;; CHECK-NEXT: -;; CHECK-NEXT: --nominal Force all GC type definitions to -;; CHECK-NEXT: be parsed as nominal. -;; CHECK-NEXT: -;; CHECK-NEXT: --hybrid Force all GC type definitions to -;; CHECK-NEXT: be parsed using the isorecursive -;; CHECK-NEXT: hybrid type system. -;; CHECK-NEXT: ;; CHECK-NEXT: --closed-world,-cw Assume code outside of the ;; CHECK-NEXT: module does not inspect or ;; CHECK-NEXT: interact with GC and function diff --git a/test/lit/isorecursive-good.wast b/test/lit/isorecursive-good.wast index eea7ec546..04880101f 100644 --- a/test/lit/isorecursive-good.wast +++ b/test/lit/isorecursive-good.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; 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 -S -o - | filecheck %s --check-prefix HYBRID +;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s --check-prefix HYBRID (module (rec diff --git a/test/lit/isorecursive-output-ordering.wast b/test/lit/isorecursive-output-ordering.wast index a287158f2..ca906c76b 100644 --- a/test/lit/isorecursive-output-ordering.wast +++ b/test/lit/isorecursive-output-ordering.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; 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 +;; RUN: foreach %s %t wasm-opt -all -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt -all --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 f5f91c516..0f73477b9 100644 --- a/test/lit/isorecursive-singleton-group.wast +++ b/test/lit/isorecursive-singleton-group.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s -;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s +;; RUN: wasm-opt %s -all -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --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 c202814c3..14ce524ff 100644 --- a/test/lit/isorecursive-whole-group.wast +++ b/test/lit/isorecursive-whole-group.wast @@ -1,14 +1,12 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s -;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s +;; RUN: wasm-opt %s -all -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --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. (module - - (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $used (struct )) diff --git a/test/lit/nominal-func.wast b/test/lit/nominal-func.wast deleted file mode 100644 index 600b16bf6..000000000 --- a/test/lit/nominal-func.wast +++ /dev/null @@ -1,26 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s -;; RUN: wasm-opt %s -all --nominal --roundtrip -S -o - | filecheck %s - -(module - ;; This will be the "canonical" function type rather than $foo_t - (type $bad_t (func)) - - ;; CHECK: (type $foo_t (func)) - (type $foo_t (func)) - - ;; CHECK: (func $foo (type $foo_t) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - (func $foo (type $foo_t) - (unreachable) - ) - - ;; $foo needs to be assigned type foo_t rather than bad_t for this to validate. - ;; CHECK: (func $make-ref (type $none_=>_ref|$foo_t|) (result (ref $foo_t)) - ;; CHECK-NEXT: (ref.func $foo) - ;; CHECK-NEXT: ) - (func $make-ref (result (ref $foo_t)) - (ref.func $foo) - ) -) diff --git a/test/lit/nominal-named-field.wast b/test/lit/nominal-named-field.wast deleted file mode 100644 index e7a5f9628..000000000 --- a/test/lit/nominal-named-field.wast +++ /dev/null @@ -1,30 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. - -;; Regression test for a bug in which field names were not printed in nominal mode. - -;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s -;; RUN: wasm-opt %s -all --nominal --roundtrip -S -o - | filecheck %s - -(module - ;; CHECK: (type $struct (struct (field (mut i32)) (field f32) (field $named f64))) - (type $struct (struct - (field (mut i32)) - (field f32) - (field $named f64) - )) - - ;; CHECK: (func $foo (type $ref|$struct|_=>_none) (param $0 (ref $struct)) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (struct.get $struct $named - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - (func $foo (param (ref $struct)) - (drop - (struct.get $struct $named - (local.get 0) - ) - ) - ) -) diff --git a/test/lit/nominal-no-gc.wast b/test/lit/nominal-no-gc.wast deleted file mode 100644 index 82f2698d9..000000000 --- a/test/lit/nominal-no-gc.wast +++ /dev/null @@ -1,5 +0,0 @@ -;; Using --nominal without GC is not allowed. - -;; RUN: not wasm-opt %s --nominal --disable-gc -g -o %t.wasm 2>&1 | filecheck %s - -;; CHECK: Nominal typing is only allowed when GC is enabled diff --git a/test/lit/nominal-to-isorecursive.wast b/test/lit/nominal-to-isorecursive.wast deleted file mode 100644 index 783191eb5..000000000 --- a/test/lit/nominal-to-isorecursive.wast +++ /dev/null @@ -1,35 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. - -;; RUN: wasm-as %s -all --nominal -g -o %t.wasm -;; RUN: wasm-dis %t.wasm -all --hybrid -o - | filecheck %s - -;; Check that the nominal binary format is parseable as isorecursive with a -;; single recursion group. - -(module - ;; CHECK: (rec - ;; CHECK-NEXT: (type $make-super-t (func (result (ref $super)))) - - ;; CHECK: (type $make-sub-t (func (result (ref $sub)))) - - ;; CHECK: (type $super (struct (field i32))) - (type $super (struct i32)) - ;; CHECK: (type $sub (struct_subtype (field i32) $super)) - (type $sub (struct_subtype i32 $super)) - (type $make-super-t (func (result (ref $super)))) - (type $make-sub-t (func (result (ref $sub)))) - - ;; CHECK: (func $make-super (type $make-super-t) (result (ref $super)) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - (func $make-super (type $make-super-t) - (unreachable) - ) - - ;; CHECK: (func $make-sub (type $make-sub-t) (result (ref $sub)) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - (func $make-sub (type $make-sub-t) - (unreachable) - ) -) diff --git a/test/lit/parse-nominal-types-no-sig-sharing.wast b/test/lit/parse-nominal-types-no-sig-sharing.wast deleted file mode 100644 index f3ebecc27..000000000 --- a/test/lit/parse-nominal-types-no-sig-sharing.wast +++ /dev/null @@ -1,41 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. - -;; RUN: foreach %s %t wasm-opt --nominal -all -S -o - | filecheck %s -;; RUN: foreach %s %t wasm-opt --nominal -all --roundtrip -S -o - | filecheck %s -;; RUN: foreach %s %t wasm-opt --nominal -all --closed-world -S -o - | filecheck %s - -;; Test that we do not use the signature cache to share a function type that -;; has a supertype. $sub appears first, so it is the earliest example of a -;; signature of no params and no results, but we should not use it as the types -;; of $foo or $bar, as it has a supertype. Instead, we should use $super as the -;; canonical type for that signature. That is fine as at least it only makes -;; $super effectively a public type, instead of both $sub and $super (the latter -;; does not validate in closed world, but the former does - the closed-world -;; run that we do here would error). -;; -;; Note that this problem only happens in nominal mode, since $sub can appear -;; before $super in the list of types. - -(module - (type $sub (func_subtype $super)) - - ;; CHECK: (type $super (func)) - (type $super (func_subtype func)) - - ;; CHECK: (global $g (ref null $super) (ref.null nofunc)) - (global $g (ref null $super) (ref.null $sub)) - - ;; CHECK: (export "foo" (func $foo)) - - ;; CHECK: (func $foo (type $super) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: ) - (func $foo (export "foo") - ) - - ;; CHECK: (func $bar (type $super) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: ) - (func $bar - ) -) diff --git a/test/lit/passes/signature-refining-isorecursive.wast b/test/lit/passes/signature-refining-isorecursive.wast index b51b0cf8a..1eab7b6af 100644 --- a/test/lit/passes/signature-refining-isorecursive.wast +++ b/test/lit/passes/signature-refining-isorecursive.wast @@ -1,5 +1,5 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; RUN: foreach %s %t wasm-opt --hybrid --signature-refining -all -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --signature-refining -all -S -o - | filecheck %s (module ;; The signature should be refined to a single self-referential type. diff --git a/test/lit/passes/type-merging.wast b/test/lit/passes/type-merging.wast index 4fd8ff75c..98ae92055 100644 --- a/test/lit/passes/type-merging.wast +++ b/test/lit/passes/type-merging.wast @@ -1,5 +1,5 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; RUN: foreach %s %t wasm-opt --hybrid --closed-world --type-merging --remove-unused-types -all -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --closed-world --type-merging --remove-unused-types -all -S -o - | filecheck %s (module (rec diff --git a/test/lit/passes/type-refining-isorecursive.wast b/test/lit/passes/type-refining-isorecursive.wast index 245801843..cf5de7979 100644 --- a/test/lit/passes/type-refining-isorecursive.wast +++ b/test/lit/passes/type-refining-isorecursive.wast @@ -1,5 +1,5 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; RUN: foreach %s %t wasm-opt --hybrid --type-refining --closed-world -all -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --type-refining --closed-world -all -S -o - | filecheck %s (module ;; The types should be refined to a set of three mutually recursive types. diff --git a/test/lit/subtypes.wast b/test/lit/subtypes.wast index 75618ab0a..00ed88453 100644 --- a/test/lit/subtypes.wast +++ b/test/lit/subtypes.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s -;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s +;; RUN: wasm-opt %s -all -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s (module (rec diff --git a/test/lit/validation/rec-groups-no-gc.wast b/test/lit/validation/rec-groups-no-gc.wast index f9710d440..20a368a7a 100644 --- a/test/lit/validation/rec-groups-no-gc.wast +++ b/test/lit/validation/rec-groups-no-gc.wast @@ -1,6 +1,6 @@ ;; Test that using rec groups types without GC is a validation error. -;; RUN: not wasm-opt %s --hybrid -all --disable-gc 2>&1 | filecheck %s +;; RUN: not wasm-opt %s -all --disable-gc 2>&1 | filecheck %s ;; CHECK: all used types should be allowed diff --git a/test/lit/validation/supertypes-no-gc.wast b/test/lit/validation/supertypes-no-gc.wast index 8b70b5174..eeacccfaf 100644 --- a/test/lit/validation/supertypes-no-gc.wast +++ b/test/lit/validation/supertypes-no-gc.wast @@ -1,6 +1,6 @@ ;; Test that declaring supertypes without GC is a validation error. -;; RUN: not wasm-opt %s --hybrid -all --disable-gc 2>&1 | filecheck %s +;; RUN: not wasm-opt %s -all --disable-gc 2>&1 | filecheck %s ;; CHECK: all used types should be allowed diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 65d465774..e40a31f98 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -1,6 +1,6 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; RUN: wasm-opt --new-wat-parser --hybrid -all %s -S -o - | filecheck %s +;; RUN: wasm-opt --new-wat-parser -all %s -S -o - | filecheck %s (module $parse ;; types diff --git a/test/unit/test_passes.py b/test/unit/test_passes.py index 25f844757..5f91afa92 100644 --- a/test/unit/test_passes.py +++ b/test/unit/test_passes.py @@ -21,32 +21,29 @@ class PassesTest(utils.BinaryenTestCase): def test_O2(self): args = ['-O2', '-all'] - for nominal in ['--nominal', False]: - for closed_world in ['--closed-world', False]: - curr_args = args[:] - if nominal: - curr_args.append(nominal) - if closed_world: - curr_args.append(closed_world) - passes = self.get_passes_run(curr_args) + for closed_world in ['--closed-world', False]: + curr_args = args[:] + if closed_world: + curr_args.append(closed_world) + passes = self.get_passes_run(curr_args) - # dce always runs - self.assertIn('dce', passes) + # dce always runs + self.assertIn('dce', passes) - # some passes only run in closed world - CLOSED_WORLD_PASSES = [ - 'type-refining', - 'signature-pruning', - 'signature-refining', - 'gto', - 'cfp', - 'gsi', - ] - for pass_ in CLOSED_WORLD_PASSES: - if closed_world: - self.assertIn(pass_, passes) - else: - self.assertNotIn(pass_, passes) + # some passes only run in closed world + CLOSED_WORLD_PASSES = [ + 'type-refining', + 'signature-pruning', + 'signature-refining', + 'gto', + 'cfp', + 'gsi', + ] + for pass_ in CLOSED_WORLD_PASSES: + if closed_world: + self.assertIn(pass_, passes) + else: + self.assertNotIn(pass_, passes) def test_O3_O1(self): # When we run something like -O3 -O1 we should run -O3 followed by -O1 |