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

Unified Diff: test/mjsunit/asm/int32array-constant-key.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/int32-umod.js ('k') | test/mjsunit/asm/int32array-negative-offset.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/int32array-constant-key.js
diff --git a/test/mjsunit/asm/int32array-constant-key.js b/test/mjsunit/asm/int32array-constant-key.js
index bb5b65062e8b11159a18186d4e567b89af377636..49eabccb9a780e5585a92ab4eebc1f58bfbfe3cc 100644
--- a/test/mjsunit/asm/int32array-constant-key.js
+++ b/test/mjsunit/asm/int32array-constant-key.js
@@ -6,28 +6,34 @@ function Module(stdlib, foreign, heap) {
"use asm";
var MEM32 = new stdlib.Int32Array(heap);
function loadm4194304() {
- return MEM32[-4194304];
+ var i = -4194304 << 2;
+ return MEM32[i >> 2] | 0;
}
function loadm0() {
- return MEM32[-0];
+ return MEM32[-0] | 0;
}
function load0() {
- return MEM32[0];
+ return MEM32[0] | 0;
}
function load4() {
- return MEM32[4];
+ return MEM32[4] | 0;
}
function storem4194304(v) {
- MEM32[-4194304] = v;
+ v = v | 0;
+ var i = -4194304 << 2;
+ MEM32[i >> 2] = v;
}
function storem0(v) {
+ v = v | 0;
MEM32[-0] = v;
}
function store0(v) {
- MEM32[0] = v;
+ v = v | 0;
+ MEM32[0 >> 2] = v;
}
function store4(v) {
- MEM32[4] = v;
+ v = v | 0;
+ MEM32[(4 << 2) >> 2] = v;
}
return { loadm4194304: loadm4194304, storem4194304: storem4194304,
loadm0: loadm0, storem0: storem0, load0: load0, store0: store0,
@@ -36,27 +42,27 @@ function Module(stdlib, foreign, heap) {
var m = Module(this, {}, new ArrayBuffer(4));
-assertEquals(undefined, m.loadm4194304());
+assertEquals(0, m.loadm4194304());
assertEquals(0, m.loadm0());
assertEquals(0, m.load0());
-assertEquals(undefined, m.load4());
+assertEquals(0, m.load4());
m.storem4194304(123456789);
-assertEquals(undefined, m.loadm4194304());
+assertEquals(0, m.loadm4194304());
assertEquals(0, m.loadm0());
assertEquals(0, m.load0());
-assertEquals(undefined, m.load4());
+assertEquals(0, m.load4());
m.storem0(987654321);
-assertEquals(undefined, m.loadm4194304());
+assertEquals(0, m.loadm4194304());
assertEquals(987654321, m.loadm0());
assertEquals(987654321, m.load0());
-assertEquals(undefined, m.load4());
+assertEquals(0, m.load4());
m.store0(0x12345678);
-assertEquals(undefined, m.loadm4194304());
+assertEquals(0, m.loadm4194304());
assertEquals(0x12345678, m.loadm0());
assertEquals(0x12345678, m.load0());
-assertEquals(undefined, m.load4());
+assertEquals(0, m.load4());
m.store4(43);
-assertEquals(undefined, m.loadm4194304());
+assertEquals(0, m.loadm4194304());
assertEquals(0x12345678, m.loadm0());
assertEquals(0x12345678, m.load0());
-assertEquals(undefined, m.load4());
+assertEquals(0, m.load4());
« no previous file with comments | « test/mjsunit/asm/int32-umod.js ('k') | test/mjsunit/asm/int32array-negative-offset.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698