2017-03-21 10:16:54 +01:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
2021-08-29 14:20:49 +02:00
|
|
|
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
|
2017-03-21 10:16:54 +01:00
|
|
|
|
|
|
|
var builder = new WasmModuleBuilder();
|
2020-03-05 10:49:19 -08:00
|
|
|
// Add a dummy function to make the main function index 1.
|
|
|
|
builder.addFunction('dummy', kSig_i_v)
|
|
|
|
.addBody([kExprI32Const, 0]);
|
2017-03-21 10:16:54 +01:00
|
|
|
builder.addFunction('main', kSig_i_v)
|
|
|
|
.addBody([kExprI32Const, 2, kExprI32Const, 0, kExprI32DivU])
|
|
|
|
.exportFunc();
|
|
|
|
var module = builder.instantiate();
|
|
|
|
module.exports.main();
|