regress-922670.js 853 Bytes
Newer Older
1 2 3 4
// Copyright 2019 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.

5
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
6 7 8 9

const builder = new WasmModuleBuilder();
const sig = builder.addType(makeSig([kWasmI32], []));
builder.addFunction(undefined, sig)
10
  .addLocals(kWasmI64, 1)
11 12
  .addBody([
    kExprLoop, kWasmI32,
13
      kExprLocalGet, 1,
14 15
      kExprI64Const, 1,
      kExprLoop, kWasmI32,
16
        kExprLocalGet, 0,
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
        kExprI32Const, 1,
        kExprI32Const, 1,
        kExprIf, kWasmI32,
          kExprI32Const, 1,
        kExprElse,
          kExprUnreachable,
          kExprEnd,
        kExprSelect,
        kExprUnreachable,
        kExprEnd,
      kExprUnreachable,
      kExprEnd,
    kExprUnreachable
]);
builder.instantiate();