summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Add test for type properties of std::reference_wrapperEric Fiselier2014-11-041-0/+27
| | | | llvm-svn: 221224
* Mark string_view::to_string as const. Fixes PR21428Marshall Clow2014-11-021-4/+4
| | | | llvm-svn: 221101
* Fix example in documentation of target triple sanitization.Eric Fiselier2014-10-281-1/+1
| | | | llvm-svn: 220804
* [libcxx] Delay evaluation of __make_tuple_types to prevent blowing the max ↵Eric Fiselier2014-10-282-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template instantiation depth. Fixes Bug #18345 Summary: http://llvm.org/bugs/show_bug.cgi?id=18345 Tuple's constructor and assignment operators for "tuple-like" types evaluates __make_tuple_types unnecessarily. In the case of a large array this can blow the template instantiation depth. Ex: ``` #include <array> #include <tuple> #include <memory> typedef std::array<int, 1256> array_t; typedef std::tuple<array_t> tuple_t; int main() { array_t a; tuple_t t(a); // broken t = a; // broken // make_shared uses tuple behind the scenes. This bug breaks this code. std::make_shared<array_t>(a); } ``` To prevent this from happening we delay the instantiation of `__make_tuple_types` until after we perform the length check. Currently `__make_tuple_types` is instantiated at the same time that the length check . Test Plan: Two tests have been added. One for the "tuple-like" constructors and another for the "tuple-like" assignment operator. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: K-ballo, cfe-commits Differential Revision: http://reviews.llvm.org/D4467 llvm-svn: 220769
* Test that the single-threaded lit feature is available iff the corresponding ↵Jonathan Roelofs2014-10-271-0/+18
| | | | | | | | guard is #defined http://reviews.llvm.org/D6006 llvm-svn: 220729
* Add special case handling of linux target triples that do not contain `-gnu`.Eric Fiselier2014-10-271-7/+16
| | | | | | | | | | | For targets that end it `redhat-linux` and `suse-linux` manually add the `-gnu` section of the target since `linux-gnu` is needed in the testsuite. This patch also moves the removal of minor and patchlevel numbers from OSX triples to be handled when deducing the triple instead of when adding available features. llvm-svn: 220724
* Add test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is ↵Eric Fiselier2014-10-271-0/+23
| | | | | | defined. llvm-svn: 220722
* Fix use of operator comma in is_permutation and delete comma operator for ↵Eric Fiselier2014-10-271-5/+13
| | | | | | | | | test iterators. The comma operators in the test iterators give better error messages when they are deleted as opposed to not defined. Delete these functions when possible. llvm-svn: 220715
* [libcxx] Remove use of uniform initialization from regex tests so that they ↵Eric Fiselier2014-10-275-38/+38
| | | | | | | | | | | | | | compile in C++03. Reviewers: danalbert, jroelofs, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5957 llvm-svn: 220707
* [libcxx] Fix use of operator comma where the types can be user definedEric Fiselier2014-10-272-1/+16
| | | | | | | | | | | | | | | | Summary: An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected. Modify all the test iterators to define operator comma. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5929 llvm-svn: 220706
* Change uses of `sys.platform == 'linux2' to `sys.platform.startswith('linux')Eric Fiselier2014-10-231-3/+3
| | | | | | | | Although the current method is valid up till python 3.3 (which is not supported) this seems to be a clearer way of checking for linux and moves the tests towards python 3 compatibility. llvm-svn: 220534
* [libcxx] XFAIL all currently failing libc++ tests for linux.Eric Fiselier2014-10-2322-0/+71
| | | | | | | | | | | | | | | | | | Summary: Pretty please? We now have a significant number of builders that test libc++. I really want those builders to be green. Most of these failures are due to differences in locale data, including those in regex. I will continue working on fixing the locale and regex tests but there is no consensus on what the correct direction to go. Since the builders display a list of XFAIL tests they are by no means hidden. It just means they are expected failures. Now unexpected failures won't get mixed in with well known and expected failures. Reviewers: mclow.lists, jroelofs, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5941 llvm-svn: 220512
* Only link tests against -ldl on linuxEric Fiselier2014-10-231-1/+1
| | | | llvm-svn: 220510
* Add support for "fancy" pointers to promise and packaged_task.Eric Fiselier2014-10-232-0/+60
| | | | | | | | | | | | | | | | | | | | | Summary: This patch is very closely related to D4859. Please see http://reviews.llvm.org/D4859 for more information. This patch adds support for "fancy" pointers and allocators to promise and packaged_task. The changes made to support this are exactly the same as in D4859. Test Plan: "fancy" pointer tests were added to each constructor affected by the change. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4862 llvm-svn: 220471
* Add support for "fancy" pointers to shared_ptr. Fixes PR20616Eric Fiselier2014-10-234-0/+212
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch add support for "fancy pointers/allocators" as well as fixing support for shared_pointer and "minimal" allocators. Fancy pointers are class types that meet the NullablePointer requirements. In our case they are created by fancy allocators. `support/min_allocator.h` is an archetype for these types. There are three types of changes made in this patch: 1. `_Alloc::template rebind<T>::other` -> `__allocator_traits_rebind<_Alloc, T>::type`. This change was made because allocators don't need a rebind template. `__allocator_traits_rebind` is used instead of `allocator_traits::rebind` because use of `allocator_traits::rebind` requires a workaround for when template aliases are unavailable. 2. `a.deallocate(this, 1)` -> `a.deallocate(pointer_traits<self>::pointer_to(*this), 1)`. This change change is made because fancy pointers aren't always constructible from raw pointers. 3. `p.get()` -> `addressof(*p.get())`. Fancy pointers aren't actually a pointer. When we need a "real" pointer we take the address of dereferencing the fancy pointer. This should give us the actual raw pointer. Test Plan: Tests were added using `support/min_allocator.h` to each affected shared_ptr overload and creation function. These tests can only be executed in C++11 or greater since min_allocator is only available then. A extra test was added for the non-variadic versions of allocate_shared. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4859 llvm-svn: 220469
* Fix a couple of failing tests for C++03 by checking for rvalue reference ↵Marshall Clow2014-10-232-3/+4
| | | | | | support first. llvm-svn: 220465
* Add -ldl to libc++ tests when sanitizers are used.Eric Fiselier2014-10-231-0/+2
| | | | | | | Clang 3.6 no longer links the sanitizer runtime library dependancies when -nodefaultlibs is used. This patch manually links in a missing dependancy. llvm-svn: 220463
* Some tests used __typeof__ instead of decltype. Replace these usages.Marshall Clow2014-10-214-8/+8
| | | | llvm-svn: 220296
* LWG #2212 (not yet adopted) mandates that tuple_size/tuple_element are ↵Marshall Clow2014-10-212-0/+101
| | | | | | available if <array> or <utility> are included (not just <tuple>). We already do this. Add some tests to make sure that this remains true. llvm-svn: 220295
* [libcxx] Redo adding support for building and testing with an ABI library ↵Eric Fiselier2014-10-192-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not along linker paths Summary: This is the second attempt at allowing for the use of libraries that the linker cannot find. The first attempt used `CMAKE_LIBRARY_PATH` and `find_library` to select which ABI library should be used. There were a number of problems with this approach: - `find_library` didn't work with cmake targets (ie in-tree libcxxabi build) - It wasn't always possible to determine where `find_library` actually found your library. - `target_link_libraries` inserted the path of the ABI library into libc++'s RPATH when `find_library` was used. - Linking libc++ and it's ABI library is a special case. It's a lot easier to keep it simple. After discussion with @cbergstrum a new approach was decided upon. This patch achieve the same ends by simply using `LIBCXX_CXX_ABI_LIBRARY_PATH` to specify where to find the library (if the linker won't find it). When this variable is defined it is simply added as a library search path when linking libc++. It is a lot easier to duplicate this behavior in LIT. It also prevents libc++ from being linked with an RPATH. Reviewers: mclow.lists, cbergstrom, chandlerc, danalbert Reviewed By: chandlerc, danalbert Subscribers: chandlerc, cfe-commits Differential Revision: http://reviews.llvm.org/D5860 llvm-svn: 220157
* Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.Eric Fiselier2014-10-195-0/+8
| | | | llvm-svn: 220154
* Whitespace maintenance. Remove a bunch of tabs that snuck in. No ↵Marshall Clow2014-10-1815-111/+111
| | | | | | functionality change llvm-svn: 220142
* [libcxx] Add support for building and testing with an ABI library not along ↵Eric Fiselier2014-10-182-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | linker paths Summary: This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find. - `CMAKE_LIBRARY_PATH` is used to specify the list of search directories. - The ABI library is now found using `find_library` instead of assuming its along the linker's search path. - `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`. - For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>` Some changes in existing behavior were also added: - `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`. - `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`. Reviewers: mclow.lists, danalbert, EricWF Reviewed By: EricWF Subscribers: emaste, cfe-commits Differential Revision: http://reviews.llvm.org/D5038 llvm-svn: 220118
* [libcxx] Fix SFINAE in <cmath>. Patch from K-Ballo.Eric Fiselier2014-10-171-0/+143
| | | | | | | | Delay instantiation of `__numeric_type` within <cmath>, don't instantiate it when the `is_arithmetic` conditions do not hold as it causes errors with user-defined types with ambiguous conversions. Fixes PR21083. llvm-svn: 219998
* [libcxx] Add support for LLVM_USE_SANITIZER=UndefinedEric Fiselier2014-10-161-0/+5
| | | | | | | LLVM_USE_SANITIZER=Undefined support was added to the LLVM CMake configuration. Update libc++'s handling of LLVM_USE_SANITIZER to support this as well. llvm-svn: 219987
* Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks ↵Marshall Clow2014-10-153-0/+56
| | | | | | to Louis Dionne for the bug report and the patch. llvm-svn: 219785
* Fix for PR 19616: 'tuple_cat of nested tuples fails in noexcept ↵Marshall Clow2014-10-072-1/+28
| | | | | | specification'. Thanks to Louis Dionne for the fix. llvm-svn: 219243
* Fix some type-traits (is_assignable, etc) dealing with classes that take ↵Marshall Clow2014-09-225-0/+32
| | | | | | non-const references as 'right hand side'. Add tests. Fixes PR# 20836 llvm-svn: 218286
* Fix PR#20843: binomial_distribution<unsigned> is broken. Add test to ensure ↵Marshall Clow2014-09-171-0/+11
| | | | | | that signed and unsigned verstions produce the same sequence. llvm-svn: 217976
* Add include of <cassert> for the operator commaMarshall Clow2014-09-171-0/+1
| | | | llvm-svn: 217938
* Create a 'comma_iterator' class that overloads operator, and asserts when ↵Marshall Clow2014-09-163-0/+121
| | | | | | it's called. Add tests to mismatch to make sure it can't be blindsided by such an evil iterator. More tests for other algorithms forthcoming. Thanks to STL for pointing this out at CppCon and Yakov Galka for opening LWG issue #2133 llvm-svn: 217902
* Fix a bug in the move-assigment operator for basic_stringbuf. Thanks to ↵Marshall Clow2014-09-161-0/+36
| | | | | | Johnathan Wakeley for the bug report llvm-svn: 217894
* PR20546: Fix tests for compare_exchange_weak.Dan Albert2014-09-066-18/+79
| | | | | | | | | | | | | | | | | | | | | | | | These calls are allowed to fail spuriously. 29.6.5.25: Remark: A weak compare-and-exchange operation may fail spuriously. That is, even when the contents of memory referred to by expected and object are equal, it may return false and store back to expected the same memory contents that were originally there. [ Note: This spurious failure enables implementation of compare and-exchange on a broader class of machines, e.g., load-locked store-conditional machines. A consequence of spurious failure is that nearly all uses of weak compare-and-exchange will be in a loop. To fix this, we replace any assert() that expects std::atomic::compare_exchange_weak() to return true with a loop. If the call does not return true within N runs (with N currently equal to 10), then the test fails. http://llvm.org/bugs/show_bug.cgi?id=20546 llvm-svn: 217319
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-05250-0/+542
| | | | | | | | | | If you're crazy enough to want this sort of thing, then add -D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and --param=additiona_features=libcpp-has-no-threads to your lit commnad line. http://reviews.llvm.org/D3969 llvm-svn: 217271
* Bugfix: allow additional_features to be emptyJonathan Roelofs2014-09-051-3/+4
| | | | llvm-svn: 217268
* Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on ↵Jonathan Roelofs2014-09-053-2/+12
| | | | | | | | available_features http://reviews.llvm.org/D5214 llvm-svn: 217261
* test: Make it possible to opt in to use_clang_verify per testJustin Bogner2014-09-032-3/+8
| | | | | | | | | | | This modifies the use_clang_verify parameter I added in r217009 to only apply to tests that specifically ask for it via // USE_VERIFY. This allows us to incrementally convert tests, but start enjoying the benefits right away. Suggested by Eric Fiselier in code review. llvm-svn: 217017
* Fix buffer overflow issue in valarray testEric Fiselier2014-09-031-3/+2
| | | | llvm-svn: 217012
* test: Allow using clang -verify for failures rather than exit 1Justin Bogner2014-09-032-16/+38
| | | | | | | | | | | | | | | | | Currently, failure tests work by checking that compilation exits 1. This can lead to tests that fail for the wrong reason, so it'd be preferable to convert them to check for specific errors. This adds use_clang_verify parameter that runs failure tests using clang's -verify flag. I'll convert some tests in subsequent commits, and once all of the tests are converted we should key this on whether cxx_under_test is clang. I've also converted one of the unique.ptr tests, since it's the one that motivated the idea of using clang -verify when possible in the review of r216317. llvm-svn: 217009
* [asan] Make vector asan annotations exception-friendlyKostya Serebryany2014-09-022-2/+200
| | | | | | | | | Fix vector asan annotations with RAII. Add a test. Also, remove one dead function. Review: http://reviews.llvm.org/D4170 llvm-svn: 216995
* Partially address a FIXME in steady_clock::now()Jonathan Roelofs2014-09-022-0/+3
| | | | | | http://reviews.llvm.org/D4045 llvm-svn: 216949
* Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of ↵Marshall Clow2014-09-0213-21/+20
| | | | | | unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name. llvm-svn: 216909
* Mark test types for <atomic> nothrow default constructible. Patch from Steve ↵Eric Fiselier2014-08-2715-15/+15
| | | | | | | | | | | | | MacKenzie. The way the standard currently specifies the default constructor for atomic<T> requires T to be nothrow default constructible. This patch makes our test types meet this requirement. Note: The nothrow default constructible requirment is subject to the outcome of LWG issue 1265. llvm-svn: 216561
* Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for ↵Marshall Clow2014-08-244-0/+281
| | | | | | count(). Thanks to Jim Porter for the bug report llvm-svn: 216353
* Fix assignments that should be comparisons x3Eric Fiselier2014-08-233-4/+4
| | | | llvm-svn: 216318
* Add return statement to a test class's assignment operator. Defect found by ↵Eric Fiselier2014-08-231-1/+1
| | | | | | Coverity Scan. llvm-svn: 216317
* [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default ↵Eric Fiselier2014-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | LIT args. Summary: In order to gather more information about testsuite results these flags should be added to LIT's default args. These new switches were recently added to LIT. It been more than two weeks since both switches were added. I think its time we add these to our LIT flags. Reviewers: mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5037 llvm-svn: 216315
* Fix handling of format strings to work with python 2.6Eric Fiselier2014-08-231-4/+4
| | | | llvm-svn: 216314
* Refactor lit.cfg.Dan Albert2014-08-211-195/+247
| | | | | | | | | | | | | | | | | | The purely imperative format of the configuration performed in lit.cfg was making merge conflicts with changes I have for Android an unbelievable pain in the ass. I've moved all of the configuration into a Configuration class, with each piece of configuration happening in a different method. This way I can avoid merge conflicts, and any new features that get added (as have been done with the sanitizers, the -std flag, etc.) can be easily applied to Android as well. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Differential Revision: http://reviews.llvm.org/D4952 llvm-svn: 216196
* Mark some localization time tests as XFAIL on linux.Eric Fiselier2014-08-212-0/+9
| | | | | | | | This marks some of the localization test XFAIL on linux. There has been some discussion on D4861 about doing this. Please let me know if any of these tests for you on linux. llvm-svn: 216151
OpenPOWER on IntegriCloud