2022-09-21 13:28:42 +02:00
|
|
|
// Copyright 2022 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.
|
|
|
|
|
2024-03-30 09:54:35 +01:00
|
|
|
// Flags: --no-liftoff
|
2022-09-21 13:28:42 +02:00
|
|
|
|
|
|
|
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
|
|
|
|
|
|
|
|
let builder = new WasmModuleBuilder();
|
|
|
|
|
|
|
|
builder.addFunction('repro', kSig_v_v)
|
|
|
|
.exportFunc()
|
2022-11-22 09:57:37 -05:00
|
|
|
.addLocals(wasmRefNullType(kWasmStructRef), 1)
|
2022-09-21 13:28:42 +02:00
|
|
|
.addBody([
|
|
|
|
kExprI32Const, 0,
|
|
|
|
kExprIf, kWasmVoid,
|
|
|
|
kExprLoop, kWasmVoid,
|
|
|
|
kExprCallFunction, 0,
|
|
|
|
kExprLocalGet, 0,
|
|
|
|
kExprRefAsNonNull,
|
|
|
|
kExprLocalSet, 0,
|
|
|
|
kExprI32Const, 0,
|
|
|
|
kExprBrIf, 0,
|
|
|
|
kExprEnd,
|
|
|
|
kExprEnd,
|
|
|
|
]);
|
|
|
|
|
|
|
|
let instance = builder.instantiate();
|
|
|
|
instance.exports.repro();
|