[libcxx-commits] [libcxx] [libcxx] Fix libcxx test, integral.pass.cpp (PR #135355)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Apr 11 05:27:43 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: William (saturn691)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/135355.diff
1 Files Affected:
- (modified) libcxx/test/support/charconv_test_helpers.h (-19)
``````````diff
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{});
``````````
</details>
https://github.com/llvm/llvm-project/pull/135355
More information about the libcxx-commits
mailing list