From 5becae69e29c876f3ba46d6746764e409bd7fd9b Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 18 Apr 2019 15:40:30 -0700 Subject: 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. --- test/unit/test_datacount.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/unit/test_datacount.py (limited to 'test/unit/test_datacount.py') 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) -- cgit v1.2.3