• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Flags: --expose-wasm
6
7load("test/mjsunit/wasm/wasm-constants.js");
8load("test/mjsunit/wasm/wasm-module-builder.js");
9
10(function BasicTest() {
11  var kReturnValue = 107;
12  var builder = new WasmModuleBuilder();
13
14  builder.addFunction("main", kSig_i_i)
15    .addBody([kExprI8Const, kReturnValue])
16    .exportFunc();
17
18  var main = builder.instantiate().exports.main;
19  assertEquals(kReturnValue, main());
20})();
21