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

Unified Diff: test/mjsunit/compiler/regress-694088.js

Issue 2739403002: [turbofan] Fix regress-694088.js for big endian. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/regress-694088.js
diff --git a/test/mjsunit/compiler/regress-694088.js b/test/mjsunit/compiler/regress-694088.js
index 42817092a0cf14e3710d23fac973093c02224d8e..03c7a389ee008983fe0144098fb3535725e7aa65 100644
--- a/test/mjsunit/compiler/regress-694088.js
+++ b/test/mjsunit/compiler/regress-694088.js
@@ -2,6 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+function is_little_endian() {
+ var buffer = new ArrayBuffer(4);
+ HEAP32 = new Int32Array(buffer);
+ HEAPU8 = new Uint8Array(buffer);
+ HEAP32[0] = 255;
+ if (HEAPU8[0] === 255 && HEAPU8[3] === 0)
+ return true;
+ else
+ return false;
+}
+
(function () {
var buffer = new ArrayBuffer(8);
var i32 = new Int32Array(buffer);
@@ -10,7 +21,10 @@
function foo() {
f64[0] = 1;
var x = f64[0];
- return i32[0];
+ if (is_little_endian())
+ return i32[0];
+ else
+ return i32[1];
}
assertEquals(0, foo());
})();
@@ -21,9 +35,12 @@
var i32 = new Int32Array(buffer);
function foo() {
- i32[0] = 0x10001;
+ i32[0] = 0x20001;
var x = i32[0];
- return i16[0];
+ if (is_little_endian())
+ return i16[0];
+ else
+ return i16[1];
}
assertEquals(1, foo());
})();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698