Commit Graph

3253 Commits

Author SHA1 Message Date
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
Eric Fiselier ebcc86e469 Add 'inline' but not 'always_inline' to std::strings destructor.
Adding both 'inline' and 'always_inline' to the destructor has been contentious.
However most of the performance benefits can be gained by only adding 'inline',
and there is no reason to hold up that change while discussing the other.

llvm-svn: 285538
2016-10-31 03:42:50 +00:00
Eric Fiselier 0f0a077c89 Remove additional function template definitions from the dylib
llvm-svn: 285537
2016-10-31 03:40:29 +00:00