summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings
Commit message (Collapse)AuthorAgeFilesLines
* [libc++][P0980] Marked member functions move/copy/assign of char_traits ↵Michael Park2019-11-1115-15/+180
| | | | | | | | | | | | | | constexpr. Reviewers: ldionne, EricWF, mclow.lists Reviewed By: ldionne Subscribers: christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68840
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-235-6/+6
|
* [libc++][NFC] Remove excess trailing newlines from most filesCasey Carter2019-10-231-1/+0
| | | | Testing git commit access.
* [libcxx][test][NFC] Fix comment typos.Stephan T. Lavavej2019-10-225-9/+9
| | | | (Testing git commit access.)
* Add forward declaration of operator<< in <string_view> as required.Eric Fiselier2019-09-251-0/+26
| | | | | | | | This declaration was previously missing despite appearing in the synopsis. Users are still required to include <ostream> to get the definition of the streaming operator. llvm-svn: 372909
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-2149-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Followup to revision 364545: Turns out that clang issues different errors ↵Marshall Clow2019-06-272-2/+2
| | | | | | for C++11 vs c++2a, so I tweaked the 'expected-error' bits that I added to match either of them. llvm-svn: 364554
* Provide hashers for string_view only if they are using the default ↵Marshall Clow2019-06-272-1/+68
| | | | | | char_traits. Seen on SO: test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp llvm-svn: 364545
* [libc++] Add missing #include in <cwchar> testsLouis Dionne2019-06-131-0/+1
| | | | | | | Thanks to Mikhail Maltsev for the patch. Differential Revision: https://reviews.llvm.org/D63289 llvm-svn: 363290
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-31162-0/+223
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Ensure that hash<basic_string> uses char_traits. Fixes PR#41876. Reviewed as ↵Marshall Clow2019-05-201-0/+66
| | | | | | https://reviews.llvm.org/D61954 llvm-svn: 361201
* Get rid of a bunch of 'unused variable' warnings in test when run with ↵Marshall Clow2019-05-015-4/+8
| | | | | | debug_level set. NFC llvm-svn: 359672
* Fix a one more compare test that assumed -1/0/1 instsad of <0/0/>0. NFC.Marshall Clow2019-04-241-1/+1
| | | | llvm-svn: 359106
* Fix a couple of tests that assumed that compare retunred -1/0/1 instead of ↵Marshall Clow2019-04-244-7/+7
| | | | | | <0/0/>0. Thanks to Jonathan Wakely for the report. llvm-svn: 359104
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-053-2/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-application of r357533 and r357531. They had been reverted because we thought the commits broke the LLDB data formatters, but it turns out this was because only r357531 had been included in the CI run. Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. This effectively implements the wording in p1264r0. It hasn't been voted into the Standard yet, however there is wide agreement that the fix is correct and it's just a matter of time before the fix is standardized. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357775
* [libcxx] [test] Add missing <stdexcept> to name std::out_of_range to ↵Billy Robert O'Neal III2019-04-031-2/+3
| | | | | | string.conversions\stold.pass.cpp. llvm-svn: 357547
* [libcxx] [test] Fix test bugs in string.cons/copy_alloc.pass.cpp.Billy Robert O'Neal III2019-04-031-6/+7
| | | | | | | | | | | | | | Fixed the inability to properly rebind the testing allocator, by making the inner alloc_impl type a plain struct and making the operations templates. Before rebind failed to compile complaining that a alloc_impl<T>* was not convertible to an alloc_impl<U>*. This enables the test to pass for MSVC++ once we provide the strong guarantee for the copy assignment operator. Reviewed as https://reviews.llvm.org/D60023 llvm-svn: 357545
* Revert "[libc++] Fix error flags and exceptions propagated from input stream ↵Louis Dionne2019-04-023-200/+2
| | | | | | | | | | operations" This reverts commits r357533 and r357531, which broke the LLDB data formatters. I'll hold off until we know how to fix the data formatters accordingly. llvm-svn: 357536
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-023-2/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. I will submit a paper in San Diego to clarify the Standard such that the interpretation used in this commit (and other implementations) is the only possible one. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357531
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-282-3/+0
| | | | | | | Some tests #include <iostream> but they don't use anything from the header. Those are probably artifacts of when the tests were developped. llvm-svn: 357181
* Fix char.traits.specializations.char8_t main returnJF Bastien2019-03-194-0/+4
| | | | llvm-svn: 356504
* Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. ↵Marshall Clow2019-03-196-3/+28
| | | | | | These are just rebranded 'operator[]', and should be noexcept like it is. llvm-svn: 356435
* Properly constrain basic_string(Iter, Iter, Alloc = A())Eric Fiselier2019-03-141-0/+9
| | | | llvm-svn: 356140
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-2734-0/+170
| | | | | | | | | | | | | | | 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-04424-443/+1293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-19426-1704/+1278
| | | | | | | | | | | | | | | | | | 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
* Portability fix: add missing includes and static_casts. Reviewed as ↵Marshall Clow2018-12-183-0/+3
| | | | | | https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch. llvm-svn: 349566
* Rework the C strings tests to use ASSERT_SAME_TYPE. NFC there. Also change ↵Marshall Clow2018-12-185-135/+148
| | | | | | cwchar.pass.cpp to avoid constructing a couple things from zero - since apparently they can be enums in some weird C library. NFC there, either, since the values were never used. llvm-svn: 349522
* Implement P1209 - Adopt Consistent Container Erasure from Library ↵Marshall Clow2018-12-142-0/+152
| | | | | | Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532 llvm-svn: 349178
* [libcxx] Fix test on compilers that do not support char8_t yetLouis Dionne2018-12-111-2/+4
| | | | llvm-svn: 348846
* Fix problems with char8_t stuff on compilers that don't support char8_t yetMarshall Clow2018-12-111-2/+4
| | | | llvm-svn: 348829
* Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308Marshall Clow2018-12-1134-92/+726
| | | | llvm-svn: 348828
* Implement P0966 - string::reserve should not shrinkMarshall Clow2018-11-281-1/+8
| | | | llvm-svn: 347789
* A couple of tests were broken when clang implemented the compiler parts of ↵Marshall Clow2018-11-202-0/+34
| | | | | | P0482 (support for char8_t). Comment out those bits until we implement the corresponding bits in libc++ llvm-svn: 347360
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-11-142-2/+2
| | | | llvm-svn: 346826
* [libcxx] [test] Add missing <stdexcept> in several tests.Billy Robert O'Neal III2018-08-0813-0/+13
| | | | | | Reviewed as https://reviews.llvm.org/D50420 llvm-svn: 339209
* Turns out that wide literals U"xxx" and u"xxx" are c++11 and later.Marshall Clow2018-07-121-0/+2
| | | | llvm-svn: 336880
* Same reversed ifdef happened twice. Test fix only, NFC to the library.Marshall Clow2018-07-111-1/+1
| | | | llvm-svn: 336856
* Fix a test #ifdef that was reversed. NFC to the library.Marshall Clow2018-07-111-1/+1
| | | | llvm-svn: 336855
* Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616Marshall Clow2018-07-0225-40/+454
| | | | llvm-svn: 336132
* [libcxx] [test] Mark the test as unsupported by apple-clang-8.1.Volodymyr Sapsai2018-05-221-1/+1
| | | | llvm-svn: 333011
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-04-121-13/+13
| | | | | | test/std almost always uses spaces; now it is entirely tab-free. llvm-svn: 329978
* Implement LWG3034: P0767R1 breaks previously-standard-layout typesMarshall Clow2018-03-212-0/+106
| | | | llvm-svn: 328064
* [libcxx][test] Adding apple-clang-9 to UNSUPPORTED in ↵Mike Edwards2018-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | iter_alloc_deduction.fail.cpp. After two failed attempts last week to make this work I am going back to a known good method of making this test pass on macOS...adding the current apple-clang version to the UNSUPPORTED list. During a previous patch review (https://reviews.llvm.org/D44103) it was suggested to just XFAIL libcpp-no-deduction-guides as was done to iter_alloc_deduction.pass.cpp. However this caused a an unexpected pass on: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc-tot-latest-std/builds/214 I then attempted to just mark libcpp-no-deduction-guides as UNSUPPORTED, however this caused an additional bot failure. So I reverted everything (https://reviews.llvm.org/rCXX327191). To solve this and get work unblocked I am adding apple-clang-9 to the original UNSUPPORTED list. llvm-svn: 327304
* [libcxx][test] Reverting r327178 and r327190.Mike Edwards2018-03-101-1/+2
| | | | | | | Reverting changes made to iter_alloc_deduction.fail.cpp as my changes seem to be making several Linux bots angry. llvm-svn: 327191
* [libcxx][test] Marking libcpp-no-deduction-guides unsupported.Mike Edwards2018-03-101-1/+1
| | | | | | This fixes linux bot failures with r327178. llvm-svn: 327190
* XFAIL: libcpp-no-deduction-guides in ↵Mike Edwards2018-03-091-2/+1
| | | | | | | | | | | | | | | | libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp Summary: Refactor the previous version method of marking each apple-clang version as UNSUPPORTED and just XFAIL'ing the libcpp-no-deduction-guides instead. This brings this test inline with the same style as iter_alloc_deduction.pass.cpp Reviewers: EricWF, dexonsmith Reviewed By: EricWF Subscribers: EricWF, vsapsai, vsk, cfe-commits Differential Revision: https://reviews.llvm.org/D44103 llvm-svn: 327178
* [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
* Add another test case to the deduction guide for basic_string.Marshall Clow2018-02-221-0/+11
| | | | llvm-svn: 325740
* Fix test failure on compilers w/o deduction guidesEric Fiselier2018-02-151-2/+1
| | | | llvm-svn: 325205
OpenPOWER on IntegriCloud