summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Add 'is_always_equal' tests for scoped_allocator. Found that I had typed ↵Marshall Clow2015-06-031-0/+75
| | | | | | '||' where I meant '&&' in the code; fixed that, too llvm-svn: 238931
* Implement the first part of N4258 - allocator_traits<X>::is_always_equal. ↵Marshall Clow2015-06-021-0/+48
| | | | | | Also fixes PR#23723 llvm-svn: 238848
* Implement uncaught_exceptions() using the newly added hooks in libc++abi, ↵Marshall Clow2015-06-021-0/+45
| | | | | | when available llvm-svn: 238846
* Add TODO items and remove use of 'noexcept' in C++03 test.Eric Fiselier2015-06-021-1/+1
| | | | llvm-svn: 238802
* Fix PR#23647 - make_shared<volatile bool> - second tryMarshall Clow2015-05-271-3/+3
| | | | llvm-svn: 238370
* Revert 238354 while I figure out what broke in weak_ptrMarshall Clow2015-05-271-3/+3
| | | | llvm-svn: 238355
* Fix PR#23647 - make_shared<volatile bool>Marshall Clow2015-05-271-0/+61
| | | | llvm-svn: 238354
* Get thread sleep_for test passing in C++03Eric Fiselier2015-05-271-2/+5
| | | | llvm-svn: 238273
* Mark __convert_to_integral test as XFAIL in c++03Eric Fiselier2015-05-271-0/+3
| | | | llvm-svn: 238271
* Cleanup move/forward tests and remove references to __rv.Eric Fiselier2015-05-273-30/+15
| | | | llvm-svn: 238270
* Add test macros header to remove dependance on __config macros.Eric Fiselier2015-05-272-0/+141
| | | | llvm-svn: 238267
* Fix broken test I just addedMarshall Clow2015-05-261-3/+3
| | | | llvm-svn: 238234
* Add tests to ensure that string/vector/array have contiguous iterators - ↵Marshall Clow2015-05-263-0/+124
| | | | | | which they did. Mark N4284 as complete llvm-svn: 238233
* Fix race condition in thread test.Eric Fiselier2015-05-191-8/+25
| | | | llvm-svn: 237745
* Address @danalberts comments on r237700Eric Fiselier2015-05-193-3/+3
| | | | llvm-svn: 237740
* Fix uninitialized values and bad enum conversions found by UBSAN.Eric Fiselier2015-05-194-17/+17
| | | | llvm-svn: 237738
* Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.Eric Fiselier2015-05-194-11/+28
| | | | llvm-svn: 237700
* Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded ↵Marshall Clow2015-05-194-0/+94
| | | | | | operator& llvm-svn: 237699
* mark new/delete tests as XFAIL more carefullyEric Fiselier2015-05-194-10/+20
| | | | llvm-svn: 237664
* [libcxx] Rework sized delete.Eric Fiselier2015-05-1914-516/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch does 2 main things: 1. Enable sized delete if the feature test macro `__cpp_sized_deallocation` is enabled. 2. Rework and cleanup all of the sized delete tests. Test Plan: The sized delete replacement tests are now split into 4 files: 1. sized_delete11.pass.cpp: Ensure overriding sized delete in C++11 has no effect. 2. sized_delete14.pass.cpp: Test overriding sized delete in C++14 and ensure it is called. This test fails on clang and GCC < 5.1. 3. size_delete_calls_unsized_delete_.pass.cpp: Test that the default sized delete calls unsized delete. 4. sized_delete_fsizeddeallocation.pass.cpp: Test overriding sized delete when -fsized-deallocation is passed. This test should pass on clang and GCC >= 5.1 I have also removed a lot of cruft from the old tests. They no longer replace the new handler and tests that it is called for bad allocations. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9831 llvm-svn: 237662
* Add support for N4389 - std::bool_constantMarshall Clow2015-05-181-0/+32
| | | | llvm-svn: 237636
* Fix for LWG Issue 2458: N3778 and new library deallocation signatures.Marshall Clow2015-05-182-218/+0
| | | | llvm-svn: 237592
* libcxx: Enhance lit test command in verbose mode.Logan Chien2015-05-171-5/+8
| | | | | | | Print both the compiler command and linker command so that it will be easier for developers to reproduce the failed test cases. llvm-svn: 237530
* Fix test that was failing on C++03 b/c it was using initializer listsMarshall Clow2015-05-161-2/+2
| | | | llvm-svn: 237527
* Fix build when libunwind is disabled.Logan Chien2015-05-161-0/+1
| | | | | | | | | | The previous commit breaks the builds when libc++abi is not built with libunwind becuase the default value for LIBCXXABI_USE_LLVM_UNWINDER is OFF, which is not pythonized. This CL fix the problem by calling pythonize_bool(). llvm-svn: 237519
* libcxx: Fix ARM libc++/abi and libunwind buildbot.Logan Chien2015-05-161-0/+1
| | | | | | | | | | | | | The test cases were crashing due to the mixed usage of the unwinding functions from both libunwind and libgcc_s. The unwind functions are mixed because the "llvm_unwinder" entry is not available in the lit.site.cfg for libc++. As a result, "-lgcc_s" is picked instead of "-lunwind". The extra option to lit --param=link_flags="-lunwind" won't help either. This CL fix the problem by adding llvm_unwinder to lit.site.cfg.in. llvm-svn: 237518
* Implement std::experimental::sample.Evgeniy Stepanov2015-05-136-0/+276
| | | | | | | Following specification in "C++ Extensions for Library Fundamentals": http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample llvm-svn: 237264
* Fix for LWG Issue 2415: Inconsistency between unique_ptr and shared_ptrMarshall Clow2015-05-102-2/+14
| | | | llvm-svn: 236953
* Fix for LWG Issue 2369: constexpr max(initializer_list) vs max_elementMarshall Clow2015-05-106-0/+89
| | | | llvm-svn: 236952
* Fix for LWG Issue 2059: C++0x ambiguity problem with map::eraseMarshall Clow2015-05-108-0/+180
| | | | llvm-svn: 236950
* Remove some debugging printout lines. No functionality change.Marshall Clow2015-05-101-2/+0
| | | | llvm-svn: 236949
* Fix for LWG2454: Add raw_storage_iterator::base() memberMarshall Clow2015-05-101-0/+48
| | | | llvm-svn: 236948
* Fix some preprocessor directives that were generating warnings in the test ↵Marshall Clow2015-04-282-2/+2
| | | | | | suite. llvm-svn: 235999
* Remove constexpr support for std::apply because it introduces regressions.Eric Fiselier2015-04-192-0/+8
| | | | llvm-svn: 235274
* A few bits of N2994 didn't get fully implemented a long time ago. Thanks to ↵Marshall Clow2015-04-166-9/+80
| | | | | | STL@microsoft.com for the bug report llvm-svn: 235134
* Qualify an internal call in is_assignable to prevent ADL lookup, which would ↵Marshall Clow2015-04-141-0/+6
| | | | | | 'complete' an type definition unnecessarily. Thanks to Richard Smith for the report. llvm-svn: 234886
* Fix race conditions in test class used throughout the std::thread tests.Eric Fiselier2015-04-0210-15/+34
| | | | | | | | | | | The test class 'G' reads and writes to the same static variables in its constructor, destructor and call operator. When threads are constructed using `std::thread t((G()))` there is a race condition between the destruction of the temporary and the execution of `G::operator()()`. The fix is to simply create the input before creating the thread. llvm-svn: 233946
* [libcxx] Fix bug in shared_timed_mutex that could cause a program to hang.Eric Fiselier2015-04-021-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The summary of the bug, provided by Stephan T. Lavavej: In shared_timed_mutex::try_lock_until() (line 195 in 3.6.0), you need to deliver a notification. The scenario is: * There are N threads holding the shared lock. * One thread calls try_lock_until() to attempt to acquire the exclusive lock. It sets the "I want to write" bool/bit, then waits for the N readers to drain away. * K more threads attempt to acquire the shared lock, but they notice that someone said "I want to write", so they block on a condition_variable. * At least one of the N readers is stubborn and doesn't release the shared lock. * The wannabe-writer times out, gives up, and unsets the "I want to write" bool/bit. At this point, a notification (it needs to be notify_all) must be delivered to the condition_variable that the K wannabe-readers are waiting on. Otherwise, they can block forever without waking up. Reviewers: mclow.lists, jyasskin Reviewed By: jyasskin Subscribers: jyasskin, cfe-commits Differential Revision: http://reviews.llvm.org/D8796 llvm-svn: 233944
* Remove statement with no effect inside tests.Eric Fiselier2015-04-012-2/+0
| | | | llvm-svn: 233816
* [libcxx] Add code coverage configuration to CMake and LIT.Eric Fiselier2015-03-313-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds configuration to CMake and LIT for running the libc++ test-suite to generate code coverage. To use code coverage use following instructions. * Find the clang resource dir using `$CXX -print-search-dirs`. Let <library-dir> be the first library search directory. * `cmake <regular-options> -DLIBCXX_GENERATE_COVERAGE=ON -DLIBCXX_COVERAGE_LIBRARY=<library-dir>/lib/<platform>/libclang_rt.profile.a <source>` * `make cxx` * `make check-libcxx` * `make generate-libcxx-coverage` The reason I want this patch upstreamed is so I can setup a bot that generates code coverage and posts in online for every revision. Reviewers: mclow.lists, jroelofs, danalbert Reviewed By: danalbert Differential Revision: http://reviews.llvm.org/D8716 llvm-svn: 233669
* Allow enabling CCache through an env variable. This helps enable/disable the ↵Eric Fiselier2015-03-311-1/+2
| | | | | | option on buildbots. llvm-svn: 233659
* Make the new tests better; make sure that we're testing the case where no ↵Marshall Clow2015-03-302-4/+11
| | | | | | reallocation has to happen llvm-svn: 233641
* While testing Erik's code coverage scripts, I found a hole in the test suite ↵Marshall Clow2015-03-302-16/+74
| | | | | | - vector::assign where a reallocation was not required had no tests. Add some llvm-svn: 233557
* [libcxx] Fix PR22771 - Support access control SFINAE in the library version ↵Eric Fiselier2015-03-301-0/+6
| | | | | | | | | | | | | | | | | | | of is_convertible. Summary: Currently the conversion check does not take place in a context where access control SFINAE is applied. This patch changes the context of the test expression so that SFINAE occurs if access control does not permit the conversion. Related bug: https://llvm.org/bugs/show_bug.cgi?id=22771 Reviewers: mclow.lists, rsmith, dim Reviewed By: dim Subscribers: dim, rodrigc, emaste, cfe-commits Differential Revision: http://reviews.llvm.org/D8461 llvm-svn: 233552
* Fix PR23041. Use lock_shared() as opposed to lock() in shared_lock test.Eric Fiselier2015-03-271-1/+1
| | | | llvm-svn: 233367
* Add tests for library version of is_convertibleEric Fiselier2015-03-261-0/+18
| | | | llvm-svn: 233285
* Make the presence of stdin and stdout optional.Ed Schouten2015-03-2611-26/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind Nuxi CloudABI is that it is targeted at (but not limited to) running networked services in a sandboxed environment. The model behind stdin, stdout and stderr is strongly focused on interactive tools in a command shell. CloudABI does not support the notion of stdin and stdout, as 'standard input/output' does not apply to services. The concept of stderr does makes sense though, as services do need some mechanism to log error messages in a uniform way. This patch extends libc++ in such a way that std::cin and std::cout and the associated <cstdio>/<cwchar> functions can be disabled through the flags _LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time it attempts to clean up src/iostream.cpp a bit. Instead of using a single array of mbstate_t objects and hardcoding the array indices, it creates separate objects that declared next to the iostream objects and their buffers. The code is also restructured by interleaving the construction and setup of c* and wc* objects. That way it is more obvious that this is done identically. The c* and wc* objects already have separate unit tests. Make use of this fact by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in both directions. If stdin or stdout is disabled, these tests will therefore test for the absence of c* and wc*. Differential Revision: http://reviews.llvm.org/D8340 llvm-svn: 233275
* Don't let time_put test use implementation dependent constructs.Ed Schouten2015-03-261-49/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The time_put test doesn't seem to work on Linux and CloudABI. For Linux we already have an XFAIL. Closer inspection seems to reveal that this test does not pass for a couple of reasons. First of all, the tm_yday field is set to an invalid value. The strftime() function doesn't behave consistently across platforms in case the values in the tm structure are incoherent. Fix up this field to have the value 121, which corresponds with tm_mday, tm_mon and tm_year. This of course affects the output of time_put for some modifiers, so update the tests accordingly. Second, some of the tests actually use modifiers that are only present on BSD derived systems. They are not part of the C standard/POSIX. Simply remove them. Finally, some of the tests actually use invalid modifiers, causing a malformed format string to be passed to strftime(). Remove these tests as well. Differential Revision: http://reviews.llvm.org/D8349 llvm-svn: 233262
* Add code to honor the match_not_bol and match_not_eol regex flats. Fixes ↵Marshall Clow2015-03-192-0/+100
| | | | | | PR#22651. Thanks to Jim Porter for the report and suggested fix. llvm-svn: 232733
* [libc++] Fix PR22922 - Allocator support for std::function does not know how ↵Eric Fiselier2015-03-185-15/+18
| | | | | | | | | | | | | | | | | | | to rebind. Summary: This patch changes std::function to use allocator_traits to rebind the allocator instead of allocator itself. It also changes most of the tests to use `bare_allocator` where possible instead of `test_allocator`. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8391 llvm-svn: 232686
OpenPOWER on IntegriCloud