[wasm][memory64] Fix endianness issue on Load cctest

`0x12345678` will be written to memory in the same order on BE
machines however, as Wasm is LE enforced, a memory load will
force a byte reverse operation on BE machines which changes the value.

To fix the problem, we write the reversed value to memory.

Change-Id: I0d562768d5cef823cb918ed1b57a2a41e404ffc6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2622927
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72041}
This commit is contained in:
Milad Fa 2021-01-11 14:21:09 -05:00 committed by Commit Bot
parent 9a6a22874c
commit be5738a8d4

View File

@ -34,7 +34,11 @@ WASM_EXEC_TEST(Load) {
CHECK_EQ(0, r.Call(0));
#if V8_TARGET_BIG_ENDIAN
memory[0] = 0x78563412;
#else
memory[0] = 0x12345678;
#endif
CHECK_EQ(0x12345678, r.Call(0));
CHECK_EQ(0x123456, r.Call(1));
CHECK_EQ(0x1234, r.Call(2));