The differential fuzzer found that glibc and our libc disagree on the
result for "0x30000002222225p-1077", with ours being rounded up and
theirs rounded down. Ours is more correct for the nearest rounding mode,
so only a test is added.
Reviewed By: lntue, sivachandra
Differential Revision: https://reviews.llvm.org/D145821
This doesn't seem to be used anymore after recent changes that removed
the `--sysroot` method for the integration tests.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D146040
The macro llvmlibc_errno has also been removed. This change completes
the switch to using a hermetic errno for unit tests.
Fixes#61037
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D146005
Fixes#61355. The __dso_handle decl was introduced incorrectly into the startup
objects during the integration test cleanup which moved the integration tests
away from using an artificial sysroot to using -nostdlib. Having it in the
startup creates the duplicate symbol error when one does not use -nostdlib.
Since this is an integration test only problem, it is meaningful to keep it in
the integration test anyway.
Differential Revision: https://reviews.llvm.org/D145898
Switch math functions to use libc_errno and fix some errno and
floating point exceptions
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145349
When running the libc tests under vscode, I got an error about a
mismatches exception declaration for strerror. Since string.h
seems to be getting included transitively anyway, just include
it and rely on its definition.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D144803
When running the tbin2dec tests I found a rounding error in my code.
Upon inspection I realized it was due to a lack of parenthesis when
calculating the number of trailing digits. This patch fixes that mistake
and adds unit tests to catch regressions in future.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145011
The internal implementation of the string to float function previously
used pointer arguments for returning several values. Additionally it
set errno in several unexpected places. Now all of that goes through
return structs. For readability I also moved the function away from raw
pointer arithmetic towards proper indexing. I also added support for
rounding modes.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D144597
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
Lint targets for individual entrypoints have also been cleaned up. The
target "libc-lint" depends on the individual lint targets.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D144705
Set FE_OVERFLOW and FE_UNDERFLOW for expf, exp2f, exp10f, expm1f, sinhf
and coshf.
Reviewed By: sivachandra, renyichen
Differential Revision: https://reviews.llvm.org/D144340
The target "check-libc" now runs all enabled tests which, depending on
the build mode, includes the unit tests, the integration tests and the api
test.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D144663
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
Introduce Month enum.
Use designated initializers instead of comments to ensure that tm_data
is initialized correctly. Use Month enum for initializing .tm_mon to
avoid off-by-one errors.
Co-authored-by: Raman Tenneti <rtenneti@google.com>
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D144357
Properly set floating point exceptions and add more exceptional
values for non-FMA x86-64 targets.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D143699
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.