[libcxx-commits] [libcxx] 0e2fb8a - [libc++] Refactor max_size.pass.cpp
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 4 11:05:43 PDT 2022
Author: Louis Dionne
Date: 2022-05-04T11:05:29-07:00
New Revision: 0e2fb8ac84bd033450a828409671390a5b6430ac
URL: https://github.com/llvm/llvm-project/commit/0e2fb8ac84bd033450a828409671390a5b6430ac
DIFF: https://github.com/llvm/llvm-project/commit/0e2fb8ac84bd033450a828409671390a5b6430ac.diff
LOG: [libc++] Refactor max_size.pass.cpp
Reorganize the test and simplify the #ifdefs. Fix a typo in __powerpc64__
as a fly-by, and also add a test for the unstable ABI.
Differential Revision: https://reviews.llvm.org/D124403
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 80e9c2d476f69..0468e785ec7a8 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
@@ -65,48 +65,28 @@ void half_size() {
}
bool test() {
-#if _LIBCPP_ABI_VERSION == 1
-#ifdef __APPLE__
-
-# ifdef __aarch64__
- half_size();
-# elif defined(__x86_64__)
- full_size();
-# else
-# error "Your target system seems to be unsupported."
-# endif
-#elif defined(__linux__)
+#if _LIBCPP_ABI_VERSION == 1
-# ifdef __x86_64__
+# if defined(__x86_64__)
full_size();
-# elif defined(__arm__) || defined(__aarch64__)
-# ifdef __BIG_ENDIAN__
+# elif defined(__APPLE__) && defined(__aarch64__)
half_size();
-# else
- full_size();
-# endif
-
-# else
-# error "Your target system seems to be unsupported."
-# endif
-
-#elif defined(__powerpc__)
+# elif defined(__arm__) || defined(__aarch64__)
+# ifdef __BIG_ENDIAN__
half_size();
-#elif defined(__powepc64__)
- half_size();
-
-#elif defined(_WIN64)
-
-# ifdef __x86_64__
+# else
full_size();
-# else
-# error "Your target system seems to be unsupported."
-# endif
+# endif
+# elif defined(__powerpc__) || defined(__powerpc64__)
+ half_size();
+# else
+# error "Your target system seems to be unsupported."
+# endif
#else
-# error "Your target system seems to be unsupported."
-#endif
+
+ half_size();
#endif
More information about the libcxx-commits
mailing list