From 93b7251f7482246e9f57ae118295452f4b38dd75 Mon Sep 17 00:00:00 2001 From: mtrofin Date: Wed, 17 Aug 2016 20:17:53 -0700 Subject: [PATCH] [wasm] binary and test for hosts' integration tests Ensure wasm binaries intended to be used in hosts of v8, such as chromium, are up to date. See https://codereview.chromium.org/2255673003/ BUG=v8:5072 Review-Url: https://codereview.chromium.org/2259693002 Cr-Commit-Position: refs/heads/master@{#38694} --- .../wasm/ensure-wasm-binaries-up-to-date.js | 18 ++++++++++++++++++ test/mjsunit/wasm/incrementer.wasm | Bin 0 -> 66 bytes 2 files changed, 18 insertions(+) create mode 100644 test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js create mode 100644 test/mjsunit/wasm/incrementer.wasm diff --git a/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js b/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js new file mode 100644 index 0000000000..02336f7c94 --- /dev/null +++ b/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js @@ -0,0 +1,18 @@ +// 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. + +// Flags: --expose-wasm + +// Ensure checked in wasm binaries used by integration tests from v8 hosts +// (such as chromium) are up to date. + +load('test/mjsunit/mjsunit.js'); + +(function ensure_incrementer() { + var buff = readbuffer("test/mjsunit/wasm/incrementer.wasm"); + var mod = new WebAssembly.Module(buff); + var inst = new WebAssembly.Instance(mod); + var inc = inst.exports.increment; + assertEquals(3, inc(2)); +}()) diff --git a/test/mjsunit/wasm/incrementer.wasm b/test/mjsunit/wasm/incrementer.wasm new file mode 100644 index 0000000000000000000000000000000000000000..f80f7ad5975b087d1e226c8103899ac9a6095d14 GIT binary patch literal 66 zcmZQbEY9U-U|?V=sVqokV{~8y0*