Commit Graph

4292 Commits

Author SHA1 Message Date
Marshall Clow 08bba64a10 Revert 313789 because gcc doesn't like it
llvm-svn: 313803
2017-09-20 19:38:43 +00:00
Marshall Clow 8f27eef230 Mark the __eval methods on independent_bits_engine (and __independent_bits_engine) as const, since they make no changes to the object. NFC.
llvm-svn: 313789
2017-09-20 18:32:08 +00:00
Marshall Clow 5beb2c3ab3 Fix a bit of UB in __independent_bits_engine. Fixes PR#34663
llvm-svn: 313776
2017-09-20 17:34:11 +00:00
Zachary Turner 3dd2356b3a Make libcxx tests work when llvm sources are not present.
Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

llvm-svn: 313763
2017-09-20 16:01:50 +00:00
Weiming Zhao fbfaec7089 [libc++] Replace __sync_* functions with __libcpp_atomic_* functions
Summary:
This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper
function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS.

Reviewers: EricWF, jroelofs, mclow.lists, compnerd

Reviewed By: EricWF, compnerd

Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits

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

llvm-svn: 313694
2017-09-19 23:18:03 +00:00
Zachary Turner 50105d2942 Resubmit "Fix llvm-lit script generation in libcxx."
After speaking with the libcxx owners, they agreed that this is
a bug in the bot that needs to be fixed by the bot owners, and
the CMake changes are correct.

llvm-svn: 313643
2017-09-19 17:19:10 +00:00
Zachary Turner 0556b995e1 Revert "Fix llvm-lit script generation in libcxx."
This reverts commit 4ad71811d45268d81b60f27e3b8b2bcbc23bd7b9.

There is a bot that is checking out libcxx and lit with nothing
else and then running lit.py against the test tree.  Since there's
no LLVM source tree, there's no LLVM CMake.  CMake actually
reports this as a warning saying unsupported libcxx configuration,
but I guess someone is depending on it anyway.

llvm-svn: 313607
2017-09-19 03:11:35 +00:00
Zachary Turner cbafb0f8e1 Fix llvm-lit script generation in libcxx.
Differential Revision: https://reviews.llvm.org/D37997

llvm-svn: 313606
2017-09-19 02:46:28 +00:00
Eric Fiselier 1468677cbe Fix failing ASAN test
llvm-svn: 313576
2017-09-18 22:01:18 +00:00
Eric Fiselier 969db423c0 Fix two failing -verify tests to tolerate old and new clang versions
llvm-svn: 313502
2017-09-17 21:50:59 +00:00
Eric Fiselier 80705d8a47 Update changelog revision
llvm-svn: 313501
2017-09-17 21:00:27 +00:00
Eric Fiselier d87b880e00 ABI: Fix for undefined "___cxa_deleted_virtual" symbol in MacOSX
Patch from Eddie Elizondo. Reviewed as D37830 (https://reviews.llvm.org/D37830).

On MacOSX the following program:

struct S { virtual void f() = delete; };
int main() { new S; }
Fails with the following error:

Undefined symbols for architecture x86_64:
  "___cxa_deleted_virtual"
This adds a fix to export the needed symbols.

Test:

> lit -sv test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
> Testing Time: 0.21s
>   Expected Passes    : 1

llvm-svn: 313500
2017-09-17 20:59:43 +00:00
Eric Fiselier 6b76a681dd Fix failing -verify tests due to change in Clangs static_assert message.
Clang recently changed the way it outputs static assert diagnostics.
This patch fixes libc++'s -verify tests so they tolerate both the old
and new message format.

llvm-svn: 313499
2017-09-17 20:57:05 +00:00
Shoaib Meenai 03e314bb0d [libc++] Account for Microsoft CRT const overloads
Microsoft's CRT already provides the const overloads, and it defines the
`_CRT_CONST_CORRECT_OVERLOADS` macro to indicate their presence. Check
for this macro before attempting to define our own const-correct
overloads, to avoid compiler warnings about casts dropping const
qualifiers.

llvm-svn: 313377
2017-09-15 18:49:34 +00:00
Shoaib Meenai c3f5cc8e78 [libc++] Remove unnecessary struct tag
It causes warnings about mismatched tags, and it's not needed.

llvm-svn: 313345
2017-09-15 06:19:31 +00:00
Saleem Abdulrasool e7b38cdc00 typeinfo: provide a partial implementation for Win32
The RTTI structure is different on Windows when building under MS ABI.
Update the definition to reflect this. The structure itself contains an
area for caching the undecorated name (which is 0-initialized). The
decorated name has a bitfield followed by the linkage name. When
std::type_info::name is invoked for the first time, the runtime should
undecorate the name, cache it, and return the undecorated name. This
requires access to an implementation of __unDName. For now, return
the raw name.

This uses the fnv-1a hash to hash the name of the RTTI. We could use an
alternate hash (murmur? city?), but, this was the quickest to throw
together.

llvm-svn: 313344
2017-09-15 05:42:39 +00:00
Eric Fiselier 9f8fef9504 Fix accidental ADL in std::allocator_traits meta-programming.
There were a number of cases where __double_underscore functions,
for example __has_construct_test, were called without being qualified,
causing ADL to occur. This patch qualifies those calls to avoid this
problem.

Thanks to David L. Jones for point out the issue initially.

llvm-svn: 313324
2017-09-15 00:31:38 +00:00
Shoaib Meenai 87fc45800a [libc++] Prevent stale site configuration headers
If we define cmake macros that require a site config, and then undefine
all such macros, a stale site config header will be left behind.
Explicitly delete any generate site config if we don't need one to avoid
this.

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

llvm-svn: 313284
2017-09-14 18:23:43 +00:00
Martin Storsjo fb8eb6fce8 Use CMAKE_AR instead of the system default 'ar' for merging static libraries
Using the system default 'ar' might not be the right choice when
cross compiling.

Don't prepend the ar options by a dash, not all ar implementations
support that (llvm-ar doesn't).

Also pass the 's' option when creating the merged library, to create
an index.

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

llvm-svn: 313122
2017-09-13 06:55:44 +00:00
Marshall Clow bff66aab70 Mark the new tests as unsupported when there are no exceptions
llvm-svn: 313092
2017-09-12 23:33:34 +00:00
Martell Malone f922501d98 libcxx: fix merge_archives error variable name
Differential Revision: https://reviews.llvm.org/D37728

llvm-svn: 313084
2017-09-12 22:32:02 +00:00
Martin Storsjo 499f58a548 Handle object files named *.obj in merge_archives.py
Differential Revision: https://reviews.llvm.org/D37133

llvm-svn: 313072
2017-09-12 20:54:15 +00:00
Marshall Clow c589f5f875 XFAIL a couple of new <regex> tests for C++03
llvm-svn: 313064
2017-09-12 19:01:32 +00:00
Marshall Clow 5a72679338 Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks to Tim Shen for the patch
llvm-svn: 313056
2017-09-12 17:56:59 +00:00
Marshall Clow d90758e2ef Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report
llvm-svn: 313031
2017-09-12 15:00:43 +00:00
Marshall Clow 31372681be mark mersenne_twister_engine<>::seed(result_type __sd) with _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK to placate UBSAN. Fixes PR#34160
llvm-svn: 312932
2017-09-11 18:10:33 +00:00
Marshall Clow bc455478e1 Add include of <string> to <system_error>, since things in there return strings. Fixes PR#34529.
llvm-svn: 312923
2017-09-11 16:05:42 +00:00
Eric Fiselier 94d555116c Fix PR34298 - Allow std::function with an incomplete return type.
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312892
2017-09-10 23:41:20 +00:00
Eric Fiselier 85cde7d2f4 Revert "Fix PR34298 - Allow std::function with an incomplete return type."
This reverts commit r312890 because the test case fails to compile for
older versions of Clang that reject initializing a const object without
a user defined constructor.

Since this patch should go into 5.0.1, I want to keep it an atomic change,
and will re-commit it with a fixed test case.

llvm-svn: 312891
2017-09-10 23:37:47 +00:00
Eric Fiselier 358ca0c04b Fix PR34298 - Allow std::function with an incomplete return type.
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312890
2017-09-10 23:12:33 +00:00
Brian Cain 086b6682dd XFAIL tests on SLES11
XFAIL some failing tests for SLES11 (older glibc), also replace spaces
in linux distro w/dashes.

llvm-svn: 312774
2017-09-08 03:57:02 +00:00
Marshall Clow 064028bb05 Add even more string_view tests. These found some bugs in the default parameter value for rfind/find_last_of/find_last_not_of
llvm-svn: 312693
2017-09-07 04:19:32 +00:00
Marshall Clow e2addb79b8 Another missing string_view test
llvm-svn: 312691
2017-09-07 03:03:48 +00:00
Marshall Clow b6d73126c8 Add more string_view tests
llvm-svn: 312690
2017-09-07 02:46:09 +00:00
Martin Storsjo f8689b1be1 Redirect strftime_l to the locale-ignorant strftime on mingw
_strftime_l is only available in the numbered msvcrt versions
(starting from msvcr80.dll). In the default configuration, mingw
targets the unversioned msvcrt.dll - and there, _strftime_l is
not available (not even on windows 10).

If __MSVCRT_VERSION__ is set to a higher value (indicating a
non-default target and wanting to link to msvcrXX.dll), use the
correct function.

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

llvm-svn: 312617
2017-09-06 05:07:25 +00:00
Martin Storsjo 783d433f16 Add MINGW_LIBRARIES to the linker flags
This is essential when building with -nodefaultlibs.

This is similar to what already is done in libcxxabi in SVN r302760.

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

llvm-svn: 312498
2017-09-04 19:46:53 +00:00
Stephan T. Lavavej 6f297ba8a9 [libcxx] [www] Change an absolute link to cxx1z_status.html to be relative.
Fixes D37318.

llvm-svn: 312263
2017-08-31 17:59:51 +00:00
Stephan T. Lavavej 9c88eeb68d [libcxx] [www] Strip trailing whitespace.
Fixes D37318.

llvm-svn: 312262
2017-08-31 17:59:48 +00:00
Stephan T. Lavavej 98fa5d4a97 [libcxx] [www] Fix broken link for LLVM Bugzilla.
Fixes D37318.

llvm-svn: 312261
2017-08-31 17:59:46 +00:00
Stephan T. Lavavej 69c2e1336f [libcxx] [www] Manually change http links to https.
Fixes D37318.

llvm-svn: 312260
2017-08-31 17:59:42 +00:00
Stephan T. Lavavej 907c1ab603 [libcxx] [www] Semi-manually change http://www.open-std.org and http://isocpp.org papers to https://wg21.link .
Fixes D37318.

llvm-svn: 312259
2017-08-31 17:59:39 +00:00
Stephan T. Lavavej 1dc1fa2347 [libcxx] [www] Change http://cplusplus.github.io/LWG/lwg-defects.html# to https://wg21.link/lwg .
Fixes D37318.

llvm-svn: 312258
2017-08-31 17:59:36 +00:00
Stephan T. Lavavej 2956ea46cd [libcxx] [www] Change http://wg21.link to https://wg21.link .
Fixes D37318.

llvm-svn: 312257
2017-08-31 17:59:33 +00:00
Casey Carter e38efe12da [test] Cleanup nullopt_t tests
* Update specification text from N4387

* Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp

* is_empty<T> implies is_class<T>

* is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context

Differential Revision: D37024

llvm-svn: 312256
2017-08-31 17:56:31 +00:00
Marshall Clow 589453458d Fix test for C++03
llvm-svn: 311967
2017-08-29 01:10:51 +00:00
Marshall Clow a763b36ff4 Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken Dörrie for the suggested fix.
llvm-svn: 311952
2017-08-28 23:16:13 +00:00
Stephan T. Lavavej bc933768a6 [libcxx] [test] Update for C++17 feature removals.
test/std/containers/Emplaceable.h
test/std/containers/NotConstructible.h
test/support/counting_predicates.hpp
Replace unary_function/binary_function inheritance with typedefs.

test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
test/std/utilities/function.objects/func.require/binary_function.pass.cpp
test/std/utilities/function.objects/func.require/unary_function.pass.cpp
Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function.

test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support.

test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
This test doesn't need to be skipped in C++17 mode. Only the construction of
std::function from an allocator needs to be skipped in C++17 mode.

test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
When testing these reference_wrapper features, unary_function inheritance is totally irrelevant.

test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
Define and use my_unary_function/my_binary_function to test the weak result type machinery
(which is still present in C++17, although deprecated).

test/support/msvc_stdlib_force_include.hpp
Now we can test C++17 strictly, without enabling removed features.

Fixes D36503.

llvm-svn: 311705
2017-08-24 21:24:08 +00:00
Aditya Kumar 6c9ce223ea [NFC] remove trailing WS
llvm-svn: 311283
2017-08-20 10:38:55 +00:00
Joerg Sonnenberger 7e680f15a5 Spelling
llvm-svn: 311156
2017-08-18 12:57:36 +00:00
Stephan T. Lavavej 709be5eef2 [libcxx] [test] Rename _Up to U, etc. NFCI.
This improves readability and (theoretically) improves portability,
as _Ugly names are reserved.

This performs additional de-uglification, so all of these tests
follow the example of iterator.traits/empty.pass.cpp.

llvm-svn: 310761
2017-08-11 20:54:09 +00:00