summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/basic.string/string.modifiers/string_assign
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-272-0/+10
| | | | | | | | | | | | | | | 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-0410-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1910-40/+30
| | | | | | | | | | | | | | | | | | 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
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-293-45/+45
| | | | llvm-svn: 309464
* [libcxx] [test] D27027: Strip trailing whitespace.Stephan T. Lavavej2016-11-233-6/+6
| | | | llvm-svn: 287829
* Protect exceptional paths under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-012-18/+52
| | | | | | | | | | | | | | | | | | | | | | 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 shadow warnings in string_view tests. Patch from STL@microsoft.comEric Fiselier2016-10-241-11/+10
| | | | llvm-svn: 285011
* Implement proposed resolution for LWG#2758. Reviewed as D24446. Normally, I ↵Marshall Clow2016-09-241-3/+59
| | | | | | 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
* Fix PR#30303 - no matching function for call to '__ptr_in_range'Marshall Clow2016-09-071-0/+9
| | | | llvm-svn: 280779
* Fix Bug 30240 - std::string: append(first, last) error when aliasing. Add ↵Marshall Clow2016-09-053-0/+47
| | | | | | test cases for append/insert/assign/replace while we're at it, and fix a similar bug in insert. llvm-svn: 280643
* Implement std::string_view as described in http://wg21.link/P0254R1. ↵Marshall Clow2016-07-212-0/+228
| | | | | | Reviewed as https://reviews.llvm.org/D21459 llvm-svn: 276238
* Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macrosEric Fiselier2016-04-288-16/+21
| | | | llvm-svn: 267947
* Implement LWG#2579: Inconsistency wrt Allocators in basic_string assignment ↵Marshall Clow2016-03-091-1/+33
| | | | | | vs. basic_string::assign llvm-svn: 263042
* More string fixes for noexcept cases. Apparently I didn't get them all in ↵Marshall Clow2016-01-201-0/+2
| | | | | | r258281. llvm-svn: 258291
* Fix up the tests I added for string exceptions to be skipped when exceptions ↵Marshall Clow2016-01-201-0/+2
| | | | | | are disabled llvm-svn: 258279
* Fix PR#25973 : 'basic_string::assign(InputIt, InputIt) doesn't provide the ↵Marshall Clow2016-01-138-8/+35
| | | | | | strong exception safety guarantee'. This turned out to be a pervasive problem in <string>, which required a fair amount of rework. Add in an optimization for when iterators provide noexcept increment/comparison/assignment/dereference (which covers many of the iterators in libc++). Reviewed as http://reviews.llvm.org/D15862 llvm-svn: 257682
* Make it possible to build a no-exceptions variant of libcxx.Asiri Rathnayake2015-11-101-0/+1
| | | | | | | | | | | | 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
* Implement LWG#2063, and update the issues links to point to the github ↵Marshall Clow2015-10-051-0/+6
| | | | | | generated pages llvm-svn: 249325
* Walter Brown sent a list of tests which needed 'additional includes' to ↵Marshall Clow2015-01-091-0/+1
| | | | | | match what was in the standard. Added these includes to the tests. No changes to the library or test results. llvm-svn: 225541
* Move test into test/std subdirectory.Eric Fiselier2014-12-208-0/+660
llvm-svn: 224658
OpenPOWER on IntegriCloud