[libcxx] r351148 - [test] Fix logic error in <compare> tests; enable for MSVC Dev16

Casey Carter Casey at Carter.net
Mon Jan 14 17:53:12 PST 2019


Author: caseycarter
Date: Mon Jan 14 17:53:12 2019
New Revision: 351148

URL: http://llvm.org/viewvc/llvm-project?rev=351148&view=rev
Log:
[test] Fix logic error in <compare> tests; enable for MSVC Dev16

Submitted upstream as https://reviews.llvm.org/D53763.

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

Modified: libcxx/trunk/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp?rev=351148&r1=351147&r2=351148&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp (original)
+++ libcxx/trunk/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp Mon Jan 14 17:53:12 2019
@@ -130,7 +130,7 @@ constexpr bool test_constexpr() {
   };
   for (auto TC : SpaceshipTestCases)
   {
-    std::partial_ordering Res = (0 <=> TC.Value);
+    std::partial_ordering Res = (TC.Value <=> 0);
     switch (TC.Expect) {
     case ER_Equiv:
       assert(Res == 0);

Modified: libcxx/trunk/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp?rev=351148&r1=351147&r2=351148&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp (original)
+++ libcxx/trunk/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp Mon Jan 14 17:53:12 2019
@@ -185,7 +185,7 @@ constexpr bool test_constexpr() {
   };
   for (auto TC : SpaceshipTestCases)
   {
-    std::strong_ordering Res = (0 <=> TC.Value);
+    std::strong_ordering Res = (TC.Value <=> 0);
     switch (TC.Expect) {
     case ER_Equiv:
       assert(Res == 0);

Modified: libcxx/trunk/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp?rev=351148&r1=351147&r2=351148&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp (original)
+++ libcxx/trunk/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp Mon Jan 14 17:53:12 2019
@@ -142,7 +142,7 @@ constexpr bool test_constexpr() {
   };
   for (auto TC : SpaceshipTestCases)
   {
-    std::weak_ordering Res = (0 <=> TC.Value);
+    std::weak_ordering Res = (TC.Value <=> 0);
     switch (TC.Expect) {
     case ER_Equiv:
       assert(Res == 0);

Modified: libcxx/trunk/test/support/test_macros.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=351148&r1=351147&r2=351148&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Mon Jan 14 17:53:12 2019
@@ -210,8 +210,9 @@
 
 // FIXME: Fix this feature check when either (A) a compiler provides a complete
 // implementation, or (b) a feature check macro is specified
+#if !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(...)




More information about the libcxx-commits mailing list