2020-07-13 10:39:42 +02:00
|
|
|
// Copyright 2020 the V8 project authors. All rights reserved.
|
2022-09-21 13:28:42 +02:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2020-07-13 10:39:42 +02:00
|
|
|
|
|
|
|
// Flags: --wasm-staging
|
|
|
|
|
2021-08-29 14:20:49 +02:00
|
|
|
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
|
2020-07-13 10:39:42 +02:00
|
|
|
|
|
|
|
const builder = new WasmModuleBuilder();
|
2023-10-05 08:46:07 +02:00
|
|
|
builder.addMemory(16, 32, true);
|
2020-07-13 10:39:42 +02:00
|
|
|
const sig = builder.addType(makeSig(
|
|
|
|
[kWasmI32, kWasmI32, kWasmI32, kWasmI32, kWasmI32, kWasmI32, kWasmI32],
|
|
|
|
[]));
|
|
|
|
builder.addFunction(undefined, sig).addBodyWithEnd([
|
|
|
|
// signature: v_iiiiifidi
|
|
|
|
// body:
|
|
|
|
kExprI32Const, 0x00, // i32.const
|
|
|
|
kExprI64Const, 0x00, // i64.const
|
2024-03-30 09:54:35 +01:00
|
|
|
kAtomicPrefix, kExprI64AtomicStore, 0x03, 0x00, // i64.atomic.store64
|
2020-07-13 10:39:42 +02:00
|
|
|
kExprEnd, // end @9
|
|
|
|
]);
|
|
|
|
builder.addExport('main', 0);
|
|
|
|
assertDoesNotThrow(() => builder.instantiate());
|