summaryrefslogtreecommitdiff
path: root/libc/test/src/__support/CPP/stringview_test.cpp
AgeCommit message (Collapse)Author
2024-12-03[libc] Change ctype to be encoding independent (#110574)Michael Jones
The previous implementation of the ctype functions assumed ASCII. This patch changes to a switch/case implementation that looks odd, but actually is easier for the compiler to understand and optimize.
2024-03-18[libc] Add `shm_open/shm_unlink` (#84974)Schrodinger ZHU Yifan
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-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.
2023-01-19[libc] add internal string classMichael Jones
The scanf implementation needs a dynamically resizing string class. This patch adds a minimal version of that class along with tests to check the current functionality. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D141162
2022-08-23[reland][NFC][libc] standardize string_viewGuillaume Chatelet
2022-08-23Revert "[reland][NFC][libc] standardize string_view"Guillaume Chatelet
This reverts commit df99774ef7d9c910941fe915689f9126258800ee.
2022-08-23[reland][NFC][libc] standardize string_viewGuillaume Chatelet
2022-08-23Revert "[reland][NFC][libc] standardize string_view"Guillaume Chatelet
This reverts commit 522d29a6a745e38d635739b05383770804bac311.
2022-08-23[reland][NFC][libc] standardize string_viewGuillaume Chatelet
2022-08-23Revert "[reland][NFC][libc] standardize string_view"Guillaume Chatelet
This reverts commit 187099da1c415bd8f717eb5adc75bb1d73c7a0ba.
2022-08-23[reland][NFC][libc] standardize string_viewGuillaume Chatelet
2022-08-23Revert "[NFC][libc] standardize string_view"Guillaume Chatelet
This reverts commit abe0fa6b17d866ef21e7c2abb799658c490b8508.
2022-08-23[NFC][libc] standardize string_viewGuillaume Chatelet
2022-08-22[libc][NFC] Use STL case for string_viewGuillaume Chatelet
2022-07-19[libc] Add a method `find_last_of` to StringView.Siva Chandra Reddy
Reviewed By: jeffbailey Differential Revision: https://reviews.llvm.org/D130112
2022-07-18[libc] Fix API for remove_{prefix, suffix}Jeff Bailey
The API in StringView.h for remove_prefix was incorrect and was returning a new StringView rather than just altering the view. As part of this, also removed some of the safety features. The comment correctly noted that the behaviour is undefined in some cases, but the code and test cases checked for that. One caller was relying on the old behaviour, so fixed it and added some comments. Tested: check-libc llvmlibc libc-loader-tests Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D129950
2022-07-14Add support for three more string_view functionsJeff Bailey
Add support for three more string_view functions 1) starts_with(char) 2) ends_with(char) 3) find_first_of(char, size_t) Reimplemented trim in terms of the new starts_with and ends_with. Tested: New unit tests. Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D129618
2022-07-12[libc][utils] Add more methods to StringViewGuillaume Chatelet
Differential Revision: https://reviews.llvm.org/D128908
2022-02-14Introduce getenv to LLVM libcRaman Tenneti
Add support for getenv as defined by the Open Group's "System Interface & Header" in https://pubs.opengroup.org/onlinepubs/7908799/xsh/getenv.html getenv requires a standard way of accessing the environment, so a pointer to the environment is added to the startup in crt1. Consquently, this function is not usable on top of other libcs. Added starts_with method to StringView. getenv function uses it. Co-authored-by: Jeff Bailey <jeffbailey@google.com> Reviewed By: sivachandra, rtenneti Differential Revision: https://reviews.llvm.org/D119403
2022-02-12[libc][Obvious][NFC] Move CPP tests to the correct nested directory.Siva Chandra Reddy