From 71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8 Mon Sep 17 00:00:00 2001
From: Alon Zakai <alonzakai@gmail.com>
Date: Tue, 7 Mar 2017 13:56:35 -0800
Subject: 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)
---
 auto_update_tests.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'auto_update_tests.py')

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)
 
-- 
cgit v1.2.3