[wasm] Add message test for compilation failure
This adds three message tests to test the message stack trace we show for - synchronous compilation, - asynchronous compilation, and - asynchronous instantiation. Note that the message for the asynchronous cases currently contain the "WebAssembly.Module()" prefix, which will be fixed in a separate CL. R=mstarzinger@chromium.org Bug: v8:9266 Change-Id: I370f4211b5f577ea1b5da026a78b292b50c6a339 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617938 Reviewed-by: Andreas Haas <ahaas@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#61653}
This commit is contained in:
parent
5bfe84a0da
commit
617b7266bf
10
test/message/fail/wasm-async-compile-fail.js
Normal file
10
test/message/fail/wasm-async-compile-fail.js
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2019 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.
|
||||
|
||||
load('test/mjsunit/wasm/wasm-module-builder.js');
|
||||
|
||||
let builder = new WasmModuleBuilder();
|
||||
builder.addFunction('f', kSig_i_v).addBody([]);
|
||||
let rethrow = e => setTimeout(_ => {throw e}, 0);
|
||||
WebAssembly.compile(builder.toBuffer()).catch(rethrow);
|
5
test/message/fail/wasm-async-compile-fail.out
Normal file
5
test/message/fail/wasm-async-compile-fail.out
Normal file
@ -0,0 +1,5 @@
|
||||
*%(basename)s:9: CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
let rethrow = e => setTimeout(_ => {throw e}, 0);
|
||||
^
|
||||
CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
|
10
test/message/fail/wasm-async-instantiate-fail.js
Normal file
10
test/message/fail/wasm-async-instantiate-fail.js
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2019 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.
|
||||
|
||||
load('test/mjsunit/wasm/wasm-module-builder.js');
|
||||
|
||||
let builder = new WasmModuleBuilder();
|
||||
builder.addFunction('f', kSig_i_v).addBody([]);
|
||||
let rethrow = e => setTimeout(_ => {throw e}, 0);
|
||||
WebAssembly.instantiate(builder.toBuffer()).catch(rethrow);
|
5
test/message/fail/wasm-async-instantiate-fail.out
Normal file
5
test/message/fail/wasm-async-instantiate-fail.out
Normal file
@ -0,0 +1,5 @@
|
||||
*%(basename)s:9: CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
let rethrow = e => setTimeout(_ => {throw e}, 0);
|
||||
^
|
||||
CompileError: WebAssembly.compile(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
|
9
test/message/fail/wasm-sync-compile-fail.js
Normal file
9
test/message/fail/wasm-sync-compile-fail.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2019 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.
|
||||
|
||||
load('test/mjsunit/wasm/wasm-module-builder.js');
|
||||
|
||||
let builder = new WasmModuleBuilder();
|
||||
builder.addFunction('f', kSig_i_v).addBody([]);
|
||||
new WebAssembly.Module(builder.toBuffer());
|
6
test/message/fail/wasm-sync-compile-fail.out
Normal file
6
test/message/fail/wasm-sync-compile-fail.out
Normal file
@ -0,0 +1,6 @@
|
||||
*%(basename)s:9: CompileError: WebAssembly.Module(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
new WebAssembly.Module(builder.toBuffer());
|
||||
^
|
||||
CompileError: WebAssembly.Module(): Compiling function #0:"f" failed: expected 1 elements on the stack for fallthru to @1, found 0 @+24
|
||||
at *%(basename)s:9:1
|
||||
|
Loading…
Reference in New Issue
Block a user