Commit Graph

4324 Commits

Author SHA1 Message Date
Roman Lebedev
5cf53b55e6 Fix last_write_time.pass.cpp to work with clang-3.9 and earlier
At least with clang-3.9 and earlier, -Wunknown-pragmas is also needed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15 21:52:53 +00:00
Roman Lebedev
4b05db4286 Really do make sure that last_write_time.pass.cpp still works with old clang
I *did* try to check that such kind of an issue was not introduced
by the rL315874, but clearly i failed to finish verification.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15 20:46:12 +00:00
Roman Lebedev
0fdc4c9c6b Silence clang's -Wtautological-constant-compare in last_write_time.pass.cpp
Previously this broke the builders, when D38101 was committed.
Silence the warning so that it can be re-landed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15 20:12:42 +00:00
Benjamin Kramer
5384fd8538 Placate unused variable warnings uncovered by improvements to clang's -Wunused-variable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-14 15:52:38 +00:00
Marshall Clow
c85f85a56b More fuzzing infastructre - regex
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12 14:48:09 +00:00
Roger Ferrer Ibanez
7c31c8407b Mark test as a long-test
Differential Revision: https://reviews.llvm.org/D38452



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315570 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12 08:46:05 +00:00
Roger Ferrer Ibanez
2f494f7331 Remove unneeded typename from test
Differential Revision: https://reviews.llvm.org/D38628



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 07:42:19 +00:00
Shoaib Meenai
18dba06924 [libc++] Support Microsoft ABI without vcruntime headers
The vcruntime headers are hairy and clash with both libc++ headers
themselves and other libraries. libc++ normally deals with the clashes
by deferring to the vcruntime headers and silencing its own definitions,
but for clients which don't want to depend on vcruntime headers, it's
desirable to support the opposite, i.e. have libc++ provide its own
definitions.

Certain operator new/delete replacement scenarios are not currently
supported in this mode, which requires some tests to be marked XFAIL.
The added documentation has more details.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-09 19:25:17 +00:00
Shoaib Meenai
7762784b98 [libc++] Clarify names of ABI forcing macros
Make it clear that these are intended only to force a specific ABI when
the autodetection would give the wrong result by renaming the cmake
options and adding separate forcing macros, as suggested by EricWF in
the post-commit review of r314949 and further discussed on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314965 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05 02:18:08 +00:00
Shoaib Meenai
f7e9063861 [libc++] Move cache variable definition. NFC
Move it to where the other ABI cache variables/options are defined.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 23:51:57 +00:00
Shoaib Meenai
36d0ee6c87 [libc++] Allow users to explicitly specify ABI
libc++'s current heuristic for detecting Itanium vs. Microsoft ABI falls
short in some cases. For example, it will detect windows-itanium targets
as using the Microsoft ABI, since they set `_MSC_VER` (for compatibility
with Microsoft headers). Leave the current heuristic in place by default
but also allow users to explicitly specify the ABI if need be.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 23:44:38 +00:00
Eric Fiselier
2b7279cb08 Fix accidental assignment inside test asserts
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 23:21:18 +00:00
Shoaib Meenai
2bba98eea0 [libc++] Add site config option for ABI macros
Some ABI macros affect headers, so it's nice to have a site config
option for them. Add a LIBCXX_ABI_DEFINES cmake macro to allow
specifying a list of ABI macros to define in the site config.

The primary design constraint (as discussed with Eric on IRC a while
back) was to not have to repeat the ABI macro names in cmake, which only
leaves a free-form cmake list as an option. A somewhat unfortunate
consequence is that we can't verify that the ABI macros being defined
actually exist, though we can at least perform some basic sanity
checking, since all the ABI macros begin with _LIBCPP_ABI_.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 23:17:12 +00:00
Marshall Clow
29ae2ba656 Initial cut at infastructure for fuzzing support for OSS-fuzz
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 22:23:03 +00:00
Eric Fiselier
8a29c9d39b Add C++17 explicit deduction guides to std::pair.
This patch adds the newly standardized deduction guides
for std::pair, allowing it to work class template deduction.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 00:04:26 +00:00
Eric Fiselier
28dd96b8a9 Fix test suite misconfiguration on OS X
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03 02:25:05 +00:00
Eric Fiselier
5fe8797d57 Improve test runner output for broken configurations.
Previously LIT would often fail while attempting to set up/configure
the test compiler; normally when attempting to dump the builtin macros.
This sort of failure provided no useful information about what went
wrong with the compiler, making the actual issues hard --- if not
impossible --- to debug easily.

This patch changes the LIT configuration to report the failure explicitly,
including the failed compile command and the stdout/stderr output.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02 22:52:51 +00:00
Casey Carter
f17205d6a8 [test] Allow other implementations to strengthen noexcept on deque's move constructor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-30 23:15:22 +00:00
Casey Carter
006f64c647 [test] forwardlist.cons/move_noexcept.pass.cpp
* Don't forbid non-libc++ implementations from strengthening noexcept on forward_list's move constructor.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28 20:23:43 +00:00
Stephan T. Lavavej
5d5bbc45ab [libcxx] [test] Fix unused local typedef warnings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 23:08:43 +00:00
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