diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 7f04231a2c9..0f007d6630a 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -487,6 +487,9 @@ BinaryenFeatures BinaryenFeatureBulkMemoryOpt(void) { BinaryenFeatures BinaryenFeatureCallIndirectOverlong(void) { return static_cast(FeatureSet::CallIndirectOverlong); } +BinaryenFeatures BinaryenFeatureRelaxedAtomics(void) { + return static_cast(FeatureSet::RelaxedAtomics); +} BinaryenFeatures BinaryenFeatureAll(void) { return static_cast(FeatureSet::All); } diff --git a/src/binaryen-c.h b/src/binaryen-c.h index f76741bfec7..ba0b6009424 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -230,6 +230,7 @@ BINARYEN_API BinaryenFeatures BinaryenFeatureSharedEverything(void); BINARYEN_API BinaryenFeatures BinaryenFeatureFP16(void); BINARYEN_API BinaryenFeatures BinaryenFeatureBulkMemoryOpt(void); BINARYEN_API BinaryenFeatures BinaryenFeatureCallIndirectOverlong(void); +BINARYEN_API BinaryenFeatures BinaryenFeatureRelaxedAtomics(void); BINARYEN_API BinaryenFeatures BinaryenFeatureAll(void); // Modules diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 82a6695c926..0adc6a1430e 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -181,6 +181,7 @@ function initializeConstants() { 'FP16', 'BulkMemoryOpt', 'CallIndirectOverlong', + 'RelaxedAtomics', 'All' ].forEach(name => { Module['Features'][name] = Module['_BinaryenFeature' + name](); diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h index 3c42b6b1f13..298fb5db349 100644 --- a/src/tools/tool-options.h +++ b/src/tools/tool-options.h @@ -108,6 +108,8 @@ struct ToolOptions : public Options { .addFeature(FeatureSet::FP16, "float 16 operations") .addFeature(FeatureSet::CustomDescriptors, "custom descriptors (RTTs) and exact references") + .addFeature(FeatureSet::RelaxedAtomics, + "acquire/release atomic memory operations") .add("--enable-typed-function-references", "", "Deprecated compatibility flag", diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 78a0a6e2434..5a1f618da3d 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -460,6 +460,7 @@ extern const char* FP16Feature; extern const char* BulkMemoryOptFeature; extern const char* CallIndirectOverlongFeature; extern const char* CustomDescriptorsFeature; +extern const char* RelaxedAtomicsFeature; enum Subsection { NameModule = 0, diff --git a/src/wasm-features.h b/src/wasm-features.h index a7c3ce0c4f5..7f4b0a451af 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -55,11 +55,12 @@ struct FeatureSet { // it does nothing. Binaryen always accepts LEB call-indirect encodings. CallIndirectOverlong = 1 << 20, CustomDescriptors = 1 << 21, + RelaxedAtomics = 1 << 22, MVP = None, // Keep in sync with llvm default features: // https://github.com/llvm/llvm-project/blob/c7576cb89d6c95f03968076e902d3adfd1996577/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L153 Default = SignExt | MutableGlobals, - All = (1 << 22) - 1, + All = (1 << 23) - 1, }; static std::string toString(Feature f) { @@ -108,6 +109,8 @@ struct FeatureSet { return "call-indirect-overlong"; case CustomDescriptors: return "custom-descriptors"; + case RelaxedAtomics: + return "relaxed-atomics"; case MVP: case Default: case All: @@ -168,6 +171,7 @@ struct FeatureSet { bool hasCustomDescriptors() const { return (features & CustomDescriptors) != 0; } + bool hasRelaxedAtomics() const { return (features & RelaxedAtomics) != 0; } bool hasAll() const { return (features & All) != 0; } void set(FeatureSet f, bool v = true) { @@ -194,6 +198,7 @@ struct FeatureSet { void setFP16(bool v = true) { set(FP16, v); } void setBulkMemoryOpt(bool v = true) { set(BulkMemoryOpt, v); } void setCustomDescriptors(bool v = true) { set(CustomDescriptors, v); } + void setRelaxedAtomics(bool v = true) { set(RelaxedAtomics, v); } void setMVP() { features = MVP; } void setAll() { features = All; } diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index d24f7da423f..9a5d03c65f0 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1441,6 +1441,8 @@ void WasmBinaryWriter::writeFeaturesSection() { return BinaryConsts::CustomSections::CallIndirectOverlongFeature; case FeatureSet::CustomDescriptors: return BinaryConsts::CustomSections::CustomDescriptorsFeature; + case FeatureSet::RelaxedAtomics: + return BinaryConsts::CustomSections::RelaxedAtomicsFeature; case FeatureSet::None: case FeatureSet::Default: case FeatureSet::All: @@ -5296,6 +5298,8 @@ void WasmBinaryReader::readFeatures(size_t sectionPos, size_t payloadLen) { feature = FeatureSet::FP16; } else if (name == BinaryConsts::CustomSections::CustomDescriptorsFeature) { feature = FeatureSet::CustomDescriptors; + } else if (name == BinaryConsts::CustomSections::RelaxedAtomicsFeature) { + feature = FeatureSet::RelaxedAtomics; } else { // Silently ignore unknown features (this may be and old binaryen running // on a new wasm). diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 2d177d1a518..27884708ba1 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1108,6 +1108,12 @@ void FunctionValidator::visitLoad(Load* curr) { curr, "Atomic load should be i32 or i64"); } + if (curr->order == MemoryOrder::AcqRel) { + shouldBeTrue(getModule()->features.hasRelaxedAtomics(), + curr, + "Acquire/release operations require relaxed atomics " + "[--enable-relaxed-atomics]"); + } if (curr->type == Type::v128) { shouldBeTrue(getModule()->features.hasSIMD(), curr, diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 111f4c9d21d..4d4673a7e6a 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -61,6 +61,7 @@ const char* FP16Feature = "fp16"; const char* BulkMemoryOptFeature = "bulk-memory-opt"; const char* CallIndirectOverlongFeature = "call-indirect-overlong"; const char* CustomDescriptorsFeature = "custom-descriptors"; +const char* RelaxedAtomicsFeature = "relaxed-atomics"; } // namespace BinaryConsts::CustomSections diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index e2764e19abf..cb0f6197edf 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -100,6 +100,7 @@ function test_features() { console.log("Features.ExtendedConst: " + binaryen.Features.ExtendedConst); console.log("Features.Strings: " + binaryen.Features.Strings); console.log("Features.MultiMemory: " + binaryen.Features.MultiMemory); + console.log("Features.RelaxedAtomics: " + binaryen.Features.RelaxedAtomics); console.log("Features.All: " + binaryen.Features.All); } diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index d28f6381f48..bce7e24e79e 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -33,7 +33,8 @@ Features.RelaxedSIMD: 4096 Features.ExtendedConst: 8192 Features.Strings: 16384 Features.MultiMemory: 32768 -Features.All: 4194303 +Features.RelaxedAtomics: 4194304 +Features.All: 8388607 InvalidId: 0 BlockId: 1 IfId: 2 diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 3027d4e65e5..9a23c82cb5d 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -374,6 +374,8 @@ void test_features() { printf("BinaryenFeatureRelaxedSIMD: %d\n", BinaryenFeatureRelaxedSIMD()); printf("BinaryenFeatureExtendedConst: %d\n", BinaryenFeatureExtendedConst()); printf("BinaryenFeatureStrings: %d\n", BinaryenFeatureStrings()); + printf("BinaryenFeatureRelaxedAtomics: %d\n", + BinaryenFeatureRelaxedAtomics()); printf("BinaryenFeatureAll: %d\n", BinaryenFeatureAll()); } diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index b06e064169f..0b4c7d1d887 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -47,7 +47,8 @@ BinaryenFeatureMemory64: 2048 BinaryenFeatureRelaxedSIMD: 4096 BinaryenFeatureExtendedConst: 8192 BinaryenFeatureStrings: 16384 -BinaryenFeatureAll: 4194303 +BinaryenFeatureRelaxedAtomics: 4194304 +BinaryenFeatureAll: 8388607 (f32.neg (f32.const -33.61199951171875) ) diff --git a/test/lit/help/wasm-as.test b/test/lit/help/wasm-as.test index 77ae850e4df..d9f1c51544b 100644 --- a/test/lit/help/wasm-as.test +++ b/test/lit/help/wasm-as.test @@ -134,6 +134,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-ctor-eval.test b/test/lit/help/wasm-ctor-eval.test index 9a5fbdcda26..3ecda78f368 100644 --- a/test/lit/help/wasm-ctor-eval.test +++ b/test/lit/help/wasm-ctor-eval.test @@ -141,6 +141,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-dis.test b/test/lit/help/wasm-dis.test index a10b41a4f3c..4105874814a 100644 --- a/test/lit/help/wasm-dis.test +++ b/test/lit/help/wasm-dis.test @@ -127,6 +127,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-emscripten-finalize.test b/test/lit/help/wasm-emscripten-finalize.test index 4cb9ef940a0..0c94205267c 100644 --- a/test/lit/help/wasm-emscripten-finalize.test +++ b/test/lit/help/wasm-emscripten-finalize.test @@ -169,6 +169,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-merge.test b/test/lit/help/wasm-merge.test index a8b95194950..f6837860017 100644 --- a/test/lit/help/wasm-merge.test +++ b/test/lit/help/wasm-merge.test @@ -157,6 +157,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test index 32faa584eba..d205670d046 100644 --- a/test/lit/help/wasm-metadce.test +++ b/test/lit/help/wasm-metadce.test @@ -789,6 +789,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors ;; CHECK-NEXT: (RTTs) and exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index e84623f6cca..1958a3d9102 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -821,6 +821,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors ;; CHECK-NEXT: (RTTs) and exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-reduce.test b/test/lit/help/wasm-reduce.test index 2739394e3ed..12d258bed49 100644 --- a/test/lit/help/wasm-reduce.test +++ b/test/lit/help/wasm-reduce.test @@ -217,6 +217,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-split.test b/test/lit/help/wasm-split.test index 2991c6158b3..102add9dfd7 100644 --- a/test/lit/help/wasm-split.test +++ b/test/lit/help/wasm-split.test @@ -275,6 +275,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors (RTTs) and ;; CHECK-NEXT: exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic memory +;; CHECK-NEXT: operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index d1478383caa..21a069d595d 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -753,6 +753,12 @@ ;; CHECK-NEXT: --disable-custom-descriptors Disable custom descriptors ;; CHECK-NEXT: (RTTs) and exact references ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-relaxed-atomics Enable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-relaxed-atomics Disable acquire/release atomic +;; CHECK-NEXT: memory operations +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/passes/safe-heap_enable-threads_enable-simd64.wast b/test/lit/passes/safe-heap_enable-threads_enable-simd64_enable-relaxed-atomics.wast similarity index 99% rename from test/lit/passes/safe-heap_enable-threads_enable-simd64.wast rename to test/lit/passes/safe-heap_enable-threads_enable-simd64_enable-relaxed-atomics.wast index f4179d56cf3..e045629a7b1 100644 --- a/test/lit/passes/safe-heap_enable-threads_enable-simd64.wast +++ b/test/lit/passes/safe-heap_enable-threads_enable-simd64_enable-relaxed-atomics.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. -;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd --enable-memory64 -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd --enable-memory64 --enable-relaxed-atomics -S -o - | filecheck %s (module (memory i64 100 100 shared) diff --git a/test/lit/passes/safe-heap_enable-threads_enable-simd.wast b/test/lit/passes/safe-heap_enable-threads_enable-simd_enable-relaxed-atomics.wast similarity index 99% rename from test/lit/passes/safe-heap_enable-threads_enable-simd.wast rename to test/lit/passes/safe-heap_enable-threads_enable-simd_enable-relaxed-atomics.wast index e5cf26c8cd1..e2f93adaad4 100644 --- a/test/lit/passes/safe-heap_enable-threads_enable-simd.wast +++ b/test/lit/passes/safe-heap_enable-threads_enable-simd_enable-relaxed-atomics.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. -;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --safe-heap --enable-threads --enable-simd --enable-relaxed-atomics -S -o - | filecheck %s (module (memory 100 100 shared) diff --git a/test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast b/test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd_enable-relaxed-atomics.wast similarity index 99% rename from test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast rename to test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd_enable-relaxed-atomics.wast index 7aa9bf29e0d..b51e1ac01d4 100644 --- a/test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast +++ b/test/lit/passes/safe-heap_low-memory-unused_enable-threads_enable-simd_enable-relaxed-atomics.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. -;; RUN: foreach %s %t wasm-opt --safe-heap --low-memory-unused --enable-threads --enable-simd -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --safe-heap --low-memory-unused --enable-threads --enable-simd --enable-relaxed-atomics -S -o - | filecheck %s (module (memory 100 100 shared) diff --git a/test/lit/validation/relaxed-atomics.wast b/test/lit/validation/relaxed-atomics.wast new file mode 100644 index 00000000000..71731153b1f --- /dev/null +++ b/test/lit/validation/relaxed-atomics.wast @@ -0,0 +1,20 @@ +;; Test the feature flag for --relaxed-atomics +;; The below tests set --enable-threads since it's required for shared memories. + +;; text +;; RUN: wasm-opt --enable-threads --enable-relaxed-atomics %s 2>&1 +;; RUN: not wasm-opt --enable-threads --disable-relaxed-atomics %s 2>&1 | filecheck %s + +;; binary +;; RUN: wasm-opt --enable-threads --enable-relaxed-atomics %s -o %t.wasm +;; RUN: not wasm-opt --enable-threads --disable-relaxed-atomics %t.wasm 2>&1 | filecheck %s + +(module + (memory 1 1 shared) + (func $acqrel (result i32) + ;; CHECK: Acquire/release operations require relaxed atomics [--enable-relaxed-atomics] + (i32.atomic.load acqrel + (i32.const 1) + ) + ) +) diff --git a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt index 34976434e9d..4d80eb6bb81 100644 --- a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt +++ b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt @@ -20,6 +20,7 @@ --enable-bulk-memory-opt --enable-call-indirect-overlong --enable-custom-descriptors +--enable-relaxed-atomics (module (type $0 (func (result v128 externref))) (func $foo (type $0) (result v128 externref) diff --git a/test/unit/test_features.py b/test/unit/test_features.py index f33328cb488..d44435811fc 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -5,6 +5,7 @@ from . import utils +# Consider adding new tests to test/lit/validation instead class FeatureValidationTest(utils.BinaryenTestCase): def check_feature(self, module, error, flag, const_flags=[]): p = shared.run_process(shared.WASM_OPT + @@ -454,4 +455,5 @@ def test_emit_all_features(self): '--enable-bulk-memory-opt', '--enable-call-indirect-overlong', '--enable-custom-descriptors', + '--enable-relaxed-atomics', ], p2.stdout.splitlines())