summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/wasm/asm-wasm.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-12-23 16:30:57 +0100
committerMichaël Zasso <targos@protonmail.com>2017-01-26 22:46:17 +0100
commit2739185b790e040c3b044c577327f5d44bffad4a (patch)
tree29a466999212f4c85958379d9d400eec8a185ba5 /deps/v8/test/mjsunit/wasm/asm-wasm.js
parenta67a04d7654faaa04c8da00e42981ebc9fd0911c (diff)
downloadnode-new-2739185b790e040c3b044c577327f5d44bffad4a.tar.gz
deps: update V8 to 5.5.372.40
PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/test/mjsunit/wasm/asm-wasm.js')
-rw-r--r--deps/v8/test/mjsunit/wasm/asm-wasm.js88
1 files changed, 88 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/wasm/asm-wasm.js b/deps/v8/test/mjsunit/wasm/asm-wasm.js
index a580c5c7e9..dc8ecff7a0 100644
--- a/deps/v8/test/mjsunit/wasm/asm-wasm.js
+++ b/deps/v8/test/mjsunit/wasm/asm-wasm.js
@@ -988,6 +988,7 @@ function TestFunctionTable(stdlib, foreign, buffer) {
return {caller:caller};
}
+print("TestFunctionTable...");
var module = TestFunctionTable(stdlib);
assertEquals(55, module.caller(0, 0, 33, 22));
assertEquals(11, module.caller(0, 1, 33, 22));
@@ -1040,6 +1041,7 @@ function TestForeignFunctions() {
assertEquals(103, module.caller(23, 103));
}
+print("TestForeignFunctions...");
TestForeignFunctions();
@@ -1581,3 +1583,89 @@ function TestLoopsWithUnsigned() {
}
assertWasm(323, TestLoopsWithUnsigned);
+
+
+function TestSingleFunctionModule() {
+ "use asm";
+ function add(a, b) {
+ a = a | 0;
+ b = b | 0;
+ return (a + b) | 0;
+ }
+ return add;
+}
+
+assertEquals(7, TestSingleFunctionModule()(3, 4));
+
+
+function TestNotZero() {
+ "use asm";
+ function caller() {
+ if (!0) {
+ return 44;
+ } else {
+ return 55;
+ }
+ return 0;
+ }
+ return {caller: caller};
+}
+
+assertWasm(44, TestNotZero);
+
+
+function TestNotOne() {
+ "use asm";
+ function caller() {
+ if (!1) {
+ return 44;
+ } else {
+ return 55;
+ }
+ return 0;
+ }
+ return {caller: caller};
+}
+
+assertWasm(55, TestNotOne);
+
+
+function TestDotfulFloat(stdlib) {
+ "use asm";
+ var fround = stdlib.Math.fround;
+ var foo = fround(55.0);
+ function caller() {
+ return +foo;
+ }
+ return {caller: caller};
+}
+
+assertWasm(55, TestDotfulFloat);
+
+
+function TestDotlessFloat(stdlib) {
+ "use asm";
+ var fround = stdlib.Math.fround;
+ var foo = fround(55);
+ function caller() {
+ return +foo;
+ }
+ return {caller: caller};
+}
+
+assertWasm(55, TestDotlessFloat);
+
+
+function TestFloatGlobals(stdlib) {
+ "use asm";
+ var fround = stdlib.Math.fround;
+ var foo = fround(1.25);
+ function caller() {
+ foo = fround(foo + fround(1.0));
+ foo = fround(foo + fround(1.0));
+ return +foo;
+ }
+ return {caller: caller};
+}
+
+assertWasm(3.25, TestFloatGlobals);