summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/fuzz_opt.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 8f9cbcb26..ac6ba977a 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -539,10 +539,14 @@ class Asyncify(TestCaseHandler):
def do_asyncify(wasm):
cmd = [in_bin('wasm-opt'), wasm, '--asyncify', '-o', 'async.t.wasm']
- if random.random() < 0.5:
- cmd += ['--optimize-level=%d' % random.randint(1, 3)]
- if random.random() < 0.5:
- cmd += ['--shrink-level=%d' % random.randint(1, 2)]
+ # if we allow NaNs, running binaryen optimizations and then
+ # executing in d8 may lead to different results due to NaN
+ # nondeterminism between VMs.
+ if not NANS:
+ if random.random() < 0.5:
+ cmd += ['--optimize-level=%d' % random.randint(1, 3)]
+ if random.random() < 0.5:
+ cmd += ['--shrink-level=%d' % random.randint(1, 2)]
cmd += FEATURE_OPTS
run(cmd)
out = run_d8('async.t.wasm')