[libcxx] [test] Fix max_size.pass.cpp for PowerPC targets
authorAmy Kwan <amy.kwan1@ibm.com>
Thu, 11 Aug 2022 20:53:43 +0000 (15:53 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Fri, 12 Aug 2022 02:39:29 +0000 (21:39 -0500)
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

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

index 0f7e17c..3f3ed5b 100644 (file)
@@ -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();