summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-03-07 13:56:35 -0800
committerGitHub <noreply@github.com>2017-03-07 13:56:35 -0800
commit71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8 (patch)
tree7a91f560708b5017cf795850db94267f2cb58f62 /auto_update_tests.py
parenta452f92aeb96e9617a20146503720cd5acb64f29 (diff)
downloadbinaryen-71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8.tar.gz
binaryen-71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8.tar.bz2
binaryen-71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8.zip
Use 3 modes for potentially trapping ops in asm2wasm (#929)
* use 3 modes for potentially trapping ops in asm2wasm: allow (just emit a potentially trapping op), js (do exactly what js does, even if it takes a slow ffi to do it), and clamp (avoid the trap by clamping as necessary)
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 08d0a3e32..61f97a11c 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -8,13 +8,16 @@ print '[ processing and updating testcases... ]\n'
for asm in sorted(os.listdir('test')):
if asm.endswith('.asm.js'):
- for precise in [1, 0]:
+ for precise in [0, 1, 2]:
for opts in [1, 0]:
cmd = [os.path.join('bin', 'asm2wasm'), os.path.join('test', asm)]
wasm = asm.replace('.asm.js', '.fromasm')
if not precise:
- cmd += ['--imprecise', '--ignore-implicit-traps']
+ cmd += ['--emit-potential-traps', '--ignore-implicit-traps']
wasm += '.imprecise'
+ elif precise == 2:
+ cmd += ['--emit-clamped-potential-traps']
+ wasm += '.clamp'
if not opts:
wasm += '.no-opts'
if precise:
@@ -31,8 +34,7 @@ for asm in sorted(os.listdir('test')):
cmd += ['--mem-base=1024']
if 'i64' in asm or 'wasm-only' in asm:
cmd += ['--wasm-only']
- print '..', asm, wasm
- print ' ', ' '.join(cmd)
+ print ' '.join(cmd)
actual = run_command(cmd)
with open(os.path.join('test', wasm), 'w') as o: o.write(actual)