Commit Graph

4304 Commits

Author SHA1 Message Date
Stephan T. Lavavej
a2f0b51b9a [libcxx] [test] Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 23:08:41 +00:00
Stephan T. Lavavej
7f0fd06bf7 [libcxx] [test] Silence warning C4324 for MSVC.
This warning "structure was padded due to alignment specifier" says
that the compiler is going to do exactly what you asked it to do.
It's triggered by the tests for over-aligned dynamic memory allocation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 23:08:39 +00:00
Marshall Clow
1e32db7b33 Revert 313789 because gcc doesn't like it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 19:38:43 +00:00
Marshall Clow
9641305bba Mark the __eval methods on independent_bits_engine (and __independent_bits_engine) as const, since they make no changes to the object. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 18:32:08 +00:00
Marshall Clow
e2b6832fcd Fix a bit of UB in __independent_bits_engine. Fixes PR#34663
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 17:34:11 +00:00
Zachary Turner
3a84027eb1 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 16:01:50 +00:00
Weiming Zhao
bc4474e3ba [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 23:18:03 +00:00
Zachary Turner
7a87049e47 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:19:10 +00:00
Zachary Turner
81306615ac 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 03:11:35 +00:00
Zachary Turner
2205438c1f Fix llvm-lit script generation in libcxx.
Differential Revision: https://reviews.llvm.org/D37997

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 02:46:28 +00:00
Eric Fiselier
805e11b38c Fix failing ASAN test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:01:18 +00:00
Eric Fiselier
f7aaaaaa65 Fix two failing -verify tests to tolerate old and new clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 21:50:59 +00:00
Eric Fiselier
edf6f11feb Update changelog revision
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 21:00:27 +00:00
Eric Fiselier
0732dcfd0d 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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 20:59:43 +00:00
Eric Fiselier
dfcb00a2c5 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 20:57:05 +00:00
Shoaib Meenai
ffe3715924 [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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 18:49:34 +00:00
Shoaib Meenai
ca79c159d8 [libc++] Remove unnecessary struct tag
It causes warnings about mismatched tags, and it's not needed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 06:19:31 +00:00
Saleem Abdulrasool
2656897657 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 05:42:39 +00:00
Eric Fiselier
63d88110cc 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 00:31:38 +00:00
Shoaib Meenai
0a2af12aff [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 18:23:43 +00:00
Martin Storsjo
5f919fe349 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 06:55:44 +00:00
Marshall Clow
327f3b7eff Mark the new tests as unsupported when there are no exceptions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 23:33:34 +00:00
Martell Malone
8122e2490e libcxx: fix merge_archives error variable name
Differential Revision: https://reviews.llvm.org/D37728

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 22:32:02 +00:00
Martin Storsjo
2c607f47f9 Handle object files named *.obj in merge_archives.py
Differential Revision: https://reviews.llvm.org/D37133

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 20:54:15 +00:00
Marshall Clow
59b296ea5c XFAIL a couple of new <regex> tests for C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 19:01:32 +00:00
Marshall Clow
ee596eb469 Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks to Tim Shen for the patch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313056 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 17:56:59 +00:00
Marshall Clow
29149d3e35 Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 15:00:43 +00:00
Marshall Clow
60f8ad1b1d mark mersenne_twister_engine<>::seed(result_type __sd) with _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK to placate UBSAN. Fixes PR#34160
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 18:10:33 +00:00
Marshall Clow
ff400da261 Add include of <string> to <system_error>, since things in there return strings. Fixes PR#34529.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 16:05:42 +00:00
Eric Fiselier
f2c4a96359 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 23:41:20 +00:00
Eric Fiselier
d5a494e058 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 23:37:47 +00:00
Eric Fiselier
f83132a4d1 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-10 23:12:33 +00:00
Brian Cain
11762b4acd XFAIL tests on SLES11
XFAIL some failing tests for SLES11 (older glibc), also replace spaces
in linux distro w/dashes.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 03:57:02 +00:00
Marshall Clow
0b9db07158 Add even more string_view tests. These found some bugs in the default parameter value for rfind/find_last_of/find_last_not_of
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 04:19:32 +00:00
Marshall Clow
cd0354ef44 Another missing string_view test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312691 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 03:03:48 +00:00
Marshall Clow
e942bb000f Add more string_view tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 02:46:09 +00:00
Martin Storsjo
ea75e09e61 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 05:07:25 +00:00
Martin Storsjo
ed487a3dc3 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-04 19:46:53 +00:00
Stephan T. Lavavej
a1ae67bc89 [libcxx] [www] Change an absolute link to cxx1z_status.html to be relative.
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:51 +00:00
Stephan T. Lavavej
b8813f3bde [libcxx] [www] Strip trailing whitespace.
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:48 +00:00
Stephan T. Lavavej
aeea9b0310 [libcxx] [www] Fix broken link for LLVM Bugzilla.
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312261 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:46 +00:00
Stephan T. Lavavej
f966d3f5c4 [libcxx] [www] Manually change http links to https.
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312260 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:42 +00:00
Stephan T. Lavavej
1e708af617 [libcxx] [www] Semi-manually change http://www.open-std.org and http://isocpp.org papers to https://wg21.link .
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:39 +00:00
Stephan T. Lavavej
35509d0fae [libcxx] [www] Change http://cplusplus.github.io/LWG/lwg-defects.html# to https://wg21.link/lwg .
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:36 +00:00
Stephan T. Lavavej
819264f0ff [libcxx] [www] Change http://wg21.link to https://wg21.link .
Fixes D37318.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:59:33 +00:00
Casey Carter
08242cbd9b [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:56:31 +00:00
Marshall Clow
90dfa2804a Fix test for C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@311967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-29 01:10:51 +00:00
Marshall Clow
25a78dcd77 Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken Dörrie for the suggested fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@311952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28 23:16:13 +00:00
Stephan T. Lavavej
e8c8bc9433 [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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@311705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24 21:24:08 +00:00
Aditya Kumar
d4c8905691 [NFC] remove trailing WS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@311283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20 10:38:55 +00:00