[libc-commits] [libc] [libc] Fix WEOF and fix 1'000'000 error messages on test failure (PR #147928)
William Huynh via libc-commits
libc-commits at lists.llvm.org
Thu Jul 10 09:31:54 PDT 2025
https://github.com/saturn691 updated https://github.com/llvm/llvm-project/pull/147928
>From 288b750c4cec2472376e6ad3082c5c5ebf2dcf80 Mon Sep 17 00:00:00 2001
From: William Huynh <William.Huynh at arm.com>
Date: Thu, 10 Jul 2025 10:50:57 +0100
Subject: [PATCH 1/2] [libc] Fix WEOF and fix 1'000'000 error messages on test
failure
---
libc/include/llvm-libc-macros/wchar-macros.h | 2 +-
libc/test/src/math/smoke/RoundToIntegerTest.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libc/include/llvm-libc-macros/wchar-macros.h b/libc/include/llvm-libc-macros/wchar-macros.h
index 5b211f5276b62..21a3453ce4c2c 100644
--- a/libc/include/llvm-libc-macros/wchar-macros.h
+++ b/libc/include/llvm-libc-macros/wchar-macros.h
@@ -10,7 +10,7 @@
#define LLVM_LIBC_MACROS_WCHAR_MACROS_H
#ifndef WEOF
-#define WEOF 0xffffffffu
+#define WEOF ((wint_t)(0xffffffffu))
#endif
#endif // LLVM_LIBC_MACROS_WCHAR_MACROS_H
diff --git a/libc/test/src/math/smoke/RoundToIntegerTest.h b/libc/test/src/math/smoke/RoundToIntegerTest.h
index 745ccbc748ecd..2b460aef6ef32 100644
--- a/libc/test/src/math/smoke/RoundToIntegerTest.h
+++ b/libc/test/src/math/smoke/RoundToIntegerTest.h
@@ -113,7 +113,8 @@ class RoundToIntegerTestTemplate
}
void testSubnormalRange(RoundToIntegerFunc func) {
- constexpr int COUNT = 1'000'001;
+ // Arbitrary, trades off completeness with testing time (esp. on failure)
+ constexpr int COUNT = 1'000;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT),
StorageType(1));
>From ead2d446458f8e6b17c16a14e4ade3b2ffbc36d3 Mon Sep 17 00:00:00 2001
From: William Huynh <William.Huynh at arm.com>
Date: Thu, 10 Jul 2025 17:31:37 +0100
Subject: [PATCH 2/2] Commit suggestion from lntue
---
libc/include/llvm-libc-macros/wchar-macros.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libc/include/llvm-libc-macros/wchar-macros.h b/libc/include/llvm-libc-macros/wchar-macros.h
index 21a3453ce4c2c..2a0cabd6133a4 100644
--- a/libc/include/llvm-libc-macros/wchar-macros.h
+++ b/libc/include/llvm-libc-macros/wchar-macros.h
@@ -9,6 +9,8 @@
#ifndef LLVM_LIBC_MACROS_WCHAR_MACROS_H
#define LLVM_LIBC_MACROS_WCHAR_MACROS_H
+#include "../llvm-libc-types/wint_t.h"
+
#ifndef WEOF
#define WEOF ((wint_t)(0xffffffffu))
#endif
More information about the libc-commits
mailing list