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

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

Issue 2397823003: [wasm] [asm.js] Fix asm.js issues around floating point globals. (Closed)
Patch Set: Fix Created 4 years, 2 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/asmjs/test-asm-typer.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 b1e73c1edabd1f0c38f5fffe899d1ebcdf9f9a75..dc8ecff7a01f7beee787f14af709b2dff6c8822a 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1628,3 +1628,44 @@ function TestNotOne() {
}
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);
« no previous file with comments | « test/cctest/asmjs/test-asm-typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698