Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: test/mjsunit/wasm/asm-wasm.js

Issue 1722473002: Allow intish and floatish to be coerced by heap assignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/asm-wasm.js
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js
index 91766eca5343143a00de9db31662a3a770be1c77..3f936f5f211db0fcc7a14d2b033a83f66969316a 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1313,3 +1313,40 @@ TestForeignVariables();
var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
assertEquals(1, m.func());
})();
+
+
+(function TestIntishAssignment() {
+ function Module(stdlib, foreign, heap) {
+ "use asm";
+ var HEAP32 = new stdlib.Int32Array(heap);
+ function func() {
+ var a = 1;
+ var b = 2;
+ HEAP32[0] = a + b;
+ return HEAP32[0] | 0;
+ }
+ return {func: func};
+ }
+
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
+ assertEquals(3, m.func());
+})();
+
+
+(function TestFloatishAssignment() {
+ function Module(stdlib, foreign, heap) {
+ "use asm";
+ var HEAPF32 = new stdlib.Float32Array(heap);
+ var fround = stdlib.Math.fround;
+ function func() {
+ var a = fround(1.0);
+ var b = fround(2.0);
+ HEAPF32[0] = a + b;
+ return +HEAPF32[0];
+ }
+ return {func: func};
+ }
+
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
+ assertEquals(3, m.func());
+}) // TODO(bradnelson): Enable when Math.fround implementation lands.
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698