2019-05-08 15:36:48 +00:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
// Flags: --expose-wasm --experimental-wasm-eh
|
|
|
|
|
2021-06-01 12:46:36 +00:00
|
|
|
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
|
2019-05-08 15:36:48 +00:00
|
|
|
|
|
|
|
let builder = new WasmModuleBuilder();
|
2021-07-29 11:09:02 +00:00
|
|
|
let except = builder.addTag(kSig_v_i);
|
2019-05-08 15:36:48 +00:00
|
|
|
builder.addFunction("rethrow0", kSig_v_v)
|
|
|
|
.addBody([
|
2021-03-22 06:56:01 +00:00
|
|
|
kExprTry, kWasmVoid,
|
2019-05-08 15:36:48 +00:00
|
|
|
kExprI32Const, 23,
|
|
|
|
kExprThrow, except,
|
2020-12-03 18:00:05 +00:00
|
|
|
kExprCatch, except,
|
|
|
|
kExprRethrow, 0,
|
2019-05-08 15:36:48 +00:00
|
|
|
kExprEnd,
|
|
|
|
]).exportFunc();
|
|
|
|
let instance = builder.instantiate();
|
|
|
|
instance.exports.rethrow0();
|