summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/basic.string/string.modifiers/string_append
Commit message (Collapse)AuthorAgeFilesLines
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-311-0/+1
| | | | | | 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-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
* Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616Marshall Clow2018-07-021-0/+9
| | | | llvm-svn: 336132
* [libcxx] [test] Fix MSVC warnings and errors.Stephan T. Lavavej2018-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp Fix MSVC x64 truncation warnings. warning C4267: conversion from 'size_t' to 'int', possible loss of data test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp Fix MSVC uninitialized memory warning. warning C6001: Using uninitialized memory 'vl'. test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp Include <cassert> for the assert() macro. Fixes D43273. llvm-svn: 326120
* Fix PR#31454 - 'basic_string<T>::push_back() crashes if ↵Marshall Clow2018-02-071-2/+1
| | | | | | sizeof(T)>sizeof(long long)'. We were mishandling the small-string optimization calculations for very large 'characters'. This may be an ABI change (change the size of) strings of very large 'characters', but since they never worked, I'm not too concerned. llvm-svn: 324531
* Ooops. I checked in a test for a bug I haven't fixed yet. Temporrarily ↵Marshall Clow2017-12-041-0/+2
| | | | | | commented it out. llvm-svn: 319693
* Implement P0457R2: 'String Prefix and Suffix Checking' for c++2aMarshall Clow2017-12-041-0/+14
| | | | llvm-svn: 319687
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-293-50/+50
| | | | llvm-svn: 309464
* Fix PR32642 - string::insert and string::append don't work with move_iterator.Eric Fiselier2017-04-151-0/+16
| | | | llvm-svn: 300397
* [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
* Add another append test for basic_stringMarshall Clow2016-10-051-0/+4
| | | | llvm-svn: 283331
* 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/+49
| | | | | | 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/+207
| | | | | | Reviewed as https://reviews.llvm.org/D21459 llvm-svn: 276238
* Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macrosEric Fiselier2016-04-288-13/+18
| | | | llvm-svn: 267947
* 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-9/+36
| | | | | | 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
* Move test into test/std subdirectory.Eric Fiselier2014-12-208-0/+625
llvm-svn: 224658
OpenPOWER on IntegriCloud