v8/test/mjsunit/regress/wasm/regress-917412.js
Manos Koukoutos a51056f5c4 [wasm] Rename kWasmStmt -> kWasmVoid
This is a more canonical type name, and is in line with {kVoidCode}.

Change-Id: Iaae9524b6fb6ecaafd63ce81cf30e3d01ca3e525
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2775565
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73557}
2021-03-22 07:58:18 +00:00

34 lines
812 B
JavaScript

// Copyright 2018 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');
const builder = new WasmModuleBuilder();
const sig = builder.addType(makeSig([kWasmI32, kWasmI64], []));
builder.addFunction(undefined, sig)
.addBody([
kExprI32Const, 0,
kExprIf, kWasmI32,
kExprI32Const, 0,
kExprElse,
kExprI32Const, 1,
kExprEnd,
kExprLocalTee, 0,
kExprLocalGet, 0,
kExprLoop, kWasmVoid,
kExprI64Const, 0x80, 0x80, 0x80, 0x70,
kExprLocalSet, 0x01,
kExprI32Const, 0x00,
kExprIf, kWasmI32,
kExprI32Const, 0x00,
kExprElse,
kExprI32Const, 0x00,
kExprEnd,
kExprBrIf, 0x00,
kExprUnreachable,
kExprEnd,
kExprUnreachable,
]);
builder.instantiate();