-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libcxx][test] Use long double test macro in strong_order.pass.cpp #106742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: David Spickett (DavidSpickett) ChangesFull diff: https://github.com/llvm/llvm-project/pull/106742.diff 1 Files Affected:
diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order.pass.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order.pass.cpp
index ac6b6879f77309..1503f8d9a721c8 100644
--- a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order.pass.cpp
+++ b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order.pass.cpp
@@ -454,12 +454,16 @@ int main(int, char**)
test_1_2();
test_1_3<float>();
test_1_3<double>();
- // test_1_3<long double>(); // UNIMPLEMENTED
+#ifdef TEST_LONG_DOUBLE_IS_DOUBLE
+ test_1_3<long double>(); // UNIMPLEMENTED for 16 byte long double
+#endif
test_1_4();
static_assert(test_1_3<float>());
static_assert(test_1_3<double>());
- // static_assert(test_1_3<long double>()); // UNIMPLEMENTED
+#ifdef TEST_LONG_DOUBLE_IS_DOUBLE
+ static_assert(test_1_3<long double>()); // UNIMPLEMENTED for 16 byte long double
+#endif
static_assert(test_1_4());
return 0;
|
@frederick-vs-ja is this what you meant? I left the UNIMPLEMENTED comment there because it seems useful to know that there is a feature gap there, as opposed to it being some completely invalid construct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM but I'd like @frederick-vs-ja to give final approval since his this PR originated from a comment he made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming the CI is green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The "16 byte" part in the comments is a bit imprecise as if long double
is of Intel 80-bit format and the platform is 32-bit, sizeof(long dobule)
is usually 12. But I think we can improve this later.
Well, "> 8 bytes" would cover that right? |
Ah, no it's just when long double is a distinct type. Whatever size that may be. I will update the comments. |
Only the [cmp.alg] part (for `comparison_meow_fallback` CPOs) in the paper required changes. Other parts merely fixed preconditions of some standard library functions. I strongly feel that P2167R3 should be a DR despite that it is not a DR officially: CPOs -> C++20; remain parts -> C++98/11 (except that _`boolean-testable`_ should be transformed into the original _BooleanTestable_ requirements in the old resolution of LWG2114). Note that P2167R3 damaged the resolution of LWG3465: the type of `F < E` was left underconstrained. I've tried to submit an LWG issue for this, which is now LWG4157. Drive-by change: - enable some test coverages in `compare_strong_order_fallback.pass.cpp` when `TEST_LONG_DOUBLE_IS_DOUBLE`, following up #106742 Closes #105241.
Only the [cmp.alg] part (for `comparison_meow_fallback` CPOs) in the paper required changes. Other parts merely fixed preconditions of some standard library functions. I strongly feel that P2167R3 should be a DR despite that it is not a DR officially: CPOs -> C++20; remain parts -> C++98/11 (except that _`boolean-testable`_ should be transformed into the original _BooleanTestable_ requirements in the old resolution of LWG2114). Note that P2167R3 damaged the resolution of LWG3465: the type of `F < E` was left underconstrained. I've tried to submit an LWG issue for this, which is now LWG4157. Drive-by change: - enable some test coverages in `compare_strong_order_fallback.pass.cpp` when `TEST_LONG_DOUBLE_IS_DOUBLE`, following up llvm#106742 Closes llvm#105241.
No description provided.