[libcxx-commits] [libcxx] e72cedc - [libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 16 09:42:55 PDT 2022


Author: Mark de Wever
Date: 2022-03-16T17:42:48+01:00
New Revision: e72cedcb0119cd60ffdada433a7cc6394621ba47

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

LOG: [libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES.

This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, ldionne

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

Added: 
    

Modified: 
    libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
    libcxx/test/support/test_macros.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp b/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
index 472776a75fdda..adf928dadc5f7 100644
--- a/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
+++ b/libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
@@ -85,7 +85,7 @@ void test_std_array() {
     }
 }
 
-#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#ifndef TEST_HAS_NO_INCOMPLETE_RANGES
 void test_range_std_container() {
     {
     std::string str{"ABCDE"};
@@ -103,7 +103,7 @@ void test_range_std_container() {
     assert(s.data() == str.data());
     }
 }
-#endif // _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#endif // TEST_HAS_NO_INCOMPLETE_RANGES
 
 int main(int, char**)
 {
@@ -111,9 +111,9 @@ int main(int, char**)
   test_c_array();
   test_std_array();
 
-#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#ifndef TEST_HAS_NO_INCOMPLETE_RANGES
   test_range_std_container();
-#endif // _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#endif // TEST_HAS_NO_INCOMPLETE_RANGES
 
   return 0;
 }

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 130f3d4f0a948..0ac4867c89829 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -394,6 +394,10 @@ inline void DoNotOptimize(Tp const& value) {
 #  define TEST_HAS_NO_FGETPOS_FSETPOS
 #endif
 
+#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#  define TEST_HAS_NO_INCOMPLETE_RANGES
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif


        


More information about the libcxx-commits mailing list