Commit Graph

3355 Commits

Author SHA1 Message Date
Roger Ferrer Ibanez 9f1bcb65aa Protect std::ostream::sentry test under libcpp-no-exceptions
Skip test that throws an exception.

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

llvm-svn: 288378
2016-12-01 17:31:38 +00:00
Roger Ferrer Ibanez 86663cd0ef Protect std::array tests under noexceptions
Skip tests that expect exceptions be thrown. Also add missing asserts.

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

llvm-svn: 288165
2016-11-29 17:10:29 +00:00
Roger Ferrer Ibanez 9d03c03858 Protect std::string tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.

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

llvm-svn: 288158
2016-11-29 16:40:19 +00:00
Roger Ferrer Ibanez f2e50651f6 Protect std::{,unordered_}map tests under noexceptions
Skip tests that use exceptions

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

llvm-svn: 288157
2016-11-29 16:37:48 +00:00
Roger Ferrer Ibanez d7306fb85a Protect locale tests under noexceptions
Skip tests that expect exceptions be thrown.

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

llvm-svn: 288156
2016-11-29 16:31:40 +00:00
Roger Ferrer Ibanez 21ad28cfb4 Protect test for dynarray under libcpp-no-exceptions
This test expects an exception be thrown.

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

llvm-svn: 288155
2016-11-29 16:27:45 +00:00
Aditya Kumar b9775795a8 [libcxx] remove unused code
The macro _LIBCPP_UNROLL_LOOPS isn't used anywhere
so the code was dead.

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

llvm-svn: 288143
2016-11-29 14:43:42 +00:00
Marshall Clow 13320a50e5 Implement conjuntion/disjuntion/negation for LFTS v2. Same code and tests for the ones in std::
llvm-svn: 287988
2016-11-26 18:45:03 +00:00
Marshall Clow 3b3352dead Implement the 'detection idiom' from LFTS v2
llvm-svn: 287981
2016-11-26 15:49:40 +00:00
Roger Ferrer Ibanez d056b5be51 Reverting wrong diff
I managed to confuse me with two reviews of the same thing and ended commiting the wrong one.

llvm-svn: 287868
2016-11-24 11:28:02 +00:00
Roger Ferrer Ibanez 929282836a Protect tests for std::uninitialized_{copy,fill} under libcpp-no-exceptions
Skip tests that expect an exception be thrown.

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

llvm-svn: 287866
2016-11-24 11:17:09 +00:00
Roger Ferrer Ibanez c65daf3e4a Protect std::string tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.

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

