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

Unified Diff: test/mjsunit/asm/uint32mod.js

Issue 2663243002: [asm] Fix lots of invalid asm.js tests (Closed)
Patch Set: Rebase Created 3 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/mjsunit/asm/uint32div.js ('k') | test/mjsunit/asm/uint32mod-constant.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/uint32mod.js
diff --git a/test/mjsunit/asm/uint32mod.js b/test/mjsunit/asm/uint32mod.js
index fa40507c7f746a27ea6f7ef020836023b64a87ee..137e64d7f91ab8f24b5f6ea7092f8ba9571b2fd8 100644
--- a/test/mjsunit/asm/uint32mod.js
+++ b/test/mjsunit/asm/uint32mod.js
@@ -9,9 +9,9 @@ var heap = new ArrayBuffer(64 * 1024);
var mod = (function Module(stdlib, foreign, heap) {
"use asm";
function mod(dividend, divisor) {
- dividend = dividend >>> 0;
- divisor = divisor >>> 0;
- return (dividend % divisor) >>> 0;
+ dividend = dividend | 0;
+ divisor = divisor | 0;
+ return ((dividend >>> 0) % (divisor >>> 0)) | 0;
}
return { mod: mod };
})(stdlib, foreign, heap).mod;
@@ -20,6 +20,6 @@ var divisors = [0, 1, 3, 4, 10, 42, 64, 100, 1024, 2147483647, 4294967295];
for (var i in divisors) {
var divisor = divisors[i];
for (var dividend = 0; dividend < 4294967296; dividend += 3999773) {
- assertEquals((dividend % divisor) >>> 0, mod(dividend, divisor));
+ assertEquals((dividend % divisor) | 0, mod(dividend, divisor));
}
}
« no previous file with comments | « test/mjsunit/asm/uint32div.js ('k') | test/mjsunit/asm/uint32mod-constant.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698