<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/test/src/stdlib, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Move mbtowc, mbstowcs and inverse functions to stdlib.h (#168455)</title>
<updated>2025-11-17T23:43:42+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-17T23:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da61dd28c6dd77901058580e391cb8c88bb506f2'/>
<id>da61dd28c6dd77901058580e391cb8c88bb506f2</id>
<content type='text'>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `&lt;cstdlib&gt;`
header, and then uses those functions in its locale implementation.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc][test] split exit tests into two separate tests" (#168102)</title>
<updated>2025-11-14T18:36:05+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-11-14T18:36:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5b798df8c48aab6db287aaf3ae45ff32283c4f9c'/>
<id>5b798df8c48aab6db287aaf3ae45ff32283c4f9c</id>
<content type='text'>
Reverts llvm/llvm-project#166355</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#166355</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][test] split exit tests into two separate tests (#166355)</title>
<updated>2025-11-14T18:27:32+00:00</updated>
<author>
<name>Shreeyash Pandey</name>
<email>shreeyash335@gmail.com</email>
</author>
<published>2025-11-14T18:27:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e7db040b796df5e7bda5226492038a3af34803ef'/>
<id>e7db040b796df5e7bda5226492038a3af34803ef</id>
<content type='text'>
_Exit(3) is a fairly simple syscall wrapper whereas exit(3) calls
atexit-registered functions + whole lot of stuff that require support
for sync primitives.

Splitting the tests allows testing the former easily (especially for new
port projects)

---------

Signed-off-by: Shreeyash Pandey &lt;shreeyash335@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_Exit(3) is a fairly simple syscall wrapper whereas exit(3) calls
atexit-registered functions + whole lot of stuff that require support
for sync primitives.

Splitting the tests allows testing the former easily (especially for new
port projects)

---------

Signed-off-by: Shreeyash Pandey &lt;shreeyash335@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Disable overflow test in strfromtest on riscv32 (#166719)</title>
<updated>2025-11-06T20:55:16+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-06T20:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6adf99338832966dcf3477e112b158cd588ac584'/>
<id>6adf99338832966dcf3477e112b158cd588ac584</id>
<content type='text'>
Looks like https://github.com/llvm/llvm-project/pull/166517 is breaking
libc-riscv32-qemu-yocto-fullbuild-dbg build due to failing overflow test
for strfrom.
https://lab.llvm.org/buildbot/#/changes/58668

```
int result = func(buff, sizeof(buff), "%.2147483647f", 1.0f);
EXPECT_LT(result, 0);
ASSERT_ERRNO_FAILURE();
```

```
[ RUN      ] LlvmLibcStrfromdTest.CharsWrittenOverflow
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:493: FAILURE
       Expected: result
       Which is: 0
To be less than: 0
       Which is: 0
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:494: FAILURE
          Expected: 0
          Which is: 0
To be not equal to: static_cast&lt;int&gt;(libc_errno)
          Which is: 0
[  FAILED  ] LlvmLibcStrfromdTest.CharsWrittenOverflow
Ran 8 tests.  PASS: 7  FAIL: 1
```

At first glance it seem like there is some kind of overflow in
internal::strfromfloat_convert on 32bit archs because the other overflow
test case is passing for snprintf. Interestingly, it passes on all other
buildbots, including libc-arm32-qemu-debian-dbg.

This issue likely wasn't introduced by
https://github.com/llvm/llvm-project/pull/166517 and was probably
already present, so I'm not reverting the change just disabling the test
case on riscv32 until I can debug properly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Looks like https://github.com/llvm/llvm-project/pull/166517 is breaking
libc-riscv32-qemu-yocto-fullbuild-dbg build due to failing overflow test
for strfrom.
https://lab.llvm.org/buildbot/#/changes/58668

```
int result = func(buff, sizeof(buff), "%.2147483647f", 1.0f);
EXPECT_LT(result, 0);
ASSERT_ERRNO_FAILURE();
```

```
[ RUN      ] LlvmLibcStrfromdTest.CharsWrittenOverflow
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:493: FAILURE
       Expected: result
       Which is: 0
To be less than: 0
       Which is: 0
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:494: FAILURE
          Expected: 0
          Which is: 0
To be not equal to: static_cast&lt;int&gt;(libc_errno)
          Which is: 0
[  FAILED  ] LlvmLibcStrfromdTest.CharsWrittenOverflow
Ran 8 tests.  PASS: 7  FAIL: 1
```

At first glance it seem like there is some kind of overflow in
internal::strfromfloat_convert on 32bit archs because the other overflow
test case is passing for snprintf. Interestingly, it passes on all other
buildbots, including libc-arm32-qemu-debian-dbg.

This issue likely wasn't introduced by
https://github.com/llvm/llvm-project/pull/166517 and was probably
already present, so I'm not reverting the change just disabling the test
case on riscv32 until I can debug properly.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (with fixes #2) (#166517)</title>
<updated>2025-11-05T21:09:53+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-05T21:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e2f73fe9052a4fbf382a06e30b2441c6d99fb7e'/>
<id>9e2f73fe9052a4fbf382a06e30b2441c6d99fb7e</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/159474

Another try of trying to land
https://github.com/llvm/llvm-project/pull/166382
- Fix some leftover tests checking for specific  errnos
- Guard errno checking tests to not run on the GPU

@michaelrj-google</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/159474

Another try of trying to land
https://github.com/llvm/llvm-project/pull/166382
- Fix some leftover tests checking for specific  errnos
- Guard errno checking tests to not run on the GPU

@michaelrj-google</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Migrate ctype_utils to use char instead of int where applicable. (#166225)</title>
<updated>2025-11-05T19:02:28+00:00</updated>
<author>
<name>Alexey Samsonov</name>
<email>vonosmas@gmail.com</email>
</author>
<published>2025-11-05T19:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=120689e46679c6db37cd9e839ec0721e80a22d4f'/>
<id>120689e46679c6db37cd9e839ec0721e80a22d4f</id>
<content type='text'>
Functions like isalpha / tolower can operate on chars internally. This
allows us to get rid of unnecessary casts and open a way to creating
wchar_t overloads with the same names (e.g. for isalpha), that would
simplify templated code for conversion functions (see
315dfe5865962d8a3d60e21d1fffce5214fe54ef).

Add the int-&gt;char converstion to public entrypoints implementation
instead. We also need to introduce bounds check on the input argument
values - these functions' behavior is unspecified if the argument is
neither EOF nor fits in "unsigned char" range, but the tests we've had
verified that they always return false for small negative values. To
preserve this behavior, cover it explicitly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Functions like isalpha / tolower can operate on chars internally. This
allows us to get rid of unnecessary casts and open a way to creating
wchar_t overloads with the same names (e.g. for isalpha), that would
simplify templated code for conversion functions (see
315dfe5865962d8a3d60e21d1fffce5214fe54ef).

Add the int-&gt;char converstion to public entrypoints implementation
instead. We also need to introduce bounds check on the input argument
values - these functions' behavior is unspecified if the argument is
neither EOF nor fits in "unsigned char" range, but the tests we've had
verified that they always return false for small negative values. To
preserve this behavior, cover it explicitly.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert commit d8e5698 and 15b19c7 (#166498)</title>
<updated>2025-11-05T03:43:16+00:00</updated>
<author>
<name>Kewen Meng</name>
<email>Kewen.Meng@amd.com</email>
</author>
<published>2025-11-05T03:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c5aaee0bb07b221e5d3314bbdcf1abc4a604d6bd'/>
<id>c5aaee0bb07b221e5d3314bbdcf1abc4a604d6bd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (with fixes) (#166382)</title>
<updated>2025-11-05T00:20:51+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-05T00:20:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d8e56988f87ecdfa0b9bfdb269f6d904840cc6dd'/>
<id>d8e56988f87ecdfa0b9bfdb269f6d904840cc6dd</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/159474

Resubmitting https://github.com/llvm/llvm-project/pull/162876 with fixes
as it broke some buildbots:
 - Fix comparisons of integer expressions of different signedness
- Not check for specific errnos in tests, as they might not be available
on all platforms</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/159474

Resubmitting https://github.com/llvm/llvm-project/pull/162876 with fixes
as it broke some buildbots:
 - Fix comparisons of integer expressions of different signedness
- Not check for specific errnos in tests, as they might not be available
on all platforms</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Add printf error handling" (#166232)</title>
<updated>2025-11-03T20:50:11+00:00</updated>
<author>
<name>Kewen Meng</name>
<email>Kewen.Meng@amd.com</email>
</author>
<published>2025-11-03T20:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=346da3dfd3e70ca82a7df968c79666ff0b8c77c5'/>
<id>346da3dfd3e70ca82a7df968c79666ff0b8c77c5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add printf error handling (#162876)</title>
<updated>2025-11-03T19:15:14+00:00</updated>
<author>
<name>Marcell Leleszi</name>
<email>59964679+mleleszi@users.noreply.github.com</email>
</author>
<published>2025-11-03T19:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0c707c9713f0657f7208b8f9a95a13af749d95c5'/>
<id>0c707c9713f0657f7208b8f9a95a13af749d95c5</id>
<content type='text'>
[#159474](https://github.com/llvm/llvm-project/issues/159474)

- All printf variants set errno and consistently return -1 on error,
instead of returning various predefined error codes
- Return value overflow handling is added</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[#159474](https://github.com/llvm/llvm-project/issues/159474)

- All printf variants set errno and consistently return -1 on error,
instead of returning various predefined error codes
- Return value overflow handling is added</pre>
</div>
</content>
</entry>
</feed>
