Commit Graph

132 Commits

Author SHA1 Message Date
Mehdi Amini
e807cbcd5b Add deployment knobs to tests (for Apple platforms)
The tests for libc++ specify -target on the command-line to the
compiler, but this is problematic for a few reasons.

Firstly, the -target option isn't supported on Apple platforms. Parts
of the triple get dropped and ignored. Instead, software should be
compiled with a combination of the -arch and -m<name>-version-min
options.

Secondly, the generic "darwin" target references a kernel version
instead of a platform version. Each platform has its own independent
versions (with different versions of libc++.1.dylib), independent of the
version of the Darwin kernel.

This commit adds support to the LIT infrastructure for testing against
Apple platforms using -arch and -platform options.

If the host is not on OS X, or the compiler type is not clang or apple-clang, then this commit has NFC.
If the host is on OS X and --param=target_triple=... is specified, then a warning is emitted to use arch and platform instead. Besides the warning, there's NFC.
If the host is on OS X and *no* target-triple is specified, then use the new deployment target logic. This uses two new lit parameters, --param=arch=<arch> and --param=platform=<platform>. <platform> has the form <name>[<version>].
By default, arch is auto-detected from clang -dumpmachine, and platform is "macosx".
If the platform doesn't have a version:
For "macosx", the version is auto-detected from the host system using sw_vers. This may give a different version than the SDK, since new SDKs can be installed on older hosts.
Otherwise, the version is auto-detected from the SDK version using xcrun --show-sdk-path.
-arch <arch> -m<name>-version-min=<version> is added to the compiler flags.
The target triple is computed as <arch>-apple-<platform>. It is *not* passed to clang, but it is available for XFAIL and UNSUPPORTED (as is with_system_cxx_lib=<target>).
For convenience, apple-darwin and <arch>-apple-darwin are added to the set of available features.
There were a number of tests marked to XFAIL on x86_64-apple-darwin11
and x86_64-apple-darwin12. I updated these to
x86_64-apple-macosx10.7 and x86_64-apple-macosx10.8.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 00:59:54 +00:00
Eric Fiselier
f4dfb45247 Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 03:43:25 +00:00
Saleem Abdulrasool
effe3dc412 test: mark requirement for pthread test
This test explicitly is checking the behaviour of std::thread and
pthread interactions.  This requires pthreads.  Add an appropriate
requirement.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:48 +00:00
Stephan T. Lavavej
041fb56800 [libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object prevents copy elision".
N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;".

Fixes D29139.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:07 +00:00
Marshall Clow
9bb0cca646 Implement LWG2556: Wide contract for future::share()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 23:28:25 +00:00
Eric Fiselier
952eaecfc6 Implement P0513R0 - "Poisoning the Hash"
Summary:
Exactly what the title says.

This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it.

See http://wg21.link/P0513R0 for more info.

If there are no comments in the next couple of days I'll commit this

Reviewers: mclow.lists, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28938

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 00:02:12 +00:00
Stephan T. Lavavej
16e2ba19df [libcxx] [test] Fix comment typos, strip trailing whitespace.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 20:10:25 +00:00
Eric Fiselier
6fbac40a30 Add support for running our test suite against MSVC's STL
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 01:48:54 +00:00
Roger Ferrer Ibanez
47b1cefa76 Mark tests as unsupported under libcpp-no-exceptions
The destructor of std::promise needs to construct a std::future_error
exception so it calls std::make_exception_ptr. But under
libcpp-no-exceptions this will trigger an abort.

Differential Revision: https://reviews.llvm.org/D27614



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 08:48:48 +00:00
Eric Fiselier
ab9ab94102 Enable -Wunreachable-code and fix duplicate warning flags
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 04:34:33 +00:00
Eric Fiselier
0a1cbcf2b7 fix newly failing c++03 tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 00:40:45 +00:00
Eric Fiselier
0e5ebbc77c Fix unused parameters and variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-23 23:37:52 +00:00
Eric Fiselier
12a450ff3b Fix yet another dynamic exception spec
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11 02:49:37 +00:00
Eric Fiselier
22e3b2af50 Add more test cases to packaged_task copyability test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 10:02:04 +00:00
Eric Fiselier
52b1b17336 Avoid C++17 guaranteed copy elision when testing for non-copyability
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 09:57:00 +00:00
Eric Fiselier
bca6de0e4e Adjust libc++ test infastructure to fully support modules
This patch overhalls the libc++ test format/configuration in order to fully support modules. By "fully support" I mean get almost all of the tests passing. The main hurdle for doing this is handling tests that `#define _LIBCPP_FOO` macros to test a different configuration. This patch deals with these tests in the following ways:

1. For tests that define single `_LIBCPP_ABI_FOO` macros have been annotated with `// MODULES_DEFINES: _LIBCPP_ABI_FOO`. This allows the test suite to define the macro on the command line so it uses a different set of modules.
2. Tests for libc++'s debug mode (which define custom `_LIBCPP_ASSERT`) are automatically detected by the test suite and are compiled and run with modules disabled.

This patch also cleans up how the `CXXCompiler` helper class handles enabling/disabling language features.

NOTE: This patch uses `LIT` features which were only committed to LLVM today. If this patch breaks running the libc++ tests you probably need to update LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:16:07 +00:00
Roger Ferrer Ibanez
5813abeff2 Protect futures test under libcpp-no-exceptions
Skip tests that expect an exception be thrown.

Differential Revision: https://reviews.llvm.org/D27253



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:34:57 +00:00
Eric Fiselier
487bc7e0c8 Mark variadic lock guard tests as XFAIL with modules, since they have to define macros to expose the new ABI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 01:10:52 +00:00
Stephan T. Lavavej
dd3313c917 [libcxx] [test] D26625: future_error::what() is implementation-defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 17:00:32 +00:00
Marshall Clow
3d7c49b7b0 Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide Contracts' which was adopted last week in Issaquah
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 19:58:05 +00:00
Marshall Clow
5ec20dfb48 Implement P0510 'Make future_error Constructible' adopted in Issaquah
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 18:56:24 +00:00
Stephan T. Lavavej
45e692539c [libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is initialized but not referenced".
test/std/depr/depr.c.headers/inttypes_h.pass.cpp
test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
test/std/input.output/iostream.forward/iosfwd.pass.cpp
Add test() to avoid a bunch of void-casts, although we still need a few.

test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below).

test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
When retrieving facets, the references are unused.

test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
"std::ios_base::iostate err = ios.goodbit;" was completely unused here.

test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
test/std/numerics/c.math/ctgmath.pass.cpp
test/std/numerics/rand/rand.device/entropy.pass.cpp
test/std/numerics/rand/rand.device/eval.pass.cpp
test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
test/std/thread/futures/futures.promise/dtor.pass.cpp
test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
These variables are verifying types but are otherwise unused.

test/std/strings/basic.string/string.capacity/reserve.pass.cpp
old_cap was unused (it's unclear to me whether it was intended to be used).

test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
These tests contained unused characters.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 17:35:14 +00:00
Roger Ferrer Ibanez
8883740456 Protect lock tests under libcpp-no-exceptions
Skip tests that expect an exception to be thrown.

Differential Revision: https://reviews.llvm.org/D26184




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 15:00:16 +00:00
Roger Ferrer Ibanez
efc9f170c9 Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: libcpp-no-exceptions" tests that only check exceptions and nothing else
This is a follow up of D24562.

These tests do not check anything but exceptions, so it makes sense to mark
them as UNSUPPORTED under a library built without exceptions.

Differential Revision: https://reviews.llvm.org/D26075



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-31 08:47:53 +00:00
Eric Fiselier
4432d3f204 Prevent the test suite from hanging when run against libstdc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 04:29:50 +00:00
Asiri Rathnayake
e3a71a295e [libcxx] Recover no-exceptions XFAILs - I
First batch of changes to get some of these XFAILs working in the
no-exceptions libc++ variant.

Changed some XFAILs to UNSUPPORTED where the test is all about exception
handling. In other cases, used the test macros TEST_THROW and
TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test
that concerns exception handling behaviour.

Reviewers: EricWF, mclow.lists

Differential revision: https://reviews.llvm.org/D24562

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:15:41 +00:00
Marshall Clow
db86684746 Implement is_error_code_v and is_error_condition_v for c++17. Rework the tests for is_error_code and is_error_condition, since they were really lacking. Thanks to Alisdair for the heads-up that we were missing these.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@282331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 17:36:14 +00:00
Kuba Brecka
2f3771acf0 [libcxx] Add a TSan regression test for a data race in call_once
Differential Revision: https://reviews.llvm.org/D24297



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@281477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:15:42 +00:00
Eric Fiselier
7f735c31c0 Fix PR30202 - notify_all_at_thread_exit seg faults if run from a raw pthread context.
Summary:
This patch allows threads not created using `std::thread` to use `std::notify_all_at_thread_exit` by ensuring the TL state has been initialized within `std::notify_all_at_thread_exit`.

Additionally this patch "fixes" a potential oddity in `__thread_local_pointer::reset(pointer)`, which would previously delete the old thread local data. However there should *never* be old thread local data because pthread *should* null it out on thread exit. Unfortunately it's possible that pthread failed to do this according to the spec:


> 
> Upon key creation, the value NULL shall be associated with the new key in all active threads. Upon thread creation, the value NULL shall be associated with all defined keys in the new thread.
> 
> An optional destructor function may be associated with each key value. At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument. The order of destructor calls is unspecified if more than one destructor exists for a thread when it exits.
> 
> If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with associated destructors, then the process is repeated. If, after at least {PTHREAD_DESTRUCTOR_ITERATIONS} iterations of destructor calls for outstanding non-NULL values, there are still some non-NULL values with associated destructors, implementations may stop calling destructors, or they may continue calling destructors until no non-NULL values with associated destructors exist, even though this might result in an infinite loop.

However if pthread fails to delete the value it is probably incorrect for us to do it. Destroying the value performs all of the "at thread exit" actions registered with it but we are way past "at thread exit".





Reviewers: mclow.lists, bcraig, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24159

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-03 08:07:40 +00:00
Eric Fiselier
76c3a05cd1 Add "FLAKY_TEST" test directive to support re-running flaky tests.
Some of the mutex tests fail on machines with high load. This patch implements
the test directive "// FLAKY_TEST" which allows a test to be run 3 times
before it's considered a failure.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 01:46:43 +00:00
Eric Fiselier
3efb2c901e Fix C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:46:58 +00:00
Eric Fiselier
b0ee61352f Make futures.overview enum tests more portable. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 05:00:32 +00:00
Eric Fiselier
f5b30213b6 Placate MSVC's unchecked malloc warning in thread tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 05:44:08 +00:00
Eric Fiselier
67ec8a281b Move more _LIBCPP_VERSION tests to test/libcxx.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 02:07:26 +00:00
Eric Fiselier
c6fcb58914 Avoid assignment in return. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:00:32 +00:00
Eric Fiselier
c382dd0cd1 Move native_handle thread tests to test/libcxx
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:21:50 +00:00
Eric Fiselier
d24c465bea Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable.
Patch from STL@microsoft.com. Thanks STL!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:31:42 +00:00
Eric Fiselier
10d7856f8f Add missing include
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 04:58:19 +00:00
Eric Fiselier
10b52a0e56 Implement variadic lock_guard.
Summary:
This patch implements the variadic `lock_guard` paper. 

Making `lock_guard` variadic is a ABI breaking change because the specialization `lock_guard<_Mutex>` mangles differently then when it was the primary template. This change only provides variadic `lock_guard` in ABI V2 or when `_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined.

Note that in ABI V2 `lock_guard` must always be declared as a variadic template, even in C++03, in order to keep the ABI consistent. For this reason `lock_guard` is forward declared as a variadic template in all standard dialects and therefore depends on variadic templates being provided as an extension in C++03. All supported versions of Clang and GCC provide this extension.




Reviewers: mclow.lists

Subscribers: K-ballo, mclow.lists, cfe-commits

Differential Revision: http://reviews.llvm.org/D21260

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 03:48:09 +00:00
Eric Fiselier
202acb7fd3 Remove unused local var. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 02:55:21 +00:00
Eric Fiselier
dd7418914d Fix TEST_HAS_NO_EXCEPTIONS misspelling in the test suite.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 08:19:02 +00:00
Eric Fiselier
e98bd2a486 Mark LWG issue 2250 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:03:31 +00:00
Eric Fiselier
84acb1ec3f Remove trailing whitespace in test suite. Approved by Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:35:39 +00:00
Eric Fiselier
68db6cdf1b Cleanup non-standard tests as reported by STL@microsoft.com. NFC.
This patch addresses the following issues in the test suite:

1. Move "std::bad_array_length" test from std/ to libcxx/ test directory
   since the feature is not a part of the standard.

2. Rename "futures.tas" test directory to "futures.task" since that is the
   correct stable name.

3. Move tests for "packaged_task<T>::result_type" from std/ to libcxx/
   test directory since the typedef is a libc++ extension.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:05:53 +00:00
Asiri Rathnayake
a3eac518e6 [libcxx] Improve tests to use the UNSUPPORTED lit directive
Quite a few libcxx tests seem to follow the format:
 #if _LIBCPP_STD_VER > X
   // Do test.
 #else
   // Empty test.
 #endif
We should instead use the UNSUPPORTED lit directive to exclude the test on
earlier C++ standards. This gives us a more accurate number of test passes
for those standards and avoids unnecessary conflicts with other lit
directives on the same tests.

Reviewers: bcraig, ericwf, mclow.lists

Differential revision: http://reviews.llvm.org/D20730

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 08:57:35 +00:00
Eric Fiselier
61a220ae5b Replace one more occurrence of non-standard std:launch::any. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 02:30:18 +00:00
Eric Fiselier
1e5a4a4a71 Fix or move various non-standard tests.
This patch does the following:

* Remove <__config> includes from some container tests.
* Guards uses of std::launch::any in async tests because it's an extension.
* Move "test/std/extensions" to "test/libcxx/extensions"
* Moves various non-standard tests including those in "sequences/vector",
  "std/localization" and "utilities/meta".


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 04:07:45 +00:00
Eric Fiselier
a32eb83b2f Rename function parameters to avoid shadowing. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 02:00:52 +00:00
Eric Fiselier
e94c1aee2b [libcxx] Fix PR15638 - Only allocate in parent when starting a thread to prevent calling terminate.
Summary:
Hi,

When creating a new thread libc++ performs at least 2 allocations. The first allocates a tuple of args and the functor that will be passed to the new thread. The second allocation is for the thread local storage needed internally by libc++. Currently the second allocation happens in the child thread, meaning that if it throws the program will terminate with an uncaught bad alloc.

The solution to this is to allocate ALL memory in the parent thread and then pass it to the child.

See https://llvm.org/bugs/show_bug.cgi?id=15638

Reviewers: mclow.lists, danalbert, jroelofs, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13748

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@266851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 02:21:33 +00:00
Richard Barton
037efda0ac Guard a number of tests relying on threads support when built in
single-threaded mode.

Differential Revision: http://reviews.llvm.org/D14731



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@264191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:04:11 +00:00