llvm-svn: 287865
2016-11-24 11:15:09 +00:00
Stephan T. Lavavej d72ece6462 [libcxx] [test] D27027: Strip trailing whitespace.
llvm-svn: 287829
2016-11-23 22:03:28 +00:00
Stephan T. Lavavej 640660aa3f [libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.
llvm-svn: 287828
2016-11-23 22:02:59 +00:00
Stephan T. Lavavej 8eb5ce8652 [libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.
When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".

~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).

llvm-svn: 287827
2016-11-23 22:02:53 +00:00
Stephan T. Lavavej bbdf9b7d2b [libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.
Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).

llvm-svn: 287826
2016-11-23 22:02:44 +00:00
Stephan T. Lavavej 562f28a6ed [libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
Various changes:

test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.

test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.

llvm-svn: 287825
2016-11-23 22:02:35 +00:00
Stephan T. Lavavej 73876facd5 [libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
Change "int j;" indices to "std::size_t j;".

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287824
2016-11-23 22:02:27 +00:00
Stephan T. Lavavej afe99ae092 [libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.
Change unsigned to int in parameters.

llvm-svn: 287823
2016-11-23 22:02:16 +00:00
Stephan T. Lavavej a11d322f0d [libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.
Add static_cast<std::size_t> when comparing int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287822
2016-11-23 22:01:58 +00:00
Stephan T. Lavavej e898b484f6 [libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Change loop indices from int to std::size_t.

Also, include <cstddef> when it wasn't already being included.

llvm-svn: 287820
2016-11-23 22:01:19 +00:00
Shoaib Meenai 4304955545 [libc++] Remove unneeded visibility pragmas
The function definitions being guarded by the pragma were all static, so
they wouldn't be exported anyway. In any case, we should prefer the
visibility macros. No functional change.

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

llvm-svn: 287768
2016-11-23 16:11:15 +00:00
Eric Fiselier 341c9dd9c4 Fix __hash_table::max_size() on 32 bit systems
llvm-svn: 287749
2016-11-23 09:16:12 +00:00
Casey Carter ca1c5e0fb6 Don't "LIBCPP_ONLY(stuff;)" at namespace scope.
Differential review: https://reviews.llvm.org/D27029

llvm-svn: 287732
2016-11-23 01:44:53 +00:00
Eric Fiselier 55b31b4e69 [libcxx] Fix max_size() across all containers
Summary: The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 287729
2016-11-23 01:18:56 +00:00
Eric Fiselier 80e66ac1d3 Add <variant> tests but disable them for libc++
llvm-svn: 287728
2016-11-23 01:02:51 +00:00
Eric Fiselier 198955536e Allow libc++ to use modules in C++03.
Libc++ internal uses <atomic> in C++03 code but the module map forbids its use.
This causes the libc++ 'std' module to fail to build in C++03.

This patch removes the requirement to fix this issue.

llvm-svn: 287693
2016-11-22 20:15:39 +00:00
Eric Fiselier 7216b6bc38 Attempt to fix stdint/cstdint modules try 2
llvm-svn: 287690
2016-11-22 20:05:19 +00:00
Eric Fiselier 3028189ee3 Cleanup module.modulemap
llvm-svn: 287687
2016-11-22 20:00:21 +00:00
Eric Fiselier 67a7e935a3 Revert r287435 because of OS X test failures
llvm-svn: 287531
2016-11-21 11:26:10 +00:00
Eric Fiselier 43b5523069 Mark variadic lock guard tests as XFAIL with modules, since they have to define macros to expose the new ABI
llvm-svn: 287513
2016-11-21 01:10:52 +00:00
Eric Fiselier 11869aeb49 Adjust uses_alloc_types helpers for later changes
llvm-svn: 287512
2016-11-21 00:41:32 +00:00
Eric Fiselier 72d302b9ed Fix stdint/cstdint modules
llvm-svn: 287435
2016-11-19 03:29:03 +00:00
Eric Fiselier 3a528e2936 Mark test as unsupported in C++03
llvm-svn: 287417
2016-11-19 01:38:00 +00:00
Eric Fiselier 074d46d55f [libcxx] Implement locale.h to fix modules build
Summary:
Because `locale.h` isn't part of the libc++ modules the class definitions it provides are exported as part of `__locale` (since it happens to be build first). This breaks `<clocale>` which exports `std::lconv` without including `<__locale>`.

This patch implements `locale.h` to fix this issue, it also adds support for testing libc++ with modules.




Reviewers: mclow.lists, rsmith, EricWF

Subscribers: cfe-commits

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

llvm-svn: 287413
2016-11-19 01:14:15 +00:00
Stephan T. Lavavej ae3c4eec5a [libcxx] [test] D26812: In random tests, use real static_asserts and silence a warning.
In C++11 mode and newer, use real static_asserts.
In C++03 mode, min() and max() aren't constexpr, so use plain asserts.

One test triggers MSVC's warning C4310 "cast truncates constant value".
The code is valid, and yet the warning is valid, so I'm silencing it
through push-disable-pop.

llvm-svn: 287391
2016-11-18 22:45:32 +00:00
Eric Fiselier 194e81f620 Allow using libsupc++ with LIBCXX_ENABLE_STATIC_ABI_LIBRARY. Patch from Michael Daniels.
The code cannot currently link when using libsupc++ with the
LIBCXX_ENABLE_STATIC_ABI_LIBRARY option.

This change ifdef's out the the destructor and 'what' function for
bad_array_length and bad_array_new_length when GLIBCXX is defined.
The constructors that are left in are the only functions not being provided by
libsupc++ itself, and follows the same pattern that was used to ifdef bad_alloc.

Testing was done on a Linux x86_64 host using GCC 5.4 and libc++ from ToT.
I see no change to the test results when using libsup++ or libstdc++ without
LIBCXX_ENABLE_STATIC_ABI_LIBRARY. When using libsupc++ with
LIBCXX_ENABLE_STATIC_ABI_LIBRARY it will now build and test results are the
same as those without the option specified.

Reviewed as https://reviews.llvm.org/D26186

llvm-svn: 287388
2016-11-18 22:25:41 +00:00
Stephan T. Lavavej 09c311b9a4 [libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().
sample() isn't specified with a reproducible algorithm, so expecting
exact output is non-Standard. Mark those tests with LIBCPP_ASSERT.

In test_small_population(), we're guaranteed to get all of the elements,
but not necessarily in their original order. When PopulationCategory is
forward, we're guaranteed stability (and can therefore test equal()).
Otherwise, we can only test is_permutation(). (As it happens, both libcxx
and MSVC's STL provide stability in this scenario for input-only iterators.)

llvm-svn: 287383
2016-11-18 21:54:43 +00:00
Stephan T. Lavavej b04c795e24 [libcxx] [test] D26815: Fix an assumption about the state of moved-from std::functions.
The Standard doesn't provide any guarantees beyond "valid but unspecified" for
moved-from std::functions. libcxx moves from small targets and leaves them
there, while MSVC's STL empties out the source. Mark these assertions as
libcxx-specific.

llvm-svn: 287382
2016-11-18 21:54:38 +00:00
Stephan T. Lavavej e57a2a3144 [libcxx] [test] D26813: allocator<const T> is non-Standard.
N4582 17.6.3.5 [allocator.requirements] says that allocators are given
cv-unqualified object types, and N4582 20.9.9 [default.allocator]
implies that allocator<const T> is ill-formed (due to colliding
address() overloads). Therefore, tests for allocator<const T>
should be marked as libcxx-specific (if not removed outright).

llvm-svn: 287381
2016-11-18 21:54:31 +00:00
Eric Fiselier bf58c8eddb Make LIBCXX_ENABLE_STATIC_ABI_LIBRARY merge libc++.a and libc++abi.a
llvm-svn: 287373
2016-11-18 19:53:45 +00:00
Eric Fiselier 5f7878964a Make merge_archives.py executable
llvm-svn: 287337
2016-11-18 11:29:05 +00:00
Eric Fiselier be8f020642 Add merge_archives.py utility
llvm-svn: 287336
2016-11-18 11:26:14 +00:00
Eric Fiselier f9980200aa Remove _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
libc++ no longer supports C++11 compilers that don't implement `= default`.
This patch removes all instances of the feature test macro
_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS as well as the potentially dead code it hides.

llvm-svn: 287321
2016-11-18 06:42:17 +00:00
Shoaib Meenai eb72bbfad4 [libc++] Fix preprocessor guard for overload declaration
Fix a typo in the conditional.  Caught by going through list of removed
symbols when building with hidden visibility.

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

llvm-svn: 287309
2016-11-18 04:31:09 +00:00
Eric Fiselier edfd47d40f update Apples ABI list to ignore non-std symbols
llvm-svn: 287301
2016-11-18 02:36:58 +00:00
Eric Fiselier 4b10f489fb Change sym_check to filter non-stdlib symbols.
Currently sym_check almost all names found in the binary, including those
which are defined in other libraries. This makes our ABI lists harder to maintain.

This patch adds a --only-stdlib-symbols option to sym_check which removes
all symbols which aren't possibly provided by libc++. It also re-generates
the linux ABI list after making this change.

llvm-svn: 287294
2016-11-18 01:40:20 +00:00
Eric Fiselier ded7cf916f Workaround compilers w/o C++1z inline variables
llvm-svn: 287255
2016-11-17 20:08:43 +00:00
Eric Fiselier 371ecc6398 Remove files missed in r287250
llvm-svn: 287251
2016-11-17 19:24:34 +00:00
Eric Fiselier 034555f1a2 Implement P0504R0: Revisiting in-place tag types for any/optional/variant
llvm-svn: 287250
2016-11-17 19:24:04 +00:00
Eric Fiselier 66ddd34e8d Test changes for P0504R0 "Revisiting in-place tag types for any/optional/variant". Patch from Casey Carter
llvm-svn: 287249
2016-11-17 19:23:35 +00:00
Shoaib Meenai dce4218df7 [libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`
This is a generalization of `_LIBCPP_NEW_DELETE_VIS`; the new macro name
captures the semantics better, and also allows us to get rid of the
`_WIN32` check in `include/new`. No functional change.

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

llvm-svn: 287164
2016-11-16 22:18:10 +00:00
Eric Fiselier c2b49f5abb Fix -verify tests for older ccache versions
llvm-svn: 287109
2016-11-16 14:48:42 +00:00
Eric Fiselier 86dd66e96c Fix non-reserved name usage
llvm-svn: 287080
2016-11-16 04:45:32 +00:00
Justin Lebar 20cb820880 [libcxx] Mark xonstexpr-fns.pass.cpp as XFAIL: gcc.
This fails with gcc because __builtin_isnan and friends, which
libcpp_isnan and friends call, are not themselves constexpr-evaluatable.

llvm-svn: 287041
2016-11-15 22:03:29 +00:00
Eric Fiselier 7004d6664e Add .clang-format to libc++
Adding a Clang Format file to libc++ and which style it should use has been
discussed a couple of times. This patch finally adds a .clang-format file
which specifies LLVM styles.

Personally I dislike how the LLVM style handles much of the meta-programming
in libc++. However the general consensus was that libc++ should prefer the
LLVM style and make adjustments where needed.

Note that using clang-format on changes is not required, especially for
changes within the headers. However formatting tests should be encouraged.

llvm-svn: 287020
2016-11-15 20:21:30 +00:00
Justin Lebar 2d3482287b [CUDA] Mark __libcpp_{isnan,isinf,isfinite} as constexpr.
Summary:
This makes these functions available on host and device, which is
necessary to compile <complex> for the device.

Reviewers: hfinkel, EricWF

Subscribers: cfe-commits

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

llvm-svn: 287012
2016-11-15 19:15:57 +00:00
Vedant Kumar 50d161ce0f Revert "P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests."
This reverts commit r286884, because it breaks the Xcode 7 builders:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/1583

Here is a PR that tracks the issue:
https://llvm.org/bugs/show_bug.cgi?id=31016

llvm-svn: 287004
2016-11-15 18:48:36 +00:00
Stephan T. Lavavej 6d279e8e98 [libcxx] [test] D26627: Fix ordering assumptions in unordered container tests.
llvm-svn: 286984
2016-11-15 17:00:38 +00:00
Stephan T. Lavavej 64bac8b5fe [libcxx] [test] D26625: future_error::what() is implementation-defined.
llvm-svn: 286983
2016-11-15 17:00:32 +00:00
Stephan T. Lavavej 49188b1d3c [libcxx] [test] D26624: Fix bucket_count() assumptions.
With a max_load_factor of 1.0, the only guarantee is that
bucket_count() >= size(). (Note: setting max_load_factor without
rehashing isn't supposed to affect this, because setting
max_load_factor is currently specified to be constant time.)

llvm-svn: 286982
2016-11-15 17:00:24 +00:00
Marshall Clow f7182fe464 Missed one of the try blocks the first time :-(. Thanks to Renato for the heads up.
llvm-svn: 286932
2016-11-15 05:03:22 +00:00
Marshall Clow 48b520a7b6 P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests.
llvm-svn: 286884
2016-11-14 20:41:17 +00:00
Marshall Clow 209fc55b01 Missed a test with exceptions disabled earlier. Oops.
llvm-svn: 286883
2016-11-14 20:38:43 +00:00
Marshall Clow 065b3af096 Implement P0516: 'Clarify That shared_future’s Copy Operations have Wide Contracts' which was adopted last week in Issaquah
llvm-svn: 286877
2016-11-14 19:58:05 +00:00
Marshall Clow 10e59fac3e Make one of the new tests fail correctly on pre-C++17 systems
llvm-svn: 286872
2016-11-14 19:35:34 +00:00
Marshall Clow 87f2f1687e Implement P0510 'Make future_error Constructible' adopted in Issaquah
llvm-svn: 286864
2016-11-14 18:56:24 +00:00
Marshall Clow 1c7fe126ee Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
llvm-svn: 286858
2016-11-14 18:22:19 +00:00
Stephan T. Lavavej 4dc0ed8390 [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.

llvm-svn: 286847
2016-11-14 17:35:14 +00:00
Marshall Clow 539dd132ef Update C++1z status with LWG papers from Issaquah.
llvm-svn: 286835
2016-11-14 15:09:45 +00:00
Marshall Clow 1d44f0fb46 Update C++1z status with LFTS issues from Issaquah.
llvm-svn: 286834
2016-11-14 14:53:07 +00:00
Marshall Clow c0681d2b0e Update C++1z status with C++17 issues from Issaquah. Still to come: LFTS issues and papers
llvm-svn: 286828
2016-11-14 14:41:33 +00:00
Roger Ferrer Ibanez aa35ecfecd Protect std::ios tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown. Also add
some missing asserts in the original test.

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

llvm-svn: 286823
2016-11-14 13:44:50 +00:00
Roger Ferrer Ibanez 059680f3f0 Protect nested-exceptions tests under no-exceptions
Differential Revision: https://reviews.llvm.org/D26458

llvm-svn: 286813
2016-11-14 11:00:28 +00:00
Roger Ferrer Ibanez 84c152a130 Update tests for strings conversions under libcpp-no-exceptions
Differential Revision: https://reviews.llvm.org/D26139

llvm-svn: 286812
2016-11-14 10:44:26 +00:00
Roger Ferrer Ibanez 4a152f147f Protect smart-pointer tests under no exceptions
Skip tests that expect an exception be thrown under no-exceptions.

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

llvm-svn: 286809
2016-11-14 10:27:56 +00:00
Eric Fiselier 209a397060 Fix ABI configuration detection on OS X
llvm-svn: 286792
2016-11-14 03:03:13 +00:00
Eric Fiselier 310891f29a Fix CMake set syntax
llvm-svn: 286791
2016-11-14 02:51:30 +00:00
Eric Fiselier 28349f9bf2 Add check-cxx-abilist target when supported.
This patch adds a `check-cxx-abilist` target which verifies the libc++.so ABI
when the current build configuration matches the configuration used to generate
the ABI lists.

In order to make this change `HandleOutOfTreeLLVM.cmake` needed to be modified
to include `LLVMConfig.cmake` so that `TARGET_TRIPLE` is defined. Hopefully
the changes needed to accommodate this won't break existing build
configurations.

llvm-svn: 286789
2016-11-14 02:43:12 +00:00
Eric Fiselier efd48ca568 Add docs for use-configurable libc++ features
llvm-svn: 286784
2016-11-13 23:00:30 +00:00
Eric Fiselier 79ff8f0375 Fix GCC libc++abi build
llvm-svn: 286783
2016-11-13 22:27:00 +00:00
Eric Fiselier 2371589266 Implement LWG 2770 - Make tuple_size<T> defined for all T
llvm-svn: 286779
2016-11-13 20:43:50 +00:00
Eric Fiselier 40905833b5 Fix PR30979 - tuple<move_only> is constructible from move_only const&
llvm-svn: 286774
2016-11-13 19:54:31 +00:00
Roger Ferrer Ibanez aee391b535 Protect bitset tests under libcpp-no-exceptions
Bitset tests feature a sequence of tests of increasing bitset sizes,
but these tests rely on exceptions when the bitset size is less than
50 elements.

This change adds a flag to tell whether a test should throw. If it must
throw it will be skipped under no-exceptions.

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

llvm-svn: 286474
2016-11-10 16:54:55 +00:00
Petr Hosek 260952ed1a [CMake] Check runtimes subdir when looking for libcxxabi
The runtimes subdir is the new location for runtimes, we should
include it when looking for libcxxabi headers.

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

llvm-svn: 286333
2016-11-09 03:22:28 +00:00
Shoaib Meenai 76728d88ec [libc++] Remove unnecessary MSVCRT exclusions
Visual Studio 2013 and up have these functions, and we don't need to
support older versions.

There are some remaining _LIBCPP_MSVCRT exclusions which are present on
Visual Studio 2015 but not 2013. Those will be addressed in a follow-up.

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

llvm-svn: 286202
2016-11-08 03:31:42 +00:00
Roger Ferrer Ibanez a5672e0c4b Protect std::experimental::optional tests under libcpp-no-exceptions
In these tests there are some paths that explicitly throw, so use
the TEST_THROW macro that was proposed for this and then skip the tests
that may enter the throwing path.

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

llvm-svn: 286099
2016-11-07 08:23:59 +00:00
Eric Fiselier fbc9ff244c Upgrade in-tree google benchmark to v1.1
llvm-svn: 286029
2016-11-05 00:30:27 +00:00
Stephan T. Lavavej 0f901c7ec4 [libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.
This replaces every occurrence of _LIBCPP_STD_VER in the tests with
TEST_STD_VER. Additionally, for every affected
file, #include "test_macros.h" is being added explicitly if it wasn't
already there.

https://reviews.llvm.org/D26294

llvm-svn: 286007
2016-11-04 20:26:59 +00:00
Marshall Clow 720ef47200 Implement another part of P0031; adding constexpr to move_iterator
llvm-svn: 285818
2016-11-02 15:30:26 +00:00
Roger Ferrer Ibanez 50e59f3b60 Remove spurious token from #endif
llvm-svn: 285792
2016-11-02 08:36:43 +00:00
Roger Ferrer Ibanez 8c6562398e Protect tests for new/delete under libcpp-no-exceptions
Skip the tests that expect an exception be thrown and protect unreachable catch blocks.

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

llvm-svn: 285791
2016-11-02 08:14:57 +00:00
Eric Fiselier 5fd26e13da Fix GCC test failure caused by manually defining _LIBCPP_HAS_NO_VARIADICS
llvm-svn: 285788
2016-11-02 05:08:58 +00:00
Eric Fiselier 0b460e6bf8 Fix __libcpp_is_constructible for source types with explicit conversion operators.
Previously __libcpp_is_constructible checked the validity of reference
construction using 'eat<To>(declval<From>())' but this doesn't consider
From's explicit conversion operators. This patch teaches __libcpp_is_constructible
how to handle these cases. To do this we need to check the validity
using 'static_cast<To>(declval<From>())'. Unfortunately static_cast allows
additional base-to-derived and lvalue-to-rvalue conversions, which have to be
checked for and manually rejected.

While implementing these changes I discovered that Clang incorrectly
rejects `static_cast<int&&>(declval<float&>())` even though
`int &&X(declval<float&>())` is well formed. In order to tolerate this bug
the `__eat<T>(...)` needs to be left in-place. Otherwise it could be replaced
entirely with the new static_cast implementation.

Thanks to Walter Brown for providing the test cases.

llvm-svn: 285786
2016-11-02 03:57:34 +00:00
Roger Ferrer Ibanez 8a915ed644 Protect exceptional paths under libcpp-no-exceptions
These tests are of the form

try {
   action-that-may-throw
   assert(!exceptional-condition)
   assert(some-other-facts)
 } catch (relevant-exception) {
   assert(exceptional-condition)
 }

Under libcpp-no-exceptions there is still value in verifying
some-other-facts while avoiding the exceptional case. So for these tests
just conditionally check some-other-facts if exceptional-condition is
false. When exception are supported make sure that a true
exceptional-condition throws an exception

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

llvm-svn: 285697
2016-11-01 15:46:16 +00:00
Roger Ferrer Ibanez 60d6ef63a4 Protect lock tests under libcpp-no-exceptions
Skip tests that expect an exception to be thrown.

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

llvm-svn: 285695
2016-11-01 15:00:16 +00:00
Roger Ferrer Ibanez 8cba0befb4 Protect tests that expect an exception for an unknown std::random_device
Skip these tests under libcpp-no-exceptions.

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

llvm-svn: 285677
2016-11-01 08:11:12 +00:00
Shoaib Meenai 73aa38dfb3 [libc++] Add configuration define for off_t functions
Create this define in __config and use it elsewhere, instead of checking
the operating system/library defines in other files. The aim is to
reduce the usage of _WIN32 outside __config. No functional change.

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

llvm-svn: 285582
2016-10-31 15:09:10 +00:00
Roger Ferrer Ibanez c6a40d24d0 Fix archetypes.hpp under libcpp-no-extensions and std level < 14
Under -fno-exceptions TEST_THROW becomes abort / __builtin_abort which returns
void. This causes a type mismatch in the conditional operator when testing the
library in C++98,03,11 modes.

Use a comma operator to workaround this problem.

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

llvm-svn: 285572
2016-10-31 14:14:13 +00:00
Roger Ferrer Ibanez 3565c96d86 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

llvm-svn: 285550
2016-10-31 08:47:53 +00:00