diff options
author | Casey Carter <Casey@Carter.net> | 2019-01-15 01:53:12 +0000 |
---|---|---|
committer | Casey Carter <Casey@Carter.net> | 2019-01-15 01:53:12 +0000 |
commit | 3358f0b2d9b26f135b7f17d0ff24b3f3bacc000e (patch) | |
tree | d589bb2bd1f0ee9090fafda6d819228fff9d14e9 | |
parent | 1b9c7ed3e3aaeb090938b377b872abbd86ce476c (diff) |
[test] Fix logic error in <compare> tests; enable for MSVC Dev16
Submitted upstream as https://reviews.llvm.org/D53763.
4 files changed, 5 insertions, 4 deletions
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 a80477151ef..4ea823499b5 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 @@ -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); 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 0bdd68679b4..94668ab7c47 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 @@ -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); 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 0a52680323b..067f378e0bf 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 @@ -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); diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 88cc4d5cacc..99755529679 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -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(...) |