[libcxx-commits] [PATCH] D131682: [libcxx] [test] Fix max_size.pass.cpp for PowerPC targets

Amy Kwan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 11 07:35:04 PDT 2022


amyk created this revision.
amyk added reviewers: PowerPC, hubert.reinterpretcast, ldionne, Mordante, philnik, libc++.
amyk added projects: libc++, PowerPC.
Herald added subscribers: steven.zhang, shchenz, fedor.sergeev, nemanjai.
Herald added a project: All.
amyk requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

This patch fixes the `max_size.pass.cpp` test for PowerPC targets, depending on endianness.

We will exhibit the `full_size()` behaviour for little endian (where `__endian_factor = 2` ), 
and the `half_size()` behaviour for big endian (where `__endian_factor = 1`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131682

Files:
  libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp


Index: libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
===================================================================
--- libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
+++ libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -74,7 +74,13 @@
 #   else
   full_size();
 #   endif
-# elif defined(__powerpc__) || defined(__powerpc64__) || defined(__sparc64__)
+# elif defined(__powerpc__) || defined(__powerpc64__)
+#   ifdef __BIG_ENDIAN__
+  half_size();
+#   else
+  full_size();
+#   endif
+# elif defined(__sparc64__)
   half_size();
 # elif defined(_WIN32)
   full_size();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131682.451730.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220811/dac5e113/attachment.bin>


More information about the libcxx-commits mailing list