aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Carter <Casey@Carter.net>2019-01-15 01:53:12 +0000
committerCasey Carter <Casey@Carter.net>2019-01-15 01:53:12 +0000
commitdcaaa1baed3745c3f53ded4cc2ee1f2d578c6f67 (patch)
tree43d28f5aeed9a6bbf3dc1a9accb106dd1206cd2d
parent1b9337f16b7197758a61e7039cd82a91cdf1a168 (diff)
[test] Fix logic error in <compare> tests; enable for MSVC Dev16
Submitted upstream as https://reviews.llvm.org/D53763. llvm-svn: 351148
-rw-r--r--libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp2
-rw-r--r--libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp2
-rw-r--r--libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp2
-rw-r--r--libcxx/test/support/test_macros.h3
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 a80477151ef2..4ea823499b5e 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 0bdd68679b44..94668ab7c47c 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 0a52680323b2..067f378e0bfd 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 88cc4d5cacc3..997555296793 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(...)