History log of /llvm-project/libc/test/src/stdio/printf_core/parser_test.cpp (Results 1 – 19 of 19)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# a21fc4c0 02-Aug-2024 Michael Jones <michaelrj@google.com>

[libc] Fix printf handling of INT_MIN width (#101729)

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

[libc] Fix printf handling of INT_MIN width (#101729)

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.

show more ...


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3
# fdef5c4f 29-Mar-2024 Om Prakaash <omsuseela@gmail.com>

Add bit width length modifier to printf (#82461)

Resolves #81685. This adds support for wN and wfN length modifiers in
fprintf.


Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# b6bc9d72 26-Sep-2023 Guillaume Chatelet <gchatelet@google.com>

[libc] Mass replace enclosing namespace (#67032)

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


# e0be78be 21-Sep-2023 Joseph Huber <35342157+jhuber6@users.noreply.github.com>

[libc] Template the printf / scanf parser class (#66277)

Summary:
The parser class for stdio currently accepts different argument
providers. In-tree this is only used for a fuzzer test, however, the

[libc] Template the printf / scanf parser class (#66277)

Summary:
The parser class for stdio currently accepts different argument
providers. In-tree this is only used for a fuzzer test, however, the
proposed implementation of the GPU handling of printf / scanf will
require custom argument handlers. This makes the current approach of
using a preprocessor macro messier. This path proposed folding this
logic into a template instantiation. The downside to this is that
because the implementation of the parser class is placed into an
implementation file we need to manually instantiate the needed templates
which will slightly bloat binary size. Alternatively we could remove the
implementation file, or key off of the `libc` external packaging macro
so it is not present in the installed version.

show more ...


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4
# 8f0814f5 23-Feb-2023 Michael Jones <michaelrj@google.com>

[libc] Clarify printf percent conversion behavior.

Almost all printf conversions ending in '%' are undefined, but they're
traditionally treated as if the complete conversion specifier is "%%".
This

[libc] Clarify printf percent conversion behavior.

Almost all printf conversions ending in '%' are undefined, but they're
traditionally treated as if the complete conversion specifier is "%%".
This patch modifies the parser to more closely match that behavior.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D144679

show more ...


Revision tags: llvmorg-16.0.0-rc3
# bf279f90 10-Feb-2023 Michael Jones <michaelrj@google.com>

[libc] Prevent printf index mode crashes

The posix standard defines an alternate mode for printf where the
conversions also have an index that describes which argument to select.
Due to how variadic

[libc] Prevent printf index mode crashes

The posix standard defines an alternate mode for printf where the
conversions also have an index that describes which argument to select.
Due to how variadic arguments work in C, to reach the nth argument all
n-1 previous arguments must be read with their correct types. If the
format string does not specify the types for a continuous set of
arguments, then the arguments after the discontinuity cannot be safely
read. This patch causes all conversions requesting an argument that
comes after a gap be treated as raw (i.e. the conversion string is
printed literally).

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D143782

show more ...


# c3228714 13-Feb-2023 Guillaume Chatelet <gchatelet@google.com>

[libc][NFC] Make tuning macros start with LIBC_COPT_

Rename preprocessor definitions that control tuning of llvm libc.

Differential Revision: https://reviews.llvm.org/D143913


Revision tags: llvmorg-16.0.0-rc2
# af1315c2 06-Feb-2023 Siva Chandra Reddy <sivachandra@google.com>

[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.

This part of the effort to make all test related pieces into the `test`
directory. This helps is excluding test related pieces

[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.

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.

show more ...


Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5
# 28e312cb 03-Nov-2022 Michael Jones <michaelrj@google.com>

[libc][obvious] fix printf failing to stop on %\0

Previously, the printf parser would treat "%\0" as a conversion with the
name "\0", and advance past the null byte causing a buffer overflow.
This p

[libc][obvious] fix printf failing to stop on %\0

Previously, the printf parser would treat "%\0" as a conversion with the
name "\0", and advance past the null byte causing a buffer overflow.
This patch corrects that in both printf and scanf.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D137367

show more ...


Revision tags: llvmorg-15.0.4
# 7a129f07 19-Oct-2022 Michael Jones <michaelrj@google.com>

[libc] add scanf parser and core utilities

This is the first piece of scanf. It's very similar in design to printf,
and so much of the code is copied from that. There were potential issues
with conf

[libc] add scanf parser and core utilities

This is the first piece of scanf. It's very similar in design to printf,
and so much of the code is copied from that. There were potential issues
with conflicting macros so I've also renamed the "ASSERT_FORMAT_EQ"
macro for printf to "ASSERT_PFORMAT_EQ".

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D136288

show more ...


Revision tags: llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3
# 096463d0 16-Aug-2022 Michael Jones <michaelrj@google.com>

[libc] move printf to use StringViews

The FormatSection and the writer functions both previously took a char*
and a length to represent a string. Now they use the StringView class to
represent that

[libc] move printf to use StringViews

The FormatSection and the writer functions both previously took a char*
and a length to represent a string. Now they use the StringView class to
represent that more succinctly. This change also required fixing
everywhere these were used, so it touches a lot of files.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D131994

show more ...


# d769cd8c 19-Aug-2022 Guillaume Chatelet <gchatelet@google.com>

[reland][libc][NFC] Use STL case for bit


# 175560fc 19-Aug-2022 Guillaume Chatelet <gchatelet@google.com>

Revert "[libc][NFC] Use STL case for bit"

This reverts commit 7ba14b8611df1172d92d60bf19870e98a92e7a3a.


# 7ba14b86 19-Aug-2022 Guillaume Chatelet <gchatelet@google.com>

[libc][NFC] Use STL case for bit


# 438d1f18 15-Aug-2022 Michael Jones <michaelrj@google.com>

[libc] add guard for file pieces of printf

In the printf_core CMake, the file pieces are defined as object
libraries that depend on the File data structure. If these are added
unconditionally they'l

[libc] add guard for file pieces of printf

In the printf_core CMake, the file pieces are defined as object
libraries that depend on the File data structure. If these are added
unconditionally they'll try to evaluate that dependancy even when there
is no File available. This patch adds a guard to prevent that error.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D131921

show more ...


Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4
# ff6fe39e 12-May-2022 Michael Jones <michaelrj@google.com>

[libc] add sprintf

This adds the sprintf entrypoint, as well as unit tests. Currently
sprintf only supports %%, %s, and %c, but the other conversions are on
the way.

Reviewed By: sivachandra, lntue

[libc] add sprintf

This adds the sprintf entrypoint, as well as unit tests. Currently
sprintf only supports %%, %s, and %c, but the other conversions are on
the way.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D125573

show more ...


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1
# 945fa672 07-Apr-2022 Michael Jones <michaelrj@google.com>

[libc][NFC] add index mode to printf parser

This patch is a followup to the previous patch which implemented the
main printf parsing logic as well as sequential mode. This patch adds
index mode.

Re

[libc][NFC] add index mode to printf parser

This patch is a followup to the previous patch which implemented the
main printf parsing logic as well as sequential mode. This patch adds
index mode.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D123424

show more ...


# ff137478 20-Apr-2022 Michael Jones <michaelrj@google.com>

[libc] Add Printf FormatSection Matcher

This patch changes the printf parser tests to use a more robust matcher.
This allows for better debugging of parsing issues. This does not affect
the actual p

[libc] Add Printf FormatSection Matcher

This patch changes the printf parser tests to use a more robust matcher.
This allows for better debugging of parsing issues. This does not affect
the actual printf code at all, only the tests.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D124130

show more ...


# 4f4752ee 04-Apr-2022 Michael Jones <michaelrj@google.com>

[libc][NFC] implement printf parser

This patch adds the sequential mode implementation of the printf parser,
as well as unit tests for it. In addition it adjusts the surrounding
files to accomodate

[libc][NFC] implement printf parser

This patch adds the sequential mode implementation of the printf parser,
as well as unit tests for it. In addition it adjusts the surrounding
files to accomodate changes in the design found in the implementation
process.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D123339

show more ...