diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-18 15:40:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-18 15:40:30 -0700 |
commit | 5becae69e29c876f3ba46d6746764e409bd7fd9b (patch) | |
tree | f0fee2c10772faf9466b3f5ec0828e98184e516c /test/unit | |
parent | 9233afca9a27f8794fb0c8b79b5fa0d8e47060d4 (diff) | |
download | binaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.tar.gz binaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.tar.bz2 binaryen-5becae69e29c876f3ba46d6746764e409bd7fd9b.zip |
Reland emitting of DataCount section (#2027)
This reverts commit cb2d63586c08a3dd194d2b733ceb3f5051c081f8.
The issues with feature validation were mostly resolved in #1993, and
this PR finishes the job by adding feature flags to wasm-as to avoid
emitting the DataCount section when bulk-memory is not enabled.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_datacount.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/test_datacount.py b/test/unit/test_datacount.py new file mode 100644 index 000000000..5ec98c549 --- /dev/null +++ b/test/unit/test_datacount.py @@ -0,0 +1,15 @@ +from scripts.test.shared import WASM_OPT, run_process +from utils import BinaryenTestCase + + +class DataCountTest(BinaryenTestCase): + def test_datacount(self): + self.roundtrip('bulkmem_data.wasm') + + def test_bad_datacount(self): + path = self.input_path('bulkmem_bad_datacount.wasm') + p = run_process(WASM_OPT + ['-g', '-o', '-', path], check=False, + capture_output=True) + self.assertNotEqual(p.returncode, 0) + self.assertIn('Number of segments does not agree with DataCount section', + p.stderr) |