nodejs/deps/v8/test/mjsunit/regress/wasm/regress-1523313.js
Michaël Zasso 918fe04351
deps: update V8 to 13.6.233.8
PR-URL: https://github.com/nodejs/node/pull/58070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-05-02 15:06:53 +02:00

24 lines
816 B
JavaScript

// Copyright 2024 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: --no-liftoff
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
const builder = new WasmModuleBuilder();
// Generate function 1 (out of 1).
builder.addFunction(undefined, makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]))
.addBodyWithEnd([
// signature: i_iii
// body:
kExprLoop, 0x7f, // loop @1 i32
kExprF64Const, 0x10, 0x1f, 0x2b, 0xb9, 0x57, 0x7b, 0x78, 0x6a, // f64.const
kExprI32SConvertF64, // i32.trunc_f64_s
kExprEnd, // end @13
kExprEnd, // end @14
]);
builder.addExport('main', 0);
const instance = builder.instantiate();
assertTraps(kTrapFloatUnrepresentable, () => instance.exports.main(1, 2, 3));