summaryrefslogtreecommitdiff
path: root/libc/test/src/stdio/snprintf_test.cpp
AgeCommit message (Collapse)Author
2024-08-02[libc] Fix printf handling of INT_MIN width (#101729)Michael Jones
Prevously, if INT_MIN was passed as a wildcard width to a printf conversion the parser would attempt to negate it to get the positive width (and set the left justify flag), but it would underflow and the width would be treated as 0. This patch corrects the issue by instead treating a width of INT_MIN as identical to -INT_MAX. Also includes docs changes to explain this behavior and adding b to the list of int conversions.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-07-20[libc] Move printf writer to new designMichael Jones
The new printf writer design focuses on optimizing the fast path. It inlines any write to a buffer or string, and by handling buffering itself can more effectively work with both internal and external file implementations. The overflow hook should allow for expansion to asprintf with minimal extra code. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D153999
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-05-17[libc] add snprintfMichael Jones
After adding sprintf, snprintf is simple. The functions are very similar. The tests only cover the behavior of the max length since the sprintf tests should cover the other behavior. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D125826