-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libcxx] Fix libcxx test, integral.pass.cpp #135355
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
Remove `strtoll` functions for testing i128/u128. Under AArch64, long long is defined as i64. When running the test integral.pass.cpp, it calls tries to call `strtoll`, which returns an i64, not an i128, therefore only keeping the lower 64 bits.
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-libcxx Author: William (saturn691) ChangesRemove Under AArch64, long long is defined as i64. When running the test integral.pass.cpp, it calls tries to call Full diff: https://github.com/llvm/llvm-project/pull/135355.diff 1 Files Affected:
diff --git a/libcxx/test/support/charconv_test_helpers.h b/libcxx/test/support/charconv_test_helpers.h
index fcae09478457b..89927df02e56d 100644
--- a/libcxx/test/support/charconv_test_helpers.h
+++ b/libcxx/test/support/charconv_test_helpers.h
@@ -19,7 +19,6 @@
#include <string.h>
#include <stdlib.h>
#include <type_traits>
-
#include "test_macros.h"
#if TEST_STD_VER < 11
@@ -163,15 +162,6 @@ struct to_chars_test_base
#ifndef TEST_HAS_NO_INT128
static TEST_CONSTEXPR_CXX23 __int128_t fromchars128_impl(char const* p, char const* ep, int base, true_type)
{
- if (!TEST_IS_CONSTANT_EVALUATED) {
- char* last;
- __int128_t r = strtoll(p, &last, base);
- if(errno != ERANGE) {
- assert(last == ep);
- return r;
- }
- }
-
// When the value doesn't fit in a long long use from_chars. This is
// not ideal since it does a round-trip test instead if using an
// external source.
@@ -185,15 +175,6 @@ struct to_chars_test_base
static TEST_CONSTEXPR_CXX23 __uint128_t fromchars128_impl(char const* p, char const* ep, int base, false_type)
{
- if (!TEST_IS_CONSTANT_EVALUATED) {
- char* last;
- __uint128_t r = strtoull(p, &last, base);
- if(errno != ERANGE) {
- assert(last == ep);
- return r;
- }
- }
-
__uint128_t r;
std::from_chars_result s = std::from_chars(p, ep, r, base);
assert(s.ec == std::errc{});
|
If the correct result would be larger than Could you please elaborate on the problem that you want to fix? |
This is not the case when tested with |
@saturn691 That sounds more like a picolibc bug than a libc++ one. |
@philnik777 I've double checked right now, errno = ERANGE = 34 under |
Closing, as this is a bug in |
Remove
strtoll
functions for testing i128/u128.Under AArch64, long long is defined as i64. When running the test integral.pass.cpp, it calls tries to call
strtoll
, which returns an i64, not an i128, therefore only keeping the lower 64 bits.