summaryrefslogtreecommitdiff
path: root/scripts/test/s2wasm.py
diff options
context:
space:
mode:
authorMax Klein <max.kleinleibold@gmail.com>2017-04-12 22:15:31 +0200
committerDerek Schuff <dschuff@chromium.org>2017-04-12 13:15:31 -0700
commit5fb669ac8cca51baff8b3a6478d6fd3ef92a7c97 (patch)
tree1abeea3c8306c521eaa64fbada122052859b0bb6 /scripts/test/s2wasm.py
parent0f3102d13617e70b598e7d82f12684d8fa01969b (diff)
downloadbinaryen-5fb669ac8cca51baff8b3a6478d6fd3ef92a7c97.tar.gz
binaryen-5fb669ac8cca51baff8b3a6478d6fd3ef92a7c97.tar.bz2
binaryen-5fb669ac8cca51baff8b3a6478d6fd3ef92a7c97.zip
s2wasm: Add command line option for importing memory (#963)
This option allows to import the linear memory from JS code instead of exporting it. --emscripten-glue does this too but often the emscripten glue isn't needed, so this option only affects the memory. All the code necessary for importing the memory basically already exists, so nothing except for the command line option itself had to be added.
Diffstat (limited to 'scripts/test/s2wasm.py')
-rwxr-xr-xscripts/test/s2wasm.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/test/s2wasm.py b/scripts/test/s2wasm.py
index 02cb5f147..5e704e51a 100755
--- a/scripts/test/s2wasm.py
+++ b/scripts/test/s2wasm.py
@@ -25,6 +25,12 @@ from shared import (
def test_s2wasm():
print '\n[ checking .s testcases... ]\n'
+ cmd = S2WASM + [
+ os.path.join(options.binaryen_test, 'dot_s', 'basics.s'),
+ '--import-memory']
+ output = run_command(cmd)
+ fail_if_not_contained(output, '(import "env" "memory" (memory $0 1))')
+
for dot_s_dir in ['dot_s', 'llvm_autogenerated']:
dot_s_path = os.path.join(options.binaryen_test, dot_s_dir)
for s in sorted(os.listdir(dot_s_path)):