summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/iterators
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Add C++20 contiguous_iterator_tag.Eric Fiselier2019-11-162-1/+35
| | | | | This work is part of an ongoing effort to allow libc++ to optimize user provided contiguous iterators.
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-231-1/+1
|
* [libc++][NFC] Remove excess trailing newlines from most filesCasey Carter2019-10-231-1/+0
| | | | Testing git commit access.
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-252-6/+0
| | | | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. This is a re-application of r372787. llvm-svn: 372916
* Revert r372777: [libc++] Implement LWG 2510 and its follow-upsIlya Biryukov2019-09-252-0/+6
| | | | | | | | | | | | This also reverts: - r372778: [libc++] Implement LWG 3158 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older - r372787: Purge mentions of GCC 4 from the test suite Reason: the change breaks compilation of LLVM with libc++, for details see http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html llvm-svn: 372832
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-242-6/+0
| | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. llvm-svn: 372787
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-2117-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Suppress -Wctad-maybe-unsupported on types w/o deduction guides."Eric Fiselier2019-08-041-41/+0
| | | | | | | | | Some modules builds are issuing buggy diagnostics. The cause of which is TBD. This reverts commit r@367770. llvm-svn: 367777
* Suppress -Wctad-maybe-unsupported on types w/o deduction guides.Eric Fiselier2019-08-031-0/+41
| | | | | | | | | | | There are a handful of standard library types that are intended to support CTAD but don't need any explicit deduction guides to do so. This patch adds a dummy deduction guide to those types to suppress -Wctad-maybe-unsupported (which gets emitted in user code). llvm-svn: 367770
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3173-0/+141
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Fix a minor bug with std::next and prev not and negative numbers. In ↵Marshall Clow2019-03-222-13/+23
| | | | | | particular, std::prev cannot require Bidirectional Iterators, because you might 'go back' -1 places, which goes forward. Thanks to Ville and Jonathan for the bug report. llvm-svn: 356818
* Implement the second part of P1227R2 - Signed ssize() functions. Reviewed as ↵Marshall Clow2019-02-272-10/+128
| | | | | | https://reviews.llvm.org/D58642 llvm-svn: 354950
* Support tests in freestandingJF Bastien2019-02-04175-175/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-19175-700/+525
| | | | | | | | | | | | | | | | | | 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
* [libc++] Support different libc++ namespaces in the iterator testPetr Hosek2019-01-151-30/+30
| | | | | | | | | libc++ allows changing the namespace, don't assume __1 in the test to avoid the test failure if different namespace is being used. Differential Revision: https://reviews.llvm.org/D56698 llvm-svn: 351220
* Fix PR39619 - iterator_traits isn't SFINAE-friendly enough. Thanks to Eric ↵Marshall Clow2018-11-132-0/+123
| | | | | | for the report llvm-svn: 346738
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-05-051-8/+8
| | | | | | Strip trailing whitespace and untabify. llvm-svn: 331576
* Move old test into test/libcxx, and implement new version of test for ↵Marshall Clow2018-04-261-2/+15
| | | | | | ostreambuf_iterator::failed. Fixes PR#37245. Thanks to Billy O'Neill for the bug report. llvm-svn: 330955
* [libcxx] [test] Use TEST_COMPILER_C1XX.Stephan T. Lavavej2018-04-121-2/+4
| | | | | | Also TEST_COMPILER_CLANG in one place. (More could be changed.) llvm-svn: 329977
* Add tests to make sure that <string_view> provides std::size/data/empty in ↵Marshall Clow2018-01-303-1/+31
| | | | | | 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
* [libcxx] Define istream_iterator equality comparison operators out-of-lineRoger Ferrer Ibanez2017-12-111-0/+3
| | | | | | | | | | | | | | | | | Currently libc++ defines operator== and operator!= as friend functions in the definition of the istream_iterator class template. Such definition has a subtle difference from an out-of-line definition required by the C++ Standard: these functions can only be found by argument-dependent lookup, but not by qualified lookup. This patch changes the definition, so that it conforms to the C++ Standard and adds a check involving qualified lookup to the test suite. Patch contributed by Mikhail Maltsev. Differential Revision: https://reviews.llvm.org/D40415 llvm-svn: 320363
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-214-9/+11
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-153-0/+84
| | | | | | 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
* Clean up the tests for free data(), size() and empty()Marshall Clow2017-11-153-24/+28
| | | | llvm-svn: 318313
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-152-4/+4
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* Another test for LWG2952Marshall Clow2017-11-141-0/+28
| | | | llvm-svn: 318126
* Implement LWG2952: iterator_traits should work for pointers to cv TMarshall Clow2017-11-141-0/+28
| | | | llvm-svn: 318119
* Change test suite to support c++17 dialect flag instead of c++1z.Eric Fiselier2017-11-071-1/+1
| | | | | | | | This patch changes the test suite to attempt and prefer -std=c++17 over -std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers to refer to c++17 over c++1z. llvm-svn: 317610
* Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer2017-10-144-0/+8
| | | | | | -Wunused-variable llvm-svn: 315809
* [libcxx] [test] Rename _Up to U, etc. NFCI.Stephan T. Lavavej2017-08-111-2/+2
| | | | | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. This performs additional de-uglification, so all of these tests follow the example of iterator.traits/empty.pass.cpp. llvm-svn: 310761
* [libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej2017-08-111-2/+2
| | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
* [libcxx] [test] Consistently list "c++98, c++03" in chronological order. NFC.Stephan T. Lavavej2017-08-051-1/+1
| | | | llvm-svn: 310155
* [libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-2917-17/+17
| | | | | | | | 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] Untabify, NFC.Stephan T. Lavavej2017-07-291-16/+16
| | | | llvm-svn: 309464
* Remove addtional parameters in function std::next() and std::prev()Rachel Craik2017-07-242-0/+6
| | | | | | | | | | | Creating a function pointer with proper parameters pointing to std::next() or std::prev() should work. This change moves the invented paramater for enable_if over to the return type to resolve this QoI issue. Patch by Jason Liu. Differential Revision: https://reviews.llvm.org/D34649 llvm-svn: 308932
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-06-202-2/+2
| | | | llvm-svn: 305848
* Implement LWG#2790: Remove istreambuf_iterator::operator->. It never did ↵Marshall Clow2017-05-231-28/+0
| | | | | | anything useful. llvm-svn: 303675
* Make next/prev/advance/distance operations on iterators be constexpr. I ↵Marshall Clow2017-05-174-3/+116
| | | | | | missed this when I implemented the rest of P0031R0 llvm-svn: 303281
* [libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance ↵Stephan T. Lavavej2017-05-053-0/+54
| | | | | | | | | | | shouldn't be mandated". In C++17, these iterators are allowed but not required to inherit from the deprecated std::iterator base class. Fixes D32727. llvm-svn: 302318
* Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCESEric Fiselier2017-03-033-18/+6
| | | | llvm-svn: 296854
* Recommit r296712: "Fix Apple-specific XFAIL directive in libc++ test"Mehdi Amini2017-03-021-1/+1
| | | | | | | | The test is passing with c++11 and c++14 but not c++1z on this particular version of the compiler. Try to use lit boolean condition to satisfy this constaint. llvm-svn: 296725
* Revert "Fix Apple-specific XFAIL directive in libc++ test"Mehdi Amini2017-03-021-1/+1
| | | | | | | | | | | This reverts commit r296712. It broke our bot. It turns out that the test is passing with c++11 and c++14 but not c++1z on this particular version of the compiler. Since one job is defaulting to c++1z and the other is testing all config I'm not sure how to fix this... llvm-svn: 296724
* Fix Apple-specific XFAIL directive in libc++ testMehdi Amini2017-03-011-1/+1
| | | | | | | | This tests is failing in XCode 7.0. But Xcode 7.3 that shipped an updated clang has this test passing. This is fixing green dragon which runs this configuration. llvm-svn: 296712
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-171-1/+1
| | | | llvm-svn: 295434
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-183-5/+5
| | | | | | No functional change, no code review. llvm-svn: 292434
* [libcxx] [test] Strip trailing whitespace. NFC, no code review.Stephan T. Lavavej2017-01-071-3/+3
| | | | llvm-svn: 291322
* Implement the last bit of P0031: 'A Proposal to Add Constexpr Modifiers to ↵Marshall Clow2017-01-041-6/+62
| | | | | | reverse_iterator, move_iterator, array and Range Access' for C++17 llvm-svn: 290976
* Fix unused warning which only triggers in C++11Eric Fiselier2016-12-241-0/+3
| | | | llvm-svn: 290475
* Fix unused parameters and variablesEric Fiselier2016-12-231-0/+1
| | | | llvm-svn: 290459
* XFAIL test for more apple-clang versionsEric Fiselier2016-12-151-1/+1
| | | | llvm-svn: 289767
OpenPOWER on IntegriCloud