From 45714b5fc6cf14c112bc4f188aca427464ab69d8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 10 Jan 2019 19:31:20 -0800 Subject: Compare binaryen fuzz-exec to JS VMs (#1856) The main fuzz_opt.py script compares JS VMs, and separately runs binaryen's fuzz-exec that compares the binaryen interpreter to itself (before and after opts). This PR lets us directly compare binaryen's interpreter output to JS VMs. This found a bunch of minor things we can do better on both sides, giving more fuzz coverage. To enable this, a bunch of tiny fixes were needed: * Add --fuzz-exec-before which is like --fuzz-exec but just runs the code before opts are run, instead of before and after. * Normalize double printing (so JS and C++ print comparable things). This includes negative zero in JS, which we never printed properly til now. * Various improvements to how we print fuzz-exec logging - remove unuseful things, and normalize the others across JS and C++. * Properly legalize the wasm when --emit-js-wrapper (i.e., we will run the code from JS), and use that in the JS wrapper code. --- test/reduce/imports.wast.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test/reduce') diff --git a/test/reduce/imports.wast.txt b/test/reduce/imports.wast.txt index 6807ffd26..adfd5ff04 100644 --- a/test/reduce/imports.wast.txt +++ b/test/reduce/imports.wast.txt @@ -1,10 +1,7 @@ (module - (type $0 (func)) - (type $1 (func (result i32))) - (import "env" "func" (func $fimport$0)) + (type $0 (func (result i32))) (export "x" (func $0)) - (func $0 (; 1 ;) (type $1) (result i32) - (call $fimport$0) + (func $0 (; 0 ;) (type $0) (result i32) (i32.const 5678) ) ) -- cgit v1.2.3