Skip to content

Commit e908f61

Browse files
authored
[libc] Fix WEOF and fix 1'000'000 error messages on test failure (#147928)
1. WEOF is defined as a `wint_t` by the C standard. On certain architectures, the test won't compile on `-Wall`. This fixes it. 2. If `testSubnormalRange` fails, it will spit out way too many error messages, which overwhelms my test environment. I reduce this to 1k for now. This is required for #145349
1 parent d679dc7 commit e908f61

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libc/include/llvm-libc-macros/wchar-macros.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
#ifndef LLVM_LIBC_MACROS_WCHAR_MACROS_H
1010
#define LLVM_LIBC_MACROS_WCHAR_MACROS_H
1111

12+
#include "../llvm-libc-types/wint_t.h"
13+
1214
#ifndef WEOF
13-
#define WEOF 0xffffffffu
15+
#define WEOF ((wint_t)(0xffffffffu))
1416
#endif
1517

1618
#endif // LLVM_LIBC_MACROS_WCHAR_MACROS_H

libc/test/src/math/smoke/RoundToIntegerTest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ class RoundToIntegerTestTemplate
113113
}
114114

115115
void testSubnormalRange(RoundToIntegerFunc func) {
116-
constexpr int COUNT = 1'000'001;
116+
// Arbitrary, trades off completeness with testing time (esp. on failure)
117+
constexpr int COUNT = 1'000;
117118
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
118119
static_cast<StorageType>((MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT),
119120
StorageType(1));

0 commit comments

Comments
 (0)