[libc][Obvious] Fix c++20-designator warnings for tests that use TmHelper.h.
[libc] apply formatting to testsApply the formatting rules that were applied to the libc/src directoryto the libc/test directory, as well as the files in libc/utils that areincluded by the tests.
[libc] apply formatting to testsApply the formatting rules that were applied to the libc/src directoryto the libc/test directory, as well as the files in libc/utils that areincluded by the tests. This does not include automated enforcement.Reviewed By: sivachandra, lntueDifferential Revision: https://reviews.llvm.org/D116127
show more ...
[libc] apply new lint rulesThis patch applies the lint rules described in the previous patch. Therewas also a significant amount of effort put into manually fixing things,since all of the templat
[libc] apply new lint rulesThis patch applies the lint rules described in the previous patch. Therewas also a significant amount of effort put into manually fixing things,since all of the templated functions, or structs defined in /spec, werenot updated and had to be handled manually.Reviewed By: sivachandra, lntueDifferential Revision: https://reviews.llvm.org/D114302
[libc] Introduce asctime, asctime_r to LLVM libc[libc] Introduce asctime, asctime_r to LLVM libcasctime and asctime_r share the same common code. They call asctime_internala static inline functi
[libc] Introduce asctime, asctime_r to LLVM libc[libc] Introduce asctime, asctime_r to LLVM libcasctime and asctime_r share the same common code. They call asctime_internala static inline function.asctime uses snprintf to return the string representation in a buffer.It uses the following format (26 characters is the buffer size) as per7.27.3.1 section in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2478.pdf.The buf parameter for asctime_r shall point to a buffer of at least 26 bytes.snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",...)Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D99686
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp.gmtime and gmtime_r share the same common code. They call gmtime_internala static inline function. Thus added only validati
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp.gmtime and gmtime_r share the same common code. They call gmtime_internala static inline function. Thus added only validation tests for gmtime_r.Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D99046
This introduces gmtime to LLVM libc, based on C99/C2X/Single Unix Spec.This change doesn't handle TIMEZONE, tm_isdst and leap seconds.Moved shared code between mktime and gmtime into time_utils.c
This introduces gmtime to LLVM libc, based on C99/C2X/Single Unix Spec.This change doesn't handle TIMEZONE, tm_isdst and leap seconds.Moved shared code between mktime and gmtime into time_utils.cpp.Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D98467
Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments.Added tests for invalid dates
Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments.Added tests for invalid dates like the following Date 1970-01-01 00:00:-1 is treated as 1969-12-31 23:59:59 and seconds are returned for the modified date.Tested the code by doing ninja check-libc (and cmake).Reviewed By: sivachandra, rtennetiDifferential Revision: https://reviews.llvm.org/D96684
[libc][NFC] add "LlvmLibc" as a prefix to all test namesSummary:Having a consistent prefix makes selecting all of the llvm libc testseasier on any platform that is also using the gtest framework.
[libc][NFC] add "LlvmLibc" as a prefix to all test namesSummary:Having a consistent prefix makes selecting all of the llvm libc testseasier on any platform that is also using the gtest framework.This also modifies the TEST and TEST_F macros to enforce this changemoving forward.Reviewers: sivachandraSubscribers:
Initial commit of mktime.This introduces mktime to LLVM libc, based on C99/C2X/Single Unix Spec.Co-authored-by: Jeff Bailey <[email protected]>This change doesn't handle TIMEZONE, tm_isdst
Initial commit of mktime.This introduces mktime to LLVM libc, based on C99/C2X/Single Unix Spec.Co-authored-by: Jeff Bailey <[email protected]>This change doesn't handle TIMEZONE, tm_isdst and leap seconds. It returns -1 for invalid dates. I have verified the return results for all the possible dates with glibc's mktime.TODO:+ Handle leap seconds.+ Handle out of range time and date values that don't overflow or underflow.+ Implement the following suggestion Siva - As we start accumulating the seconds, we should be able to check if the next amount of seconds to be added can lead to an overflow. If it does, return the overflow value. If not keep accumulating. The benefit is that, we don't have to validate every input, and also do not need the special cases for sizeof(time_t) == 4.+ Handle timezone and update of tm_isdstReviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D91551