[libcxx-commits] [libcxx] e2e9e2c - [libcxx] [test] Fix max_size.pass.cpp for PowerPC targets

Amy Kwan via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 11 19:39:36 PDT 2022


Author: Amy Kwan
Date: 2022-08-11T21:39:29-05:00
New Revision: e2e9e2ce8efd12f0f2b7a12be113d4241706ddf2

URL: https://github.com/llvm/llvm-project/commit/e2e9e2ce8efd12f0f2b7a12be113d4241706ddf2
DIFF: https://github.com/llvm/llvm-project/commit/e2e9e2ce8efd12f0f2b7a12be113d4241706ddf2.diff

LOG: [libcxx] [test] Fix max_size.pass.cpp for PowerPC targets

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).

Differential Revision: https://reviews.llvm.org/D131682

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
index 0f7e17cb4ab7f..3f3ed5baf1f4a 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -74,7 +74,13 @@ bool test() {
 #   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();


        


More information about the libcxx-commits mailing list