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

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

Issue 1794303002: Fixing +fround(x) in asm typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 efe596d1afef5d64539feb5a64aa20b82d17b6d8..13a8c529c605a89069a16fb1013acedc5e78ad27 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1374,6 +1374,54 @@ TestForeignVariables();
})();
+(function TestAbsInt() {
+ function Module(stdlib) {
+ "use asm";
+ var abs = stdlib.Math.abs;
+ function func(x) {
+ x = x | 0;
+ return abs(x|0)|0;
+ }
+ return {func:func};
+ }
+ var m = Wasm.instantiateModuleFromAsm(Module.toString());
+ assertEquals(1, m.func(-1));
titzer 2016/03/14 09:48:39 Can you add a couple more input values, e.g. aroun
bradn 2016/03/14 17:07:31 Done. Actually, at this point I think I'm going t
+})();
+
+
+(function TestAbsFloat() {
+ function Module(stdlib) {
+ "use asm";
+ var fround = stdlib.Math.fround;
+ var abs = stdlib.Math.abs;
+ function func(x) {
+ x = fround(x);
+ x = abs(x);
+ return +x;
+ }
+ return {func:func};
+ }
+ var m = Wasm.instantiateModuleFromAsm(Module.toString());
+ assertEquals(1, m.func(-1));
+})();
+
+
+(function TestFloatAsDouble() {
+ function Module(stdlib) {
+ "use asm";
+ var fround = stdlib.Math.fround;
+ var abs = stdlib.Math.abs;
+ function func() {
+ var x = fround(1.0);
+ return +fround(x);
+ }
+ return {func:func};
+ }
+ var m = Wasm.instantiateModuleFromAsm(Module.toString());
+ assertEquals(1, m.func());
+})();
+
+
(function TestOr() {
function Module() {
"use asm";
« 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