[libcxx-commits] [PATCH] D121515: [libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 12 03:23:20 PST 2022


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121515

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


Index: libcxx/test/support/test_macros.h
===================================================================
--- libcxx/test/support/test_macros.h
+++ libcxx/test/support/test_macros.h
@@ -394,6 +394,10 @@
 #  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
Index: libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
===================================================================
--- libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
+++ libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
@@ -86,7 +86,7 @@
     }
 }
 
-#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#ifndef TEST_HAS_NO_INCOMPLETE_RANGES
 void test_range_std_container() {
     {
     std::string str{"ABCDE"};
@@ -104,7 +104,7 @@
     assert(s.data() == str.data());
     }
 }
-#endif // _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#endif // TEST_HAS_NO_INCOMPLETE_RANGES
 
 int main(int, char**)
 {
@@ -112,9 +112,9 @@
   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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121515.414819.patch
Type: text/x-patch
Size: 1313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220312/7f162537/attachment.bin>


More information about the libcxx-commits mailing list