Commit bff42d35 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Add regression tests for some recently fixed WasmInterpreter issues.

R=clemensh@chromium.org

Bug: chromium:766003,chromium:772332,chromium:771243
Change-Id: I1e2df014f31a87fd94154277d1a415ec359d42df
Reviewed-on: https://chromium-review.googlesource.com/721666Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48635}
parent 4450f7ca
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-wasm --wasm-interpret-all
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');
__v_6 = new WasmModuleBuilder();
__v_6.addFunction('exp1', kSig_i_i).addBody([kExprUnreachable]).exportFunc();
__v_7 = new WasmModuleBuilder();
__v_7.addImport('__v_11', '__v_11', kSig_i_i);
try {
; } catch(e) {; }
__v_8 = __v_6.instantiate().exports.exp1;
__v_9 = __v_7.instantiate({__v_11: {__v_11: __v_8}}).exports.call_imp;
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-wasm --wasm-interpret-all
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');
assertThrows(() => {
__v_29 = 0;
function __f_1() {
__v_19 = new WasmModuleBuilder();
if (__v_25) {
__v_23 = __v_19.addImport('__v_24', '__v_30', __v_25);
}
if (__v_18) {
__v_19.addMemory();
__v_19.addFunction('load', kSig_i_i)
.addBody([ 0])
.exportFunc();
}
return __v_19;
}
(function TestExternalCallBetweenTwoWasmModulesWithoutAndWithMemory() {
__v_21 = __f_1(__v_18 = false, __v_25 = kSig_i_i);
__v_21.addFunction('plus_one', kSig_i_i)
.addBody([
kExprGetLocal, 0, // -
kExprCallFunction, __v_29 ])
.exportFunc();
__v_32 =
__f_1(__v_18 = true, __v_25 = undefined);
__v_31 = __v_32.instantiate(); try { __v_32[__getRandomProperty()] = __v_0; delete __v_18[__getRandomProperty()]; delete __v_34[__getRandomProperty()]; } catch(e) {; };
__v_20 = __v_21.instantiate(
{__v_24: {__v_30: __v_31.exports.load}});
__v_20.exports.plus_one(); __v_33 = __v_43;
})();
});
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-wasm --wasm-interpret-all
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');
assertThrows(() => {
let __v_50315 = 0;
function __f_15356(__v_50316, __v_50317) {
let __v_50318 = new WasmModuleBuilder();
if (__v_50317) {
let __v_50319 = __v_50318.addImport('import_module', 'other_module_fn', kSig_i_i);
}
__v_50318.addMemory();
__v_50318.addFunction('load', kSig_i_i).addBody([ 0, 0, 0]).exportFunc();
return __v_50318;
}
(function __f_15357() {
let __v_50320 = __f_15356(__v_50350 = false, __v_50351 = kSig_i_i);
__v_50320.addFunction('plus_one', kSig_i_i).addBody([kExprGetLocal, 0, kExprCallFunction, __v_50315, kExprI32Const, kExprI32Add, kExprReturn]).exportFunc();
let __v_50321 = __f_15356();
let __v_50324 = __v_50321.instantiate();
let __v_50325 = __v_50320.instantiate({
import_module: {
other_module_fn: __v_50324.exports.load
}
});
__v_50325.exports.plus_one();
})();
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment