From a8005a6475b14024bd9da632763fc157193ae432 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Tue, 7 Mar 2023 18:57:42 -0300 Subject: [PATCH] Tentatively fix s390x test --- src/test-interp.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test-interp.cc b/src/test-interp.cc index 11e4770fca..614eed3362 100644 --- a/src/test-interp.cc +++ b/src/test-interp.cc @@ -505,8 +505,13 @@ TEST_F(InterpTest, Rot13) { EXPECT_LT(ptr + size, memory->ByteSize()); +#if WABT_BIG_ENDIAN + std::copy(string_data.rbegin(), string_data.rbegin() + size, + memory->UnsafeData() + memory->ByteSize() - ptr - size); +#else std::copy(string_data.begin(), string_data.begin() + size, memory->UnsafeData() + ptr); +#endif results[0].Set(size); return Result::Ok; @@ -527,8 +532,14 @@ TEST_F(InterpTest, Rot13) { EXPECT_LT(ptr + size, memory->ByteSize()); string_data.resize(size); +#if WABT_BIG_ENDIAN + std::copy(memory->UnsafeData() + memory->ByteSize() - ptr - size, + memory->UnsafeData() + memory->ByteSize() - ptr, + string_data.rbegin()); +#else std::copy(memory->UnsafeData() + ptr, memory->UnsafeData() + ptr + size, string_data.begin()); +#endif return Result::Ok; };