summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/basic.string/string.ops
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx][test][NFC] Fix comment typos.Stephan T. Lavavej2019-10-221-1/+1
| | | | (Testing git commit access.)
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3128-0/+28
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-276-0/+30
| | | | | | | | | | | | | | | 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
* Support tests in freestandingJF Bastien2019-02-0444-44/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1944-176/+132
| | | | | | | | | | | | | | | | | | 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
* Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616Marshall Clow2018-07-028-2/+64
| | | | llvm-svn: 336132
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-216-8/+8
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-156-8/+8
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* [libcxx] [test] Fix unused local typedef warnings.Stephan T. Lavavej2017-09-261-2/+2
| | | | llvm-svn: 314259
* Add even more string_view tests. These found some bugs in the default ↵Marshall Clow2017-09-078-0/+1416
| | | | | | parameter value for rfind/find_last_of/find_last_not_of llvm-svn: 312693
* Protect std::string tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-291-4/+13
| | | | | | | | | Skip tests that expect an exception be thrown and/or disable unreachable catch handlers. Differential Revision: https://reviews.llvm.org/D26612 llvm-svn: 288158
* Reverting wrong diffRoger Ferrer Ibanez2016-11-241-8/+1
| | | | | | I managed to confuse me with two reviews of the same thing and ended commiting the wrong one. llvm-svn: 287868
* Protect std::string tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-241-1/+8
| | | | | | | | | Skip tests that expect an exception be thrown and/or disable unreachable catch handlers. Differential Revision: https://reviews.llvm.org/D26608 llvm-svn: 287865
* Protect exceptional paths under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-015-51/+101
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix a few static_asserts that need extra parens on -03Marshall Clow2016-09-241-2/+2
| | | | llvm-svn: 282343
* Implement proposed resolution for LWG#2758. Reviewed as D24446. Normally, I ↵Marshall Clow2016-09-241-0/+5980
| | | | | | would wait for these to be voted upon at a committee meeting (November), but the current draft standard is broken, and this should fix it. (And if it doesn't, we want to know about it soonest) llvm-svn: 282342
* Implement std::string_view as described in http://wg21.link/P0254R1. ↵Marshall Clow2016-07-211-5/+5
| | | | | | Reviewed as https://reviews.llvm.org/D21459 llvm-svn: 276238
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-1432-32/+32
| | | | | | | | | 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
* Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macrosEric Fiselier2016-04-281-2/+3
| | | | llvm-svn: 267947
* Remove a couple tabs that crept inMarshall Clow2016-03-081-2/+2
| | | | llvm-svn: 262932
* Implement P0272R1: Give 'std::string' a non-const '.data()' member functionMarshall Clow2016-03-081-10/+36
| | | | llvm-svn: 262931
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-105-0/+5
| | | | | | | | | | | | 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
* Move test into test/std subdirectory.Eric Fiselier2014-12-2035-0/+13315
llvm-svn: 224658
OpenPOWER on IntegriCloud