summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Flag file_clock test as expected to fail with ASANLouis Dionne2019-03-191-0/+4
| | | | | | | This silences a known issue, as can be seen by looking at similar tests for other clocks, like time.clock.steady/consistency.pass.cpp. llvm-svn: 356528
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-197-17/+0
| | | | | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Unlike the previous attempt (r356500), this doesn't remove all the filesystem tests. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356518
* Revert "[libc++] Build <filesystem> support as part of the dylib"Louis Dionne2019-03-19153-0/+14187
| | | | | | | | When I applied r356500 (https://reviews.llvm.org/D59152), I somehow deleted all of filesystem's tests. I will revert r356500 and re-apply it properly. llvm-svn: 356505
* Fix char.traits.specializations.char8_t main returnJF Bastien2019-03-194-0/+4
| | | | llvm-svn: 356504
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-19153-14187/+0
| | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356500
* Fix fenv.pass.cpp signature for mainJF Bastien2019-03-191-3/+1
| | | | | | And make main return. llvm-svn: 356493
* Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. ↵Marshall Clow2019-03-198-19/+68
| | | | | | These are just rebranded 'operator[]', and should be noexcept like it is. llvm-svn: 356435
* Remove unused try catch blocks from old debug testsEric Fiselier2019-03-191-26/+14
| | | | llvm-svn: 356429
* Fix test failures after debug mode changesEric Fiselier2019-03-181-3/+3
| | | | llvm-svn: 356421
* Remove exception throwing debug mode handler support.Eric Fiselier2019-03-1815-566/+789
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The reason libc++ implemented a throwing debug mode handler was for ease of testing. Specifically, I thought that if a debug violation aborted, we could only test one violation per file. This made it impossible to test debug mode. Which throwing behavior we could test more! However, the throwing approach didn't work either, since there are debug violations underneath noexcept functions. This lead to the introduction of `_NOEXCEPT_DEBUG`, which was only noexcept when debug mode was off. Having thought more and having grown wiser, `_NOEXCEPT_DEBUG` was a horrible decision. It was viral, it didn't cover all the cases it needed to, and it was observable to the user -- at worst changing the behavior of their program. This patch removes the throwing debug handler, and rewrites the debug tests using 'fork-ing' style death tests. Reviewers: mclow.lists, ldionne, thomasanderson Reviewed By: ldionne Subscribers: christof, arphaman, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D59166 llvm-svn: 356417
* [libc++] Add a test for PR40977Louis Dionne2019-03-181-0/+34
| | | | | | | Even though the header makes the exact same check since https://llvm.org/D59063, the headers could conceivably change in the future and introduce a bug. llvm-svn: 356376
* Update a deque test with more assertions. NFCMarshall Clow2019-03-151-6/+6
| | | | llvm-svn: 356266
* Mark vector::operator[] and front/back as noexcept. We already do this for ↵Marshall Clow2019-03-152-0/+122
| | | | | | string and string_view. This should give better codegen inside of noexcept functions. Add tests for op[]/front/back/at, because apparently we had none. llvm-svn: 356224
* XFAIL this debug-mode test that I just broke. Eric has a patch out for ↵Marshall Clow2019-03-141-1/+1
| | | | | | review (D59166) that rewrites this test completely, so I'm not going to bother fixing it. llvm-svn: 356211
* Add noexcept to operator[] for array and deque. This is an extension. We ↵Marshall Clow2019-03-142-4/+29
| | | | | | already do this for string and string_view. This should give better codegen inside of noexcept functions. llvm-svn: 356209
* Reorg the midpoint pointer test into runtime and constexpr tests; comment ↵Marshall Clow2019-03-141-10/+40
| | | | | | out the volatile constexpr tests for GCC because our experimental gcc bot barfs on them. llvm-svn: 356177
* Fix two of the three bot failures for midpoint; the ones regarding the lack ↵Marshall Clow2019-03-142-2/+8
| | | | | | of '__int128_t' llvm-svn: 356169
* Add std::midpoint for integral and poiner types. Described in P0811, ↵Marshall Clow2019-03-144-0/+287
| | | | | | reviewed as D59099. llvm-svn: 356162
* Properly constrain basic_string(Iter, Iter, Alloc = A())Eric Fiselier2019-03-141-0/+9
| | | | llvm-svn: 356140
* [libc++] Enable deprecation warnings by defaultLouis Dionne2019-03-1285-31/+148
| | | | | | | | | | | | | | | | | | | Summary: In r342843, I added deprecation warnings to some facilities that were deprectated in C++14 and C++17. However, those deprecation warnings were not enabled by default. After discussing this on IRC, we had finally gotten consensus to enable those warnings by default, and I'm getting around to doing that only now. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58140 llvm-svn: 355961
* Allow optional to tolerate being used with a nested class.Eric Fiselier2019-03-111-0/+41
| | | | | | | | | | | | | | | When Clang tries to complete a type containing `std::optional` it considers the `in_place_t` constructor with no arguments which checks if the value type is default constructible. If the value type is a nested class type, then this check occurs too early and poisons the is_default_constructible trait. This patch makes optional deduce `in_place_t` so we can prevent this early SFINAE evaluation. Technically this could break people doing weird things with the in_place_t tag, but that seems less important than making the nested class case work. llvm-svn: 355877
* Fix PR41017 - Build failure with _LIBCPP_DEBUG=0 and non-const-refEric Fiselier2019-03-081-2/+27
| | | | | | | | | | | comparator for std::sort() Our debug comparator assumed that the comparator it wraps would always accepts the values by const ref. This isn't required by the standard. This patch makes our __debug_less comparator forward the constness. llvm-svn: 355752
* [libc++] Fix use-after-free when building with _LIBCPP_DEBUG=1Thomas Anderson2019-03-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | The issue is the following code: __cn1->__add(*__ip); (*__ip)->__c_ = __cn1; `__ip` points into the array of iterators for container `__cn2`. This code adds the iterator to the array of iterators for `__cn1`, and updates the iterator to point to the new container. This code works fine, except when `__cn1` and `__cn2` are the same container. `__cn1->__add()` might need to grow the array of iterators, and when it does, `__ip` becomes invalid, so the second line becomes a use-after-free error. Simply swapping the order of the above two lines is not sufficient, because of the memmove() below. The easiest and most performant solution is just to skip touching any iterators if the containers are the same. Differential Revision: https://reviews.llvm.org/D58926 llvm-svn: 355550
* Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple ↵Marshall Clow2019-03-0611-26/+26
| | | | | | of other minor cleanups. NFC llvm-svn: 355481
* Reinstate libc++ patches now that the lldb formatter has been updated.Davide Italiano2019-03-053-25/+49
| | | | | | | | "[libc++] Fix <atomic> failures on GCC" "[libc++] Change memory_order to an enum class" "[libc++] decoupling Freestanding atomic<T> from libatomic.a" llvm-svn: 355427
* [libcxx] Revert set of atomic patches that broke lldb.Davide Italiano2019-03-053-49/+25
| | | | | | | | | | | Revert "[libc++] Fix <atomic> failures on GCC" Revert "[libc++] Change memory_order to an enum class" Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a" The lldb formatter nededs to be updated. Shafik and Louis will coordinate to do so. llvm-svn: 355417
* [libc++] Fix <atomic> failures on GCCLouis Dionne2019-03-051-17/+17
| | | | | | | | | | | | | | | | Summary: In https://reviews.llvm.org/D58201, we turned memory_order into an enum class in C++20 mode. However, we were not casting memory_order to its underlying type correctly for the GCC implementation, which broke the build bots. I also fixed a test that was failing in C++17 mode on GCC 5. Reviewers: EricWF, jfb, mclow.lists Subscribers: zoecarver Differential Revision: https://reviews.llvm.org/D58966 llvm-svn: 355409
* [libc++] Change memory_order to an enum classLouis Dionne2019-03-052-8/+32
| | | | | | | | | This implements P0439R0. Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58201 llvm-svn: 355403
* Fix -fsanitize=vptr badness in <__debug>Eric Fiselier2019-03-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a lifetime bug when inserting a new container into the debug database. It is diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed during insertion. The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI stability from debug mode. Reviewers: ldionne, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: mclow.lists, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58011 llvm-svn: 355367
* [libc++] Fix forgotten fclose() in unit testLouis Dionne2019-03-011-0/+1
| | | | | | | Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58732 llvm-svn: 355162
* [libc++] Increase portability of xalloc testLouis Dionne2019-03-011-5/+3
| | | | | | | | | | Do not assume that xalloc() starts at 0, which is not specified by the Standard. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58299 llvm-svn: 355160
* [libc++] Add is_nothrow_convertible from P0758R1Louis Dionne2019-02-271-0/+58
| | | | | | | Reviewed as https://reviews.llvm.org/D58019. Thanks to Zoe Carver for the patch. llvm-svn: 355010
* Implment the last part of P1024: tuple-like interface to span. Reviewed as ↵Marshall Clow2019-02-276-0/+248
| | | | | | https://reviews.llvm.org/D58706. llvm-svn: 354988
* 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
* Fix an ambiguity in the tests that gcc-tot complained about.Marshall Clow2019-02-2711-22/+22
| | | | llvm-svn: 354944
* [libc++] Add a test for PR14074Louis Dionne2019-02-271-0/+62
| | | | | | PR14074 was fixed in r165884, but no tests were added. llvm-svn: 354943
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-2736-0/+179
| | | | | | | | | | | | | | | 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
* First part of P1227R2 - change span over to use 'size_t' instead of ↵Marshall Clow2019-02-275-18/+18
| | | | | | 'ptrdiff_t'. Reviewed as https://reviews.llvm.org/D58639. llvm-svn: 354936
* [libc++] Add <filesystem> to the min-mac macro header testLouis Dionne2019-02-261-0/+2
| | | | llvm-svn: 354932
* Implement P1357: Traits for [Un]bounded Arrays; adopted in KonaMarshall Clow2019-02-262-0/+142
| | | | llvm-svn: 354891
* LWG3101 - span's Container constructors need another constraint. Reviewed as ↵Marshall Clow2019-02-252-50/+10
| | | | | | https://reviews.llvm.org/D57058. llvm-svn: 354805
* Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.Marshall Clow2019-02-251-0/+4
| | | | llvm-svn: 354802
* First part of P1024: Usability Enhancements for std::span. Remove operator() ↵Marshall Clow2019-02-253-8/+154
| | | | | | for indexing, and add 'front' and 'back' calls. llvm-svn: 354801
* [libcxx] Make sure all experimental tests are disabled when ↵Louis Dionne2019-02-2332-30/+6
| | | | | | | | | | | | | | | | enable_experimental=False Summary: Previously, we'd run some experimental tests even when enable_experimental=False was used with lit. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D55834 llvm-svn: 354725
* [NFC] Fix incorrect comment in std::function testLouis Dionne2019-02-211-1/+1
| | | | llvm-svn: 354537
* [libcxx] Do not assume the number of elements in a moved-from associative ↵Louis Dionne2019-02-134-12/+24
| | | | | | | | | container Reviewed as https://reviews.llvm.org/D57903. Thanks to Andrey Maksimov for the patch. llvm-svn: 353955
* [libc++] Avoid UB in the no-exceptions mode in a few placesLouis Dionne2019-02-128-0/+276
| | | | | | | | | | | | | | | | | | | | | | | Summary: A few places in the library seem to behave unexpectedly when the library is compiled or used with exceptions disabled. For example, not throwing an exception when a pointer is NULL can lead us to dereference the pointer later on, which is UB. This patch fixes such occurences. It's hard to tell whether there are other places where the no-exceptions mode misbehaves like this, because the replacement for throwing an exception does not always seem to be abort()ing, but at least this patch will improve the situation somewhat. See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D57761 llvm-svn: 353850
* Add fenv.h headerEric Fiselier2019-02-114-11/+32
| | | | | | | | | | | | | | | | | Summary: Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source. This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions. Reviewers: rsmith, mclow.lists, ldionne Reviewed By: rsmith Subscribers: mgorny, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D57729 llvm-svn: 353767
* Update some newly added files that mistakenly used the old file headerChandler Carruth2019-02-112-8/+6
| | | | | | to the new one. llvm-svn: 353668
* Mark another test as flakyKamil Rytarowski2019-02-091-0/+2
| | | | | | Reported on the NetBSD buildbot. llvm-svn: 353622
OpenPOWER on IntegriCloud