summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/Memory64Lowering.cpp8
-rw-r--r--test/lit/passes/memory64-lowering-features.wast9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/passes/Memory64Lowering.cpp b/src/passes/Memory64Lowering.cpp
index 661d6cdae..194d593d8 100644
--- a/src/passes/Memory64Lowering.cpp
+++ b/src/passes/Memory64Lowering.cpp
@@ -159,6 +159,14 @@ struct Memory64Lowering : public WalkerPass<PostWalker<Memory64Lowering>> {
}
}
}
+
+ void run(Module* module) override {
+ if (!module->features.has(FeatureSet::Memory64)) {
+ return;
+ }
+ super::run(module);
+ module->features.disable(FeatureSet::Memory64);
+ }
};
Pass* createMemory64LoweringPass() { return new Memory64Lowering(); }
diff --git a/test/lit/passes/memory64-lowering-features.wast b/test/lit/passes/memory64-lowering-features.wast
new file mode 100644
index 000000000..4c5c1c207
--- /dev/null
+++ b/test/lit/passes/memory64-lowering-features.wast
@@ -0,0 +1,9 @@
+;; RUN: wasm-opt %s --enable-memory64 --print-features --print --memory64-lowering --print-features | filecheck %s
+
+;; Check that the --memory64-lowering pass disables the signext feature.
+
+;; CHECK: --enable-memory64
+;; CHECK: (module
+;; CHECK-NOT: --enable-memory64
+
+(module)