Commit 34bc3cb4 authored by Jaideep Bajwa's avatar Jaideep Bajwa Committed by Commit Bot

[cctest] fix CustomSnapshotDataBlobSharedArrayBuffer on Big Endian

When accessing the buffer in 1 byte increments, the order should
be reversed for BE.

R=petermarshall@chromium.org, yangguo@chromium.org
BUG=
LOG=N

Change-Id: I27a57e12479d1c00488546a92428b9183d87f8bf
Reviewed-on: https://chromium-review.googlesource.com/667902Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#48031}
parent aada6a3a
...@@ -747,10 +747,22 @@ TEST(CustomSnapshotDataBlobSharedArrayBuffer) { ...@@ -747,10 +747,22 @@ TEST(CustomSnapshotDataBlobSharedArrayBuffer) {
"var x = new Int32Array([12, 24, 48, 96]);" "var x = new Int32Array([12, 24, 48, 96]);"
"var y = new Uint8Array(x.buffer)"; "var y = new Uint8Array(x.buffer)";
Int32Expectations expectations = { Int32Expectations expectations = {
std::make_tuple("x[0]", 12), std::make_tuple("x[1]", 24), std::make_tuple("x[0]", 12),
std::make_tuple("y[0]", 12), std::make_tuple("y[1]", 0), std::make_tuple("x[1]", 24),
std::make_tuple("y[2]", 0), std::make_tuple("y[3]", 0), #if !V8_TARGET_BIG_ENDIAN
std::make_tuple("y[4]", 24)}; std::make_tuple("y[0]", 12),
std::make_tuple("y[1]", 0),
std::make_tuple("y[2]", 0),
std::make_tuple("y[3]", 0),
std::make_tuple("y[4]", 24)
#else
std::make_tuple("y[3]", 12),
std::make_tuple("y[2]", 0),
std::make_tuple("y[1]", 0),
std::make_tuple("y[0]", 0),
std::make_tuple("y[7]", 24)
#endif
};
TypedArrayTestHelper(code, expectations); TypedArrayTestHelper(code, expectations);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment