[libc] add sprintf
authorMichael Jones <michaelrj@google.com>
Thu, 12 May 2022 20:43:15 +0000 (13:43 -0700)
committerMichael Jones <michaelrj@google.com>
Tue, 17 May 2022 18:32:20 +0000 (11:32 -0700)
commitff6fe39eca705186fab1f06376cc4b648ff9711b
treed2106d0733c2a19ad3653ab2c166c18cf5c43b47
parentdbf3b5f114553e4d5a446cd9ef57e98a8d04354e
[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
14 files changed:
libc/config/linux/x86_64/entrypoints.txt
libc/spec/stdc.td
libc/src/stdio/CMakeLists.txt
libc/src/stdio/printf_core/CMakeLists.txt
libc/src/stdio/printf_core/char_converter.h
libc/src/stdio/printf_core/converter.cpp
libc/src/stdio/printf_core/converter.h
libc/src/stdio/printf_core/printf_main.h
libc/src/stdio/printf_core/string_converter.h
libc/src/stdio/sprintf.cpp [new file with mode: 0644]
libc/src/stdio/sprintf.h [new file with mode: 0644]
libc/test/src/stdio/CMakeLists.txt
libc/test/src/stdio/printf_core/parser_test.cpp
libc/test/src/stdio/sprintf_test.cpp [new file with mode: 0644]