-
Notifications
You must be signed in to change notification settings - Fork 793
Description
We recently allowed printing expression contents with respect to features in the Print pass (#3537) and we needed that as part of enabling multi-table modules in the Binaryen IR (#3517). But after I updated the tests, I noticed there's a difference between .from-wast
and .fromBinary
test files, in that .from-wast
files were generated correctly with the correct features, but .fromBinary
files were always generated with all features disabled.
Now, for .fromBinary
tests we use wasm-as
to compile a .wasm binary, and then use wasm-dis
to check the text output. But since wasm-dis
does not have the feature options, the only way it can print with features is if the module has a features section, wasm-as
does not have an option to emit.
Two solutions are possible in my view:
- Add feature options to
wasm-dis
, so we have the flexibility to print with the desired features. - Allow tools like
wasm-as
andwasm-split
to emit a features section, so the features are read and applied while parsing the binary inwasm-dis
.