[llvm-branch-commits] [libcxx] ab09289 - [libcxx] [test] Fix max_size.pass.cpp for PowerPC targets

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 15 00:32:38 PDT 2022


Author: Amy Kwan
Date: 2022-08-15T09:31:19+02:00
New Revision: ab09289dbf1d08db83e16314cf425d25c0138e66

URL: https://github.com/llvm/llvm-project/commit/ab09289dbf1d08db83e16314cf425d25c0138e66
DIFF: https://github.com/llvm/llvm-project/commit/ab09289dbf1d08db83e16314cf425d25c0138e66.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

(cherry picked from commit e2e9e2ce8efd12f0f2b7a12be113d4241706ddf2)

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 llvm-branch-commits mailing list