diff --git a/check.py b/check.py index 490c70be9d8..6ba66a41c1b 100755 --- a/check.py +++ b/check.py @@ -354,7 +354,7 @@ def check_expected(actual, expected): expected = open(expected).read() # fix it up, our pretty (i32.const 83) must become compared to a homely 83 : i32 - def fix(x): + def fix_expected(x): x = x.strip() if not x: return x @@ -363,7 +363,13 @@ def fix(x): v = v[:-1] # remove trailing '.' return '(' + t + '.const ' + v + ')' - expected = '\n'.join(map(fix, expected.split('\n'))) + def fix_actual(x): + if '[trap ' in x: + return '' + return x + + expected = '\n'.join(map(fix_expected, expected.split('\n'))) + actual = '\n'.join(map(fix_actual, actual.split('\n'))) print ' (using expected output)' actual = actual.strip() expected = expected.strip() diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 49a2c3f7310..e3a59a69027 100644 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -17,6 +17,7 @@ import difflib import subprocess import random +import re import shutil import time @@ -64,85 +65,88 @@ def randomize_pass_debug(): IGNORE = '[binaryen-fuzzer-ignore]' -def test_one(infile, opts): - def compare(x, y, comment): - if x != y and x != IGNORE and y != IGNORE: - message = ''.join([a.rstrip() + '\n' for a in difflib.unified_diff(x.split('\n'), y.split('\n'), fromfile='expected', tofile='actual')]) - raise Exception(str(comment) + ": Expected to have '%s' == '%s', diff:\n\n%s" % ( - x, y, - message - )) - - def run_vms(prefix): - def fix_output(out): - # exceptions may differ when optimizing, but an exception should occur. so ignore their types - # also js engines print them out slightly differently - return '\n'.join(map(lambda x: ' *exception*' if 'exception' in x else x, out.split('\n'))) - - # normalize different vm output - # also the binaryen optimizer can reorder traps (but not remove them), so - # it really just matters if you trap, not how you trap - return out.replace('unreachable executed', 'unreachable') \ - .replace('integer result unrepresentable', 'integer overflow') \ - .replace('invalid conversion to integer', 'integer overflow') \ - .replace('memory access out of bounds', 'index out of bounds') \ - .replace('integer divide by zero', 'divide by zero') \ - .replace('integer remainder by zero', 'remainder by zero') \ - .replace('remainder by zero', 'divide by zero') \ - .replace('divide result unrepresentable', 'integer overflow') \ - .replace('divide by zero', 'integer overflow') \ - .replace('index out of bounds', 'integer overflow') \ - .replace('out of bounds memory access', 'integer overflow') - - def fix_spec_output(out): - out = fix_output(out) - # spec shows a pointer when it traps, remove that - out = '\n'.join(map(lambda x: x if 'runtime trap' not in x else x[x.find('runtime trap'):], out.split('\n'))) - # https://github.com/WebAssembly/spec/issues/543 , float consts are messed up - out = '\n'.join(map(lambda x: x if 'f32' not in x and 'f64' not in x else '', out.split('\n'))) - return out - - def run_vm(cmd): - # ignore some vm assertions, if bugs have already been filed - known_issues = [ - 'local count too large', # ignore this; can be caused by flatten, ssa, etc. passes - 'liftoff-assembler.cc, line 239\n', # https://bugs.chromium.org/p/v8/issues/detail?id=8631 - 'liftoff-register.h, line 86\n', # https://bugs.chromium.org/p/v8/issues/detail?id=8632 - ] - try: - return run(cmd) - except: - output = run_unchecked(cmd) - for issue in known_issues: - if issue in output: - return IGNORE - raise - - results = [] - # append to this list to add results from VMs - results += [fix_output(run_vm([os.path.expanduser('d8'), prefix + 'js', '--', prefix + 'wasm']))] - results += [fix_output(run_vm([os.path.expanduser('d8-debug'), '--wasm-tier-up', prefix + 'js', '--', prefix + 'wasm']))] - results += [fix_output(run_vm([os.path.expanduser('d8-debug'), '--no-wasm-tier-up', prefix + 'js', '--', prefix + 'wasm']))] - # spec has no mechanism to not halt on a trap. so we just check until the first trap, basically - # run(['../spec/interpreter/wasm', prefix + 'wasm']) - # results += [fix_spec_output(run_unchecked(['../spec/interpreter/wasm', prefix + 'wasm', '-e', open(prefix + 'wat').read()]))] - - if len(results) == 0: - results = [0] - - first = results[0] - for i in range(len(results)): - compare(first, results[i], 'comparing between vms at ' + str(i)) - - return results +def compare(x, y, comment): + if x != y and x != IGNORE and y != IGNORE: + message = ''.join([a.rstrip() + '\n' for a in difflib.unified_diff(x.split('\n'), y.split('\n'), fromfile='expected', tofile='actual')]) + raise Exception(str(comment) + ": Expected to have '%s' == '%s', diff:\n\n%s" % ( + x, y, + message + )) + + +def run_vms(prefix): + def fix_output(out): + # large doubles may print slightly different on different VMs + def fix_double(x): + x = x.group(1) + if 'nan' in x or 'NaN' in x: + x = 'nan' + else: + x = x.replace('Infinity', 'inf') + x = str(float(x)) + return 'f64.const ' + x + out = re.sub(r'f64\.const (-?[nanN:abcdefxIity\d+-.]+)', fix_double, out) + + # mark traps from wasm-opt as exceptions, even though they didn't run in a vm + out = out.replace('[trap ', 'exception: [trap ') + + # exceptions may differ when optimizing, but an exception should occur. so ignore their types + # also js engines print them out slightly differently + return '\n'.join(map(lambda x: ' *exception*' if 'exception' in x else x, out.split('\n'))) + + def fix_spec_output(out): + out = fix_output(out) + # spec shows a pointer when it traps, remove that + out = '\n'.join(map(lambda x: x if 'runtime trap' not in x else x[x.find('runtime trap'):], out.split('\n'))) + # https://github.com/WebAssembly/spec/issues/543 , float consts are messed up + out = '\n'.join(map(lambda x: x if 'f32' not in x and 'f64' not in x else '', out.split('\n'))) + return out + + def run_vm(cmd): + # ignore some vm assertions, if bugs have already been filed + known_issues = [ + 'local count too large', # ignore this; can be caused by flatten, ssa, etc. passes + 'liftoff-assembler.cc, line 239\n', # https://bugs.chromium.org/p/v8/issues/detail?id=8631 + 'liftoff-assembler.cc, line 245\n', # https://bugs.chromium.org/p/v8/issues/detail?id=8631 + 'liftoff-register.h, line 86\n', # https://bugs.chromium.org/p/v8/issues/detail?id=8632 + ] + try: + return run(cmd) + except: + output = run_unchecked(cmd) + for issue in known_issues: + if issue in output: + return IGNORE + raise + + results = [] + # append to this list to add results from VMs + results += [fix_output(run_vm([in_bin('wasm-opt'), prefix + 'wasm', '--fuzz-exec-before']))] + results += [fix_output(run_vm([os.path.expanduser('d8'), '--experimental-wasm-sat_f2i_conversions', prefix + 'js', '--', prefix + 'wasm']))] + results += [fix_output(run_vm([os.path.expanduser('d8-debug'), '--experimental-wasm-sat_f2i_conversions', '--wasm-tier-up', prefix + 'js', '--', prefix + 'wasm']))] + results += [fix_output(run_vm([os.path.expanduser('d8-debug'), '--experimental-wasm-sat_f2i_conversions', '--no-wasm-tier-up', prefix + 'js', '--', prefix + 'wasm']))] + # spec has no mechanism to not halt on a trap. so we just check until the first trap, basically + # run(['../spec/interpreter/wasm', prefix + 'wasm']) + # results += [fix_spec_output(run_unchecked(['../spec/interpreter/wasm', prefix + 'wasm', '-e', open(prefix + 'wat').read()]))] + + if len(results) == 0: + results = [0] + + first = results[0] + for i in range(len(results)): + compare(first, results[i], 'comparing between vms at ' + str(i)) + + return results + +def test_one(infile, opts): randomize_pass_debug() bytes = 0 # fuzz vms # gather VM outputs on input file - run([in_bin('wasm-opt'), infile, '-ttf', '--emit-js-wrapper=a.js', '--emit-spec-wrapper=a.wat', '-o', 'a.wasm', '--mvp-features']) + run([in_bin('wasm-opt'), infile, '-ttf', '--emit-js-wrapper=a.js', '--emit-spec-wrapper=a.wat', '-o', 'a.wasm', '--mvp-features', '--enable-nontrapping-float-to-int']) wasm_size = os.stat('a.wasm').st_size bytes += wasm_size print('pre js size :', os.stat('a.js').st_size, ' wasm size:', wasm_size) diff --git a/src/shell-interface.h b/src/shell-interface.h index fc6a5897ce4..071cc614d3d 100644 --- a/src/shell-interface.h +++ b/src/shell-interface.h @@ -200,7 +200,7 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { } void trap(const char* why) override { - std::cerr << "[trap " << why << "]\n"; + std::cout << "[trap " << why << "]\n"; throw TrapException(); } }; diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index 89e0440bbaa..554b4eb6c0d 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -26,20 +26,22 @@ namespace wasm { typedef std::vector Loggings; -// Logs every single import call parameter. +// Logs every relevant import call parameter. struct LoggingExternalInterface : public ShellExternalInterface { Loggings& loggings; LoggingExternalInterface(Loggings& loggings) : loggings(loggings) {} Literal callImport(Function* import, LiteralList& arguments) override { - std::cout << "[LoggingExternalInterface logging"; - loggings.push_back(Literal()); // buffer with a None between calls - for (auto argument : arguments) { - std::cout << ' ' << argument; - loggings.push_back(argument); + if (import->module == "fuzzing-support") { + std::cout << "[LoggingExternalInterface logging"; + loggings.push_back(Literal()); // buffer with a None between calls + for (auto argument : arguments) { + std::cout << ' ' << argument; + loggings.push_back(argument); + } + std::cout << "]\n"; } - std::cout << "]\n"; return Literal(); } }; @@ -60,21 +62,23 @@ struct ExecutionResults { // execute all exported methods (that are therefore preserved through opts) for (auto& exp : wasm.exports) { if (exp->kind != ExternalKind::Function) continue; + std::cout << "[fuzz-exec] calling " << exp->name << "\n"; auto* func = wasm.getFunction(exp->value); if (func->result != none) { // this has a result results[exp->name] = run(func, wasm, instance); - std::cout << "[fuzz-exec] note result: " << exp->name << " => " << results[exp->name] << '\n'; + // ignore the result if we hit an unreachable and returned no value + if (isConcreteType(results[exp->name].type)) { + std::cout << "[fuzz-exec] note result: " << exp->name << " => " << results[exp->name] << '\n'; + } } else { // no result, run it anyhow (it might modify memory etc.) run(func, wasm, instance); - std::cout << "[fuzz-exec] no result for void func: " << exp->name << '\n'; } } } catch (const TrapException&) { // may throw in instance creation (init of offsets) } - std::cout << "[fuzz-exec] " << results.size() << " results noted\n"; } // get current results and check them against previous ones @@ -85,7 +89,6 @@ struct ExecutionResults { std::cout << "[fuzz-exec] optimization passes changed execution results"; abort(); } - std::cout << "[fuzz-exec] " << results.size() << " results match\n"; } bool operator==(ExecutionResults& other) { @@ -127,8 +130,8 @@ struct ExecutionResults { try { LiteralList arguments; // init hang support, if present - if (wasm.getFunctionOrNull("hangLimitInitializer")) { - instance.callFunction("hangLimitInitializer", arguments); + if (auto* ex = wasm.getExportOrNull("hangLimitInitializer")) { + instance.callFunction(ex->value, arguments); } // call the method for (Type param : func->params) { diff --git a/src/tools/js-wrapper.h b/src/tools/js-wrapper.h index 7cf2ffc537b..765a638c570 100644 --- a/src/tools/js-wrapper.h +++ b/src/tools/js-wrapper.h @@ -22,10 +22,6 @@ namespace wasm { static std::string generateJSWrapper(Module& wasm) { - PassRunner runner(&wasm); - runner.add("legalize-js-interface"); - runner.run(); - std::string ret; ret += "if (typeof console === 'undefined') {\n" " console = { log: print };\n" @@ -49,12 +45,26 @@ static std::string generateJSWrapper(Module& wasm) { " binary = read(args[0], 'binary');\n" " }\n" "}\n" + "function literal(x, type) {\n" + " var ret = type + '.const ';\n" + " switch (type) {\n" + " case 'i32': ret += (x | 0); break;\n" + " case 'f32':\n" + " case 'f64': {\n" + " if (x == 0 && (1 / x) < 0) ret += '-';\n" + " ret += x;\n" + " break;\n" + " }\n" + " default: throw 'what?';\n" + " }\n" + " return ret;\n" + "}\n" "var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {\n" " 'fuzzing-support': {\n" - " 'log-i32': function(x) { console.log('i32: ' + x) },\n" - " 'log-i64': function(x, y) { console.log('i64: ' + x + ', ' + y) },\n" - " 'log-f32': function(x) { console.log('f32: ' + x) },\n" - " 'log-f64': function(x) { console.log('f64: ' + x) }\n" + " 'log-i32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ']') },\n" + " 'log-i64': function(x, y) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ' ' + literal(y, 'i32') + ']') },\n" // legalization: two i32s + " 'log-f32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') },\n" // legalization: an f64 + " 'log-f64': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') },\n" " },\n" " 'env': {\n" " 'setTempRet0': function(x) { tempRet0 = x },\n" @@ -64,22 +74,17 @@ static std::string generateJSWrapper(Module& wasm) { for (auto& exp : wasm.exports) { auto* func = wasm.getFunctionOrNull(exp->value); if (!func) continue; // something exported other than a function - auto bad = false; // check for things we can't support - for (Type param : func->params) { - if (param == i64) bad = true; - } - if (func->result == i64) bad = true; - if (bad) continue; ret += "if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer();\n"; ret += "try {\n"; - ret += std::string(" console.log('calling: ") + exp->name.str + "');\n"; + ret += std::string(" console.log('[fuzz-exec] calling $") + exp->name.str + "');\n"; if (func->result != none) { - ret += " console.log(' result: ' + "; + ret += std::string(" console.log('[fuzz-exec] note result: $") + exp->name.str + " => ' + literal("; + } else { + ret += " "; } ret += std::string("instance.exports.") + exp->name.str + "("; bool first = true; for (Type param : func->params) { - WASM_UNUSED(param); // zeros in arguments TODO more? if (first) { first = false; @@ -87,17 +92,20 @@ static std::string generateJSWrapper(Module& wasm) { ret += ", "; } ret += "0"; + if (param == i64) { + ret += ", 0"; + } } ret += ")"; if (func->result != none) { - ret += ")"; // for console.log + ret += ", '" + std::string(printType(func->result)) + "'))"; + // TODO: getTempRet } ret += ";\n"; ret += "} catch (e) {\n"; - ret += " console.log(' exception: ' + e);\n"; + ret += " console.log('exception: ' + e);\n"; ret += "}\n"; } - ret += "console.log('done.')\n"; return ret; } diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp index 3e04fc64458..5238caf7ad3 100644 --- a/src/tools/wasm-opt.cpp +++ b/src/tools/wasm-opt.cpp @@ -65,7 +65,8 @@ int main(int argc, const char* argv[]) { bool emitBinary = true; bool debugInfo = false; bool converge = false; - bool fuzzExec = false; + bool fuzzExecBefore = false; + bool fuzzExecAfter = false; bool fuzzBinary = false; std::string extraFuzzCommand; bool translateToFuzz = false; @@ -93,9 +94,12 @@ int main(int argc, const char* argv[]) { .add("--converge", "-c", "Run passes to convergence, continuing while binary size decreases", Options::Arguments::Zero, [&](Options *o, const std::string& arguments) { converge = true; }) + .add("--fuzz-exec-before", "-feh", "Execute functions before optimization, helping fuzzing find bugs", + Options::Arguments::Zero, + [&](Options *o, const std::string& arguments) { fuzzExecBefore = true; }) .add("--fuzz-exec", "-fe", "Execute functions before and after optimization, helping fuzzing find bugs", Options::Arguments::Zero, - [&](Options *o, const std::string& arguments) { fuzzExec = true; }) + [&](Options *o, const std::string& arguments) { fuzzExecBefore = fuzzExecAfter = true; }) .add("--fuzz-binary", "-fb", "Convert to binary and back after optimizations and before fuzz-exec, helping fuzzing find binary format bugs", Options::Arguments::Zero, [&](Options *o, const std::string& arguments) { fuzzBinary = true; }) @@ -172,8 +176,15 @@ int main(int argc, const char* argv[]) { } } + if (emitJSWrapper.size() > 0) { + // As the code will run in JS, we must legalize it. + PassRunner runner(&wasm); + runner.add("legalize-js-interface"); + runner.run(); + } + ExecutionResults results; - if (fuzzExec) { + if (fuzzExecBefore) { results.get(wasm); } @@ -207,7 +218,7 @@ int main(int argc, const char* argv[]) { Module* curr = &wasm; Module other; - if (fuzzExec && fuzzBinary) { + if (fuzzExecAfter && fuzzBinary) { BufferWithRandomAccess buffer(false); // write the binary WasmBinaryWriter writer(&wasm, buffer, false); @@ -259,7 +270,7 @@ int main(int argc, const char* argv[]) { } } - if (fuzzExec) { + if (fuzzExecAfter) { results.check(*curr); } diff --git a/test/passes/emit-js-wrapper=a.js.wast.js b/test/passes/emit-js-wrapper=a.js.wast.js index f2e828c2bb2..9e857878192 100644 --- a/test/passes/emit-js-wrapper=a.js.wast.js +++ b/test/passes/emit-js-wrapper=a.js.wast.js @@ -20,12 +20,26 @@ if (typeof process === 'object' && typeof require === 'function' /* node.js dete binary = read(args[0], 'binary'); } } +function literal(x, type) { + var ret = type + '.const '; + switch (type) { + case 'i32': ret += (x | 0); break; + case 'f32': + case 'f64': { + if (x == 0 && (1 / x) < 0) ret += '-'; + ret += x; + break; + } + default: throw 'what?'; + } + return ret; +} var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), { 'fuzzing-support': { - 'log-i32': function(x) { console.log('i32: ' + x) }, - 'log-i64': function(x, y) { console.log('i64: ' + x + ', ' + y) }, - 'log-f32': function(x) { console.log('f32: ' + x) }, - 'log-f64': function(x) { console.log('f64: ' + x) } + 'log-i32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ']') }, + 'log-i64': function(x, y) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ' ' + literal(y, 'i32') + ']') }, + 'log-f32': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') }, + 'log-f64': function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'f64') + ']') }, }, 'env': { 'setTempRet0': function(x) { tempRet0 = x }, @@ -34,37 +48,36 @@ var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), { }); if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { - console.log('calling: add'); - console.log(' result: ' + instance.exports.add(0, 0)); + console.log('[fuzz-exec] calling $add'); + console.log('[fuzz-exec] note result: $add => ' + literal(instance.exports.add(0, 0), 'i32')); } catch (e) { - console.log(' exception: ' + e); + console.log('exception: ' + e); } if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { - console.log('calling: no_return'); -instance.exports.no_return(0); + console.log('[fuzz-exec] calling $no_return'); + instance.exports.no_return(0); } catch (e) { - console.log(' exception: ' + e); + console.log('exception: ' + e); } if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { - console.log('calling: types'); -instance.exports.types(0, 0, 0, 0, 0); + console.log('[fuzz-exec] calling $types'); + instance.exports.types(0, 0, 0, 0, 0); } catch (e) { - console.log(' exception: ' + e); + console.log('exception: ' + e); } if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { - console.log('calling: types2'); -instance.exports.types2(0, 0, 0); + console.log('[fuzz-exec] calling $types2'); + instance.exports.types2(0, 0, 0); } catch (e) { - console.log(' exception: ' + e); + console.log('exception: ' + e); } if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { - console.log('calling: types3'); - console.log(' result: ' + instance.exports.types3(0, 0, 0)); + console.log('[fuzz-exec] calling $types3'); + console.log('[fuzz-exec] note result: $types3 => ' + literal(instance.exports.types3(0, 0, 0), 'i32')); } catch (e) { - console.log(' exception: ' + e); + console.log('exception: ' + e); } -console.log('done.') diff --git a/test/passes/fuzz-exec.txt b/test/passes/fuzz-exec.txt index 0c1186bc702..409f9318192 100644 --- a/test/passes/fuzz-exec.txt +++ b/test/passes/fuzz-exec.txt @@ -1,9 +1,13 @@ +[fuzz-exec] calling $a [fuzz-exec] note result: $a => i32.const -69 +[fuzz-exec] calling $b [fuzz-exec] note result: $b => i32.const -31768 +[fuzz-exec] calling $c [fuzz-exec] note result: $c => i64.const -69 +[fuzz-exec] calling $d [fuzz-exec] note result: $d => i64.const -31768 +[fuzz-exec] calling $e [fuzz-exec] note result: $e => i64.const -2146649112 -[fuzz-exec] 5 results noted (module (type $0 (func (result i32))) (type $1 (func (result i64))) @@ -38,15 +42,18 @@ ) ) ) +[fuzz-exec] calling $a [fuzz-exec] note result: $a => i32.const -69 +[fuzz-exec] calling $b [fuzz-exec] note result: $b => i32.const -31768 +[fuzz-exec] calling $c [fuzz-exec] note result: $c => i64.const -69 +[fuzz-exec] calling $d [fuzz-exec] note result: $d => i64.const -31768 +[fuzz-exec] calling $e [fuzz-exec] note result: $e => i64.const -2146649112 -[fuzz-exec] 5 results noted [fuzz-exec] comparing $a [fuzz-exec] comparing $b [fuzz-exec] comparing $c [fuzz-exec] comparing $d [fuzz-exec] comparing $e -[fuzz-exec] 5 results match diff --git a/test/passes/fuzz-exec_O.txt b/test/passes/fuzz-exec_O.txt index 76141fcc5e9..6f6e5067471 100644 --- a/test/passes/fuzz-exec_O.txt +++ b/test/passes/fuzz-exec_O.txt @@ -1,6 +1,7 @@ -[fuzz-exec] note result: $func_0 => none.const ? -[fuzz-exec] note result: $func_1 => none.const ? -[fuzz-exec] 2 results noted +[fuzz-exec] calling $func_0 +[trap final > memory: 18446744073709551615 > 65514] +[fuzz-exec] calling $func_1 +[trap final > memory: 18446744073709551615 > 65514] (module (type $0 (func (result i64))) (type $1 (func (result i32))) @@ -23,9 +24,9 @@ ) ) ) -[fuzz-exec] note result: $func_0 => none.const ? -[fuzz-exec] note result: $func_1 => none.const ? -[fuzz-exec] 2 results noted +[fuzz-exec] calling $func_0 +[trap final > memory: 18446744073709551615 > 65514] +[fuzz-exec] calling $func_1 +[trap final > memory: 18446744073709551615 > 65514] [fuzz-exec] comparing $func_0 [fuzz-exec] comparing $func_1 -[fuzz-exec] 2 results match diff --git a/test/passes/ssa_fuzz-exec.txt b/test/passes/ssa_fuzz-exec.txt index ca7d6af2dae..b15ae57753f 100644 --- a/test/passes/ssa_fuzz-exec.txt +++ b/test/passes/ssa_fuzz-exec.txt @@ -1,5 +1,5 @@ +[fuzz-exec] calling $func_0 [fuzz-exec] note result: $func_0 => i32.const 16384 -[fuzz-exec] 1 results noted (module (type $0 (func (result i32))) (type $1 (func)) @@ -127,7 +127,6 @@ ) ) ) +[fuzz-exec] calling $func_0 [fuzz-exec] note result: $func_0 => i32.const 16384 -[fuzz-exec] 1 results noted [fuzz-exec] comparing $func_0 -[fuzz-exec] 1 results match diff --git a/test/reduce/imports.wast.txt b/test/reduce/imports.wast.txt index 6807ffd2669..adfd5ff0454 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) ) )