summaryrefslogtreecommitdiff
path: root/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
AgeCommit message (Collapse)Author
2023-09-01[libc++] Apply clang formatting to all string unit testsBrendan Emery
This applies clang-format to the std::string unit tests in preparation for landing https://reviews.llvm.org/D140550. Differential Revision: https://reviews.llvm.org/D140612
2023-03-01[libc++] Fix modules issues on OS XArthur O'Dwyer
First, fix a collision with the Point type from MacTypes.h, which was reported on Slack, 2022-07-31: https://cpplang.slack.com/archives/C2X659D1B/p1659284691275889 Second, rename the meta:: namespace to types::. OSX's "/usr/include/ncurses.h" defines a `meta` function, and is (for some reason) included in "<SDK>/usr/include/module.modulemap", so that identifier is off-limits for us to use in anything that compiles with -fmodules: libcxx/test/support/type_algorithms.h:16:11: error: redefinition of 'meta' as different kind of symbol namespace meta { ^ <SDK>/usr/include/ncurses.h:603:28: note: previous definition is here extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ ^ Finally, add a CI configuration for modules on OS X to make sure it does not regress. Differential Revision: https://reviews.llvm.org/D144915
2022-11-21[libc++] Add utilites for instantiating functions with multiple typesNikolas Klauser
We currently call a lot of functions with the same list of types. To avoid forgetting any of them, this patch adds type_lists and utilities for it. Specifically, it adds - `type_list` - This is just a list of types - `concatenate` - This allows concatenating type_lists - `for_each` - Iterate over a type_list Reviewed By: ldionne, #libc Spies: jloser, EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D137476
2022-08-26[libc++][NFC] Remove some of the code duplication in the string testsNikolas Klauser
Reviewed By: ldionne, #libc, huixie90 Spies: huixie90, libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D131856
2022-06-13[libcxx][AIX] Switch build compiler to clangJake Egan
This patch switches the build compiler for AIX from ibm-clang to clang. ibm-clang++_r has `-pthread` by default, but clang for AIX doesn't, so `-pthread` had to be added to the test config. A bunch of tests now pass, so the `XFAIL` was removed. This patch also switch the build to use the visibility support available in clang-15 to control symbols exported by the shared library (AIX traditionally uses explicit export lists for this purpose). Reviewed By: #libc, #libc_abi, daltenty, #libunwind, ldionne Differential Revision: https://reviews.llvm.org/D127470
2022-04-27[libc++] Implement P0980R1 (constexpr std::string)Nikolas Klauser
Reviewed By: #libc, ldionne Spies: daltenty, sdasgup3, ldionne, arichardson, MTC, ChuanqiXu, mehdi_amini, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes, tatianashp, rdzhabarov, teijeong, cota, dcaballe, Chia-hungDuan, wrengr, wenzhicui, arphaman, Mordante, miscco, Quuxplusone, smeenai, libcxx-commits Differential Revision: https://reviews.llvm.org/D110598
2022-02-08[libc++] Prepare string.{access, capacity, cons} tests for constexprNikolas Klauser
Reviewed By: ldionne, #libc Spies: libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D119123
2020-04-10[libc++] NFC: Clean up a lot of old Lit featuresLouis Dionne
The libc++ test suite has a lot of old Lit features used to XFAIL tests and mark them as UNSUPPORTED. Many of them are to workaround problems on old compilers or old platforms. As time goes by, it is good to go and clean those up to simplify the configuration of the test suite, and also to reflect the testing reality. It's not useful to have markup that gives the impression that e.g. clang-3.3 is supported, when we don't really test on it anymore (and hence several new tests probably don't have the necessary markup on them).
2019-02-27[libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne
Those tests fail when linking against a new dylib but running against macosx10.7. I believe this is caused by a duplicate definition of the RTTI for exception classes in libc++.dylib and libc++abi.dylib, but this matter still needs some investigation. This issue was not caught previously because all the tests always linked against the same dylib used for running (because LIT made it impossible to do otherwise before r349171). rdar://problem/46809586 llvm-svn: 354940
2019-02-04Support tests in freestandingJF Bastien
Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
2019-01-19Update more file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
2017-11-21Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III
as https://reviews.llvm.org/D40065 llvm-svn: 318804
2017-11-15Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III
https://reviews.llvm.org/D39033 llvm-svn: 318276
2016-11-01Protect exceptional paths under libcpp-no-exceptionsRoger Ferrer Ibanez
These tests are of the form try { action-that-may-throw assert(!exceptional-condition) assert(some-other-facts) } catch (relevant-exception) { assert(exceptional-condition) } Under libcpp-no-exceptions there is still value in verifying some-other-facts while avoiding the exceptional case. So for these tests just conditionally check some-other-facts if exceptional-condition is false. When exception are supported make sure that a true exceptional-condition throws an exception Differential Revision: https://reviews.llvm.org/D26136 llvm-svn: 285697
2016-06-14Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier
TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
2015-11-10Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake
Fixes a small omission in libcxx that prevents libcxx being built when -DLIBCXX_ENABLE_EXCEPTIONS=0 is specified. This patch adds XFAILS to all those tests that are currently failing on the new -fno-exceptions library variant. Follow-up patches will update the tests (progressively) to cope with the new library variant. Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a llvm-svn: 252598
2014-12-20Move test into test/std subdirectory.Eric Fiselier
llvm-svn: 224658