[libcxx-commits] [libcxx] cfefee8 - [libc++][NFC] Remove TEST_HAS_NO_SPACESHIP_OPERATOR

Adrian Vogelsgesang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 9 16:33:18 PDT 2022


Author: Adrian Vogelsgesang
Date: 2022-08-09T16:32:54-07:00
New Revision: cfefee87c28e68b41147c00dff331e086bc15531

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

LOG: [libc++][NFC] Remove TEST_HAS_NO_SPACESHIP_OPERATOR

The corresponding _LIBCPP_HAS_NO_SPACESHIP_OPERATOR macro was already
removed in commit c0f87e8382

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

Added: 
    

Modified: 
    libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
    libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
    libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
    libcxx/test/support/test_macros.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
index 079a5e9b27748..7d0ddb3329840 100644
--- a/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
+++ b/libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
@@ -43,23 +43,19 @@ void test_signatures() {
   ASSERT_NOEXCEPT(Eq > 0);
   ASSERT_NOEXCEPT(0 >= Eq);
   ASSERT_NOEXCEPT(Eq >= 0);
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   ASSERT_NOEXCEPT(0 <=> Eq);
   ASSERT_NOEXCEPT(Eq <=> 0);
   ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::partial_ordering);
   ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::partial_ordering);
-#endif
 }
 
 constexpr void test_equality() {
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   auto& PartialEq = std::partial_ordering::equivalent;
   auto& WeakEq = std::weak_ordering::equivalent;
   assert(PartialEq == WeakEq);
 
   auto& StrongEq = std::strong_ordering::equal;
   assert(PartialEq == StrongEq);
-#endif
 }
 
 constexpr bool test_constexpr() {
@@ -96,7 +92,6 @@ constexpr bool test_constexpr() {
     assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
     assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
   }
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   {
     std::partial_ordering res = (Eq <=> 0);
     ((void)res);
@@ -179,7 +174,6 @@ constexpr bool test_constexpr() {
   }
 
   test_equality();
-#endif
 
   return true;
 }

diff  --git a/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
index 822c4f2a0adf3..cefea50935152 100644
--- a/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
+++ b/libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
@@ -43,23 +43,19 @@ void test_signatures() {
   ASSERT_NOEXCEPT(Eq > 0);
   ASSERT_NOEXCEPT(0 >= Eq);
   ASSERT_NOEXCEPT(Eq >= 0);
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   ASSERT_NOEXCEPT(0 <=> Eq);
   ASSERT_NOEXCEPT(Eq <=> 0);
   ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_ordering);
   ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_ordering);
-#endif
 }
 
 constexpr void test_equality() {
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   auto& StrongEq = std::strong_ordering::equal;
   auto& PartialEq = std::partial_ordering::equivalent;
   assert(StrongEq == PartialEq);
 
   auto& WeakEq = std::weak_ordering::equivalent;
   assert(StrongEq == WeakEq);
-#endif
 }
 
 constexpr bool test_conversion() {
@@ -135,7 +131,6 @@ constexpr bool test_constexpr() {
     assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
     assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
   }
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   {
     std::strong_ordering res = (Eq <=> 0);
     ((void)res);
@@ -187,7 +182,6 @@ constexpr bool test_constexpr() {
   }
 
   test_equality();
-#endif
 
   return true;
 }

diff  --git a/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
index a0537914b79b9..d538898a126aa 100644
--- a/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
+++ b/libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
@@ -42,12 +42,10 @@ void test_signatures() {
   ASSERT_NOEXCEPT(Eq > 0);
   ASSERT_NOEXCEPT(0 >= Eq);
   ASSERT_NOEXCEPT(Eq >= 0);
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   ASSERT_NOEXCEPT(0 <=> Eq);
   ASSERT_NOEXCEPT(Eq <=> 0);
   ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_ordering);
   ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_ordering);
-#endif
 }
 
 constexpr bool test_conversion() {
@@ -72,14 +70,12 @@ constexpr bool test_conversion() {
 }
 
 constexpr void test_equality() {
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   auto& WeakEq = std::weak_ordering::equivalent;
   auto& PartialEq = std::partial_ordering::equivalent;
   assert(WeakEq == PartialEq);
 
   auto& StrongEq = std::strong_ordering::equal;
   assert(WeakEq == StrongEq);
-#endif
 }
 
 constexpr bool test_constexpr() {
@@ -114,7 +110,6 @@ constexpr bool test_constexpr() {
     assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq));
     assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq));
   }
-#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR
   {
     std::weak_ordering res = (Eq <=> 0);
     ((void)res);
@@ -169,7 +164,6 @@ constexpr bool test_constexpr() {
   }
 
   test_equality();
-#endif
 
   return true;
 }

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 89fa90fa8ceee..e8539cbe6d338 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -209,11 +209,6 @@
 #define TEST_CONSTINIT
 #endif
 
-#if !defined(__cpp_impl_three_way_comparison) \
-    && (!defined(_MSC_VER) || defined(__clang__) || _MSC_VER < 1920 || _MSVC_LANG <= 201703L)
-#define TEST_HAS_NO_SPACESHIP_OPERATOR
-#endif
-
 #if TEST_STD_VER < 11
 #define ASSERT_NOEXCEPT(...)
 #define ASSERT_NOT_NOEXCEPT(...)


        


More information about the libcxx-commits mailing list