summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-121-1/+1
| | | | llvm-svn: 324959
* The apple versions of clang don't support deduction guides yet.Marshall Clow2018-02-082-0/+2
| | | | llvm-svn: 324640
* Once more, with feeling. Spell 'clang-4.0' correctly this timeMarshall Clow2018-02-082-2/+2
| | | | llvm-svn: 324624
* Clean up string's deduction guides tests. Mark old versions of clang as ↵Marshall Clow2018-02-083-58/+83
| | | | | | unsupported, b/c they don't have deduction guides, even in C++17 mode llvm-svn: 324619
* Temporarily comment out deduction guide tests while I figure out what to do ↵Marshall Clow2018-02-082-0/+3
| | | | | | with old bots llvm-svn: 324573
* Implement deduction guide for basic_string as described in P0433Marshall Clow2018-02-082-0/+110
| | | | llvm-svn: 324569
* 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
* Add tests to make sure that <string_view> provides std::size/data/empty in ↵Marshall Clow2018-01-302-0/+9
| | | | | | C++17 mode. This is LWG#3009, coming up for a vote in JAX - but we already do it, just don't have tests llvm-svn: 323719
* Fix the definitions of 'reference' and 'pointer' in string_view that no one ↵Marshall Clow2017-12-201-0/+77
| | | | | | uses :-). Thanks to K-ballo for the catch. llvm-svn: 321188
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-12-073-3/+3
| | | | llvm-svn: 319994
* 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-0413-0/+861
| | | | llvm-svn: 319687
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-217-10/+10
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-154-1/+63
| | | | | | string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big. llvm-svn: 318328
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-158-11/+11
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* Mark string_view's constructor from (ptr,len) as noexcept (an extension). ↵Marshall Clow2017-10-244-3/+15
| | | | | | Update the tests to check this (and other noexcept bits llvm-svn: 316456
* Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K ↵Marshall Clow2017-10-241-0/+6
| | | | | | for the bug report. llvm-svn: 316439
* [libcxx] [test] Fix unused local typedef warnings.Stephan T. Lavavej2017-09-261-2/+2
| | | | llvm-svn: 314259
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-09-261-1/+1
| | | | llvm-svn: 314258
* 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
* Another missing string_view testMarshall Clow2017-09-071-0/+74
| | | | llvm-svn: 312691
* Add more string_view testsMarshall Clow2017-09-073-0/+909
| | | | llvm-svn: 312690
* [libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-291-1/+1
| | | | | | | | This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
* [libcxx] [test] Make files consistently end with newlines, NFC.Stephan T. Lavavej2017-07-291-1/+1
| | | | llvm-svn: 309465
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-2918-234/+234
| | | | llvm-svn: 309464
* Add asserts that the nullptr is maintained in string erase operations.Billy Robert O'Neal III2017-05-254-0/+6
| | | | llvm-svn: 303899
* Remove non-standard basic_string_view::clear() member.Eric Fiselier2017-05-121-67/+0
| | | | | | | | This patch removes the clear() member from <string_view>. The modifier was removed from the TS before it ever landed in the standard. There is no reason libc++ should be providing this method. llvm-svn: 302869
* Fix possible loss of data warnings on amd64Billy Robert O'Neal III2017-05-081-8/+10
| | | | | | | | | | | | | In T_size_size.pass, there is an explicit template argument to std::min to ask for unsigned, to avoid type deduction errors. However, C1XX' warnings still hate this use, because a 64 bit value (a size_t) is being passed to a function accepting an unsigned (a 32 bit value). Instead, change the tests to pass around std::size_t instances, and explicitly narrow when constructing the string type under test. This also allows removal of explicit template arguments to std::min. llvm-svn: 302473
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-046-10/+21
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* Resolve unused local typedef warning in test.Billy Robert O'Neal III2017-04-211-1/+0
| | | | llvm-svn: 300937
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.Eric Fiselier2017-04-199-243/+236
| | | | llvm-svn: 300633
* Fix PR32642 - string::insert and string::append don't work with move_iterator.Eric Fiselier2017-04-152-4/+45
| | | | llvm-svn: 300397
* Implement P0599: 'noexcept for hash functions'. Fix a couple of hash ↵Marshall Clow2017-03-232-0/+7
| | | | | | functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234 llvm-svn: 298573
* Implement LWG#2761: 'basic_string should require that charT match ↵Marshall Clow2017-03-152-1/+25
| | | | | | traits::char_type'. Tests for string_view, too llvm-svn: 297872
* Add deployment knobs to tests (for Apple platforms)Mehdi Amini2017-03-155-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests for libc++ specify -target on the command-line to the compiler, but this is problematic for a few reasons. Firstly, the -target option isn't supported on Apple platforms. Parts of the triple get dropped and ignored. Instead, software should be compiled with a combination of the -arch and -m<name>-version-min options. Secondly, the generic "darwin" target references a kernel version instead of a platform version. Each platform has its own independent versions (with different versions of libc++.1.dylib), independent of the version of the Darwin kernel. This commit adds support to the LIT infrastructure for testing against Apple platforms using -arch and -platform options. If the host is not on OS X, or the compiler type is not clang or apple-clang, then this commit has NFC. If the host is on OS X and --param=target_triple=... is specified, then a warning is emitted to use arch and platform instead. Besides the warning, there's NFC. If the host is on OS X and *no* target-triple is specified, then use the new deployment target logic. This uses two new lit parameters, --param=arch=<arch> and --param=platform=<platform>. <platform> has the form <name>[<version>]. By default, arch is auto-detected from clang -dumpmachine, and platform is "macosx". If the platform doesn't have a version: For "macosx", the version is auto-detected from the host system using sw_vers. This may give a different version than the SDK, since new SDKs can be installed on older hosts. Otherwise, the version is auto-detected from the SDK version using xcrun --show-sdk-path. -arch <arch> -m<name>-version-min=<version> is added to the compiler flags. The target triple is computed as <arch>-apple-<platform>. It is *not* passed to clang, but it is available for XFAIL and UNSUPPORTED (as is with_system_cxx_lib=<target>). For convenience, apple-darwin and <arch>-apple-darwin are added to the set of available features. There were a number of tests marked to XFAIL on x86_64-apple-darwin11 and x86_64-apple-darwin12. I updated these to x86_64-apple-macosx10.7 and x86_64-apple-macosx10.8. llvm-svn: 297798
* Work around test failure on 32 bit OS XEric Fiselier2017-03-021-6/+13
| | | | llvm-svn: 296840
* Remove XFAIL in implicit_deduction_guides testsSteven Wu2017-02-272-8/+0
| | | | | | | | The clang assertion causing these tests failing with sanitizer is fixed in r295794. All the bots running libcxx tests should be upgraded and running the compiler with the fix. llvm-svn: 296385
* Remove dead code in testEric Fiselier2017-02-171-2/+0
| | | | llvm-svn: 295423
* add implicit deduction guide tests for string_viewEric Fiselier2017-02-171-0/+71
| | | | llvm-svn: 295422
* Work around Clang assertion when testing C++17 deduction guides with '-g'.Eric Fiselier2017-02-171-0/+4
| | | | llvm-svn: 295417
* [libc++] Fix PR 31938 - std::basic_string constructors use non-deductible ↵Eric Fiselier2017-02-171-0/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parameter types. Summary: This patch fixes http://llvm.org/PR31938. The description below is copy/pasted from the bug: The standard says: template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>> class basic_string { using value_type = typename traits::char_type; // ... basic_string(const charT* s, const Allocator& a = Allocator()); }; libc++ actually chooses to declare the constructor as basic_string(const value_type* s, const Allocator& a = Allocator()); The implicit deduction guides from class template argument deduction make what was previously an implementation detail visible: std::basic_string s = "foo"; // error, can't deduce charT. The constructor in question is in the libc++ DSO, but fortunately it looks like fixing this will not result in an ABI break. @rsmith How does this look? I did more than just the constructors mentioned in the PR, but IDK how far to take it. Reviewers: mclow.lists, rsmith Reviewed By: rsmith Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D29863 llvm-svn: 295393
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-02-051-3/+3
| | | | | | No functional change, no code review. llvm-svn: 294161
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.Stephan T. Lavavej2017-02-051-4/+5
| | | | | | | | | | | | | | | | test/std/strings/string.classes/typedefs.pass.cpp Actually test what basic_string's typedefs stand for. test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp NotDerived and ND were completely unused. test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp P2 was mistakenly not being used. Yes, that's right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING! Fixes D29137. llvm-svn: 294156
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.Stephan T. Lavavej2017-02-055-13/+0
| | | | | | | | These typedefs were completely unused. Fixes D29136. llvm-svn: 294155
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.Stephan T. Lavavej2017-02-052-2/+6
| | | | | | | | | | | | | | | | | Guard typedefs and static_asserts with _LIBCPP_VERSION. test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp Additionally deal with conditional compilation. test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp Additionally deal with typedefs used by other typedefs. Fixes D29135. llvm-svn: 294154
* Fix up some no-exception compile failuresMarshall Clow2017-01-311-11/+11
| | | | llvm-svn: 293623
* Workaround new -Wshadow warning introduced by r293599Alex Lorenz2017-01-311-1/+1
| | | | llvm-svn: 293619
* Fix PR#31779: basic_string::operator= isn't exception safe.Marshall Clow2017-01-311-0/+81
| | | | llvm-svn: 293599
* A couple more tests for constexpr stuff in string_view. No changes other ↵Marshall Clow2017-01-242-0/+38
| | | | | | than test code. llvm-svn: 292943
* Implement LWG#2778: basic_string_view is missing constexpr.Marshall Clow2017-01-231-0/+50
| | | | llvm-svn: 292823
OpenPOWER on IntegriCloud