Commit Graph

2990 Commits

Author SHA1 Message Date
Eric Fiselier 86af6f5088 Allow optional to tolerate being used with a nested class.
When Clang tries to complete a type containing `std::optional` it
considers the `in_place_t` constructor with no arguments which checks
if the value type is default constructible. If the value type is a
nested class type, then this check occurs too early and poisons the
is_default_constructible trait.

This patch makes optional deduce `in_place_t` so we can prevent
this early SFINAE evaluation. Technically this could break people
doing weird things with the in_place_t tag, but that seems less
important than making the nested class case work.

llvm-svn: 355877
2019-03-11 22:55:21 +00:00
Eric Fiselier 6e4ec6022f Fix PR41017 - Build failure with _LIBCPP_DEBUG=0 and non-const-ref
comparator for std::sort()

Our debug comparator assumed that the comparator it wraps would always
accepts the values by const ref. This isn't required by the standard.

This patch makes our __debug_less comparator forward the constness.

llvm-svn: 355752
2019-03-08 22:58:59 +00:00
Thomas Anderson 516d07de07 [libc++] Fix use-after-free when building with _LIBCPP_DEBUG=1
The issue is the following code:

    __cn1->__add(*__ip);
    (*__ip)->__c_ = __cn1;

`__ip` points into the array of iterators for container `__cn2`.  This code adds
the iterator to the array of iterators for `__cn1`, and updates the iterator to
point to the new container.

This code works fine, except when `__cn1` and `__cn2` are the same container.
`__cn1->__add()` might need to grow the array of iterators, and when it does,
`__ip` becomes invalid, so the second line becomes a use-after-free error.

Simply swapping the order of the above two lines is not sufficient, because of
the memmove() below.  The easiest and most performant solution is just to skip
touching any iterators if the containers are the same.

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

llvm-svn: 355550
2019-03-06 21:10:08 +00:00
Marshall Clow 8eda3ad29d Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple of other minor cleanups. NFC
llvm-svn: 355481
2019-03-06 03:59:44 +00:00
Davide Italiano 6de760ac4e Reinstate libc++ patches now that the lldb formatter has been updated.
"[libc++] Fix <atomic> failures on GCC"
"[libc++] Change memory_order to an enum class"
"[libc++] decoupling Freestanding atomic<T> from libatomic.a"

llvm-svn: 355427
2019-03-05 18:40:49 +00:00
Davide Italiano 1061cb6a93 [libcxx] Revert set of atomic patches that broke lldb.
Revert "[libc++] Fix <atomic> failures on GCC"
Revert "[libc++] Change memory_order to an enum class"
Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a"

The lldb formatter nededs to be updated. Shafik and Louis will
coordinate to do so.

llvm-svn: 355417
2019-03-05 17:38:33 +00:00
Louis Dionne 130322e7cc [libc++] Fix <atomic> failures on GCC
Summary:
In https://reviews.llvm.org/D58201, we turned memory_order into an enum
class in C++20 mode. However, we were not casting memory_order to its
underlying type correctly for the GCC implementation, which broke the
build bots. I also fixed a test that was failing in C++17 mode on GCC 5.

Reviewers: EricWF, jfb, mclow.lists

Subscribers: zoecarver

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

llvm-svn: 355409
2019-03-05 15:49:58 +00:00
Louis Dionne b55803283b [libc++] Change memory_order to an enum class
This implements P0439R0.

Thanks to Zoe Carver for the patch.
Differential Revision: https://reviews.llvm.org/D58201

llvm-svn: 355403
2019-03-05 14:50:25 +00:00
Eric Fiselier 1c014d75b4 Fix -fsanitize=vptr badness in <__debug>
Summary:

This patch fixes a lifetime bug when inserting a new container into the debug database. It is
diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed
during insertion.

The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI
stability from debug mode.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, christof, libcxx-commits

Tags: #libc

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

llvm-svn: 355367
2019-03-05 02:10:31 +00:00
Louis Dionne afde07ce97 [libc++] Fix forgotten fclose() in unit test
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58732

llvm-svn: 355162
2019-03-01 01:32:44 +00:00
Louis Dionne e90085029c [libc++] Increase portability of xalloc test
Do not assume that xalloc() starts at 0, which is not specified by the
Standard.

Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58299

llvm-svn: 355160
2019-03-01 00:51:54 +00:00
Louis Dionne ab19068b7f [libc++] Add is_nothrow_convertible from P0758R1
Reviewed as https://reviews.llvm.org/D58019.
Thanks to Zoe Carver for the patch.

llvm-svn: 355010
2019-02-27 17:57:38 +00:00
Marshall Clow 02e1651c1f Implment the last part of P1024: tuple-like interface to span. Reviewed as https://reviews.llvm.org/D58706.
llvm-svn: 354988
2019-02-27 15:41:37 +00:00
Marshall Clow 7d3986ea30 Implement the second part of P1227R2 - Signed ssize() functions. Reviewed as https://reviews.llvm.org/D58642
llvm-svn: 354950
2019-02-27 02:58:56 +00:00
Marshall Clow ded9f0efad Fix an ambiguity in the tests that gcc-tot complained about.
llvm-svn: 354944
2019-02-27 01:29:52 +00:00
Louis Dionne 62f3900715 [libc++] Add a test for PR14074
PR14074 was fixed in r165884, but no tests were added.

llvm-svn: 354943
2019-02-27 01:29:09 +00:00
Louis Dionne 25838c6dac [libc++] Mark several tests as XFAIL on macosx10.7
Those tests fail when linking against a new dylib but running against
macosx10.7. I believe this is caused by a duplicate definition of the
RTTI for exception classes in libc++.dylib and libc++abi.dylib, but
this matter still needs some investigation.

This issue was not caught previously because all the tests always linked
against the same dylib used for running (because LIT made it impossible
to do otherwise before r349171).

rdar://problem/46809586

llvm-svn: 354940
2019-02-27 00:57:57 +00:00
Marshall Clow 7ad06a9319 First part of P1227R2 - change span over to use 'size_t' instead of 'ptrdiff_t'. Reviewed as https://reviews.llvm.org/D58639.
llvm-svn: 354936
2019-02-27 00:32:16 +00:00
Louis Dionne 27f79151ec [libc++] Add <filesystem> to the min-mac macro header test
llvm-svn: 354932
2019-02-26 23:14:58 +00:00
Marshall Clow 46c719ddcd Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
llvm-svn: 354891
2019-02-26 16:07:03 +00:00
Marshall Clow 310b75e519 LWG3101 - span's Container constructors need another constraint. Reviewed as https://reviews.llvm.org/D57058.
llvm-svn: 354805
2019-02-25 18:32:57 +00:00
Marshall Clow 4fd0395477 Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.
llvm-svn: 354802
2019-02-25 17:58:03 +00:00
Marshall Clow 9ab85a69dc First part of P1024: Usability Enhancements for std::span. Remove operator() for indexing, and add 'front' and 'back' calls.
llvm-svn: 354801
2019-02-25 17:54:08 +00:00
Louis Dionne 73be0cb773 [libcxx] Make sure all experimental tests are disabled when enable_experimental=False
Summary:
Previously, we'd run some experimental tests even when enable_experimental=False
was used with lit.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists

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

llvm-svn: 354725
2019-02-23 11:24:03 +00:00
Louis Dionne 431cfbf172 [NFC] Fix incorrect comment in std::function test
llvm-svn: 354537
2019-02-21 00:53:26 +00:00
Louis Dionne 95601bdd29 [libcxx] Do not assume the number of elements in a moved-from associative container
Reviewed as https://reviews.llvm.org/D57903.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 353955
2019-02-13 16:43:44 +00:00
Louis Dionne 7232a84e68 [libc++] Avoid UB in the no-exceptions mode in a few places
Summary:
A few places in the library seem to behave unexpectedly when the library
is compiled or used with exceptions disabled. For example, not throwing
an exception when a pointer is NULL can lead us to dereference the pointer
later on, which is UB. This patch fixes such occurences.

It's hard to tell whether there are other places where the no-exceptions
mode misbehaves like this, because the replacement for throwing an
exception does not always seem to be abort()ing, but at least this
patch will improve the situation somewhat.

See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 353850
2019-02-12 16:06:02 +00:00
Eric Fiselier cf39dd44b8 Add fenv.h header
Summary:
Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source.

This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions.

Reviewers: rsmith, mclow.lists, ldionne

Reviewed By: rsmith

Subscribers: mgorny, christof, libcxx-commits

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

llvm-svn: 353767
2019-02-11 23:47:19 +00:00
Chandler Carruth a20f61106b Update some newly added files that mistakenly used the old file header
to the new one.

llvm-svn: 353668
2019-02-11 08:39:14 +00:00
Kamil Rytarowski 61113341f7 Mark another test as flaky
Reported on the NetBSD buildbot.

llvm-svn: 353622
2019-02-09 18:39:07 +00:00
Louis Dionne a53eb79be6 [libc++] Fix XFAILs when exceptions are disabled
It turns out that I un-XFAILed too many tests in r353210: some tests
actually fail whether exceptions are enabled or not because they use
types that are marked as unavailable even when exceptions are disabled.

llvm-svn: 353215
2019-02-05 20:55:23 +00:00
Louis Dionne f5f2f77755 [libc++] Fix XFAILs on macOS when exceptions are disabled
Some tests are marked as failing on platforms where the dylib does not
provide the required exception classes. However, when testing with
exceptions disabled, those tests shouldn't be marked as failing.

llvm-svn: 353210
2019-02-05 20:11:58 +00:00
Petr Hosek 97bc08ae02 [CMake] Support compiler-rt builtins library in tests
We're building tests with -nostdlib which means that we need to
explicitly include the builtins library. When using libgcc (default)
we can simply include -lgcc_s on the link line, but when using
compiler-rt builtins we need a complete path to the builtins library.

This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY,
so we just need to pass that path to lit and if config.compiler_rt is
true, link it to the test.

Prior to this patch, running tests when compiler-rt is being used as
the builtins library was broken as all tests would fail to link, but
with this change running tests when compiler-rt bultins library is
being used should be supported.

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

llvm-svn: 353208
2019-02-05 19:50:47 +00:00
Louis Dionne bb6d61c752 [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdef
When the whole test only works starting at some version of the Standard,
use UNSUPPORTED lit markup instead of #ifdef TEST_STD_VER. This provides
more visibility into the test suite.

Reviewed as https://reviews.llvm.org/D57704.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 353206
2019-02-05 19:50:17 +00:00
Louis Dionne 51358e45e2 [libcxx] Start defining lit features for tests depending on availability
This patch removes some vendor-specific availability XFAILs from the
test suite. In the future, when a new feature is introduced in the
dylib, an availability macro should be created and a matching lit
feature should be created. That way, the test suite can XFAIL whenever
the implementation lacks the necessary feature instead of being
cluttered by vendor-specific annotations.

Right now, those vendor-specific annotations are still somewhat cluttering
the test suite by being in `config.py`, but at least they are localized.
In the future, we could design a way to define those less intrusively or
even automatically based on the availability macros that already exist
in <__config>.

llvm-svn: 353201
2019-02-05 19:22:38 +00:00
Petr Hosek 3ad50fed48 [CMake] Update lit test configuration
There are several changes:
- Don't stringify Pythonized bools (that's why we're Pythonizing them)
- Support specifying target and sysroot via CMake variables
- Use consistent spelling for --target, --sysroot, --gcc-toolchain

llvm-svn: 353137
2019-02-05 04:44:03 +00:00
JF Bastien 2df59c5068 Support tests in freestanding
Summary:
Freestanding is *weird*. The standard allows it to differ in a bunch of odd
manners from regular C++, and the committee would like to improve that
situation. I'd like to make libc++ behave better with what freestanding should
be, so that it can be a tool we use in improving the standard. To do that we
need to try stuff out, both with "freestanding the language mode" and
"freestanding the library subset".

Let's start with the super basic: run the libc++ tests in freestanding, using
clang as the compiler, and see what works. The easiest hack to do this:

In utils/libcxx/test/config.py add:

  self.cxx.compile_flags += ['-ffreestanding']

Run the tests and they all fail.

Why? Because in freestanding `main` isn't special. This "not special" property
has two effects: main doesn't get mangled, and main isn't allowed to omit its
`return` statement. The first means main gets mangled and the linker can't
create a valid executable for us to test. The second means we spew out warnings
(ew) and the compiler doesn't insert the `return` we omitted, and main just
falls of the end and does whatever undefined behavior (if you're luck, ud2
leading to non-zero return code).

Let's start my work with the basics. This patch changes all libc++ tests to
declare `main` as `int main(int, char**` so it mangles consistently (enabling us
to declare another `extern "C"` main for freestanding which calls the mangled
one), and adds `return 0;` to all places where it was missing. This touches 6124
files, and I apologize.

The former was done with The Magic Of Sed.

The later was done with a (not quite correct but decent) clang tool:

  https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed

This works for most tests, though I did have to adjust a few places when e.g.
the test runs with `-x c`, macros are used for main (such as for the filesystem
tests), etc.

Once this is in we can create a freestanding bot which will prevent further
regressions. After that, we can start the real work of supporting C++
freestanding fairly well in libc++.

<rdar://problem/47754795>

Reviewers: ldionne, mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits

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

llvm-svn: 353086
2019-02-04 20:31:13 +00:00
Petr Hosek 6fd4e7fe02 [CMake] Support CMake variables for setting target, sysroot and toolchain
CMake has a standard way of setting target triple, sysroot and external
toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and
CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into
corresponding --target=, --sysroot= and --gcc-toolchain= variables add
included appended to CMAKE_<LANG>_FLAGS.

libunwind, libc++abi, libc++ provides their own mechanism through
<PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN
variables. These are also passed to lit via lit.site.cfg, and lit config
uses these to set the corresponding compiler flags when building tessts.

This means that there are two different ways of setting target, sysroot
and toolchain, but only one is properly supported in lit. This change
extends CMake build for libunwind, libc++abi and libc++ to also support
the CMake variables in addition to project specific ones in lit.

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

llvm-svn: 353084
2019-02-04 20:02:26 +00:00
Eric Fiselier 508da4156a Move the feature test macros script to the utils directory.
It doesn't make a lot of sense to keep it with the tests,
deep into the test suite directonies.

llvm-svn: 352970
2019-02-02 23:13:49 +00:00
Marshall Clow 2e719bc428 add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566
llvm-svn: 352926
2019-02-01 21:59:27 +00:00
Marshall Clow dd426c2fbd Fix a bit of libc++-specific behavior in the regex tests; add a missing test. Reviewed as https://reviews.llvm.org/D57391 Thanks to Andrey Maksimov for the patch
llvm-svn: 352781
2019-01-31 18:54:26 +00:00
Thomas Anderson 7f50dfa6fc [libc++] Fix Windows build error in <functional>
On my Windows system, __allocator is defined to nothing.  This change fixes build errors of the below form:

    In file included from algorithm:644:
    functional(1492,31):  error: expected member name or ';' after declaration specifiers
        const _Alloc& __allocator() const { return __f_.second(); }

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

llvm-svn: 352561
2019-01-29 23:19:45 +00:00
Eric Fiselier 011943a6e8 Fix PR40495 - is_invokable_v<void> does not compile
The meta-programming that attempted to form the invoke call expression
was not in a SFINAE context. This made it a hard error to provide
non-referencable types like 'void' or 'void (...) const'.

This patch fixes the error by checking the validity of the call
expression within a SFINAE context.

llvm-svn: 352522
2019-01-29 18:01:14 +00:00
Marshall Clow c02236b6f5 Mark some of the behavior in the move w/allocator constructors of deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out.
llvm-svn: 352512
2019-01-29 16:12:45 +00:00
Petr Hosek 4155e78912 [libc++] Use runtime rather then compile-time glibc version check
glibc supports versioning, so it's possible to build against older
version and run against newer version. This is sometimes relied on
in practice, e.g. in Fuchsia build we build against older sysroot
(equivalent to Ubuntu Trusty) to cover the broadest possible range
of host systems, but that doesn't necessarily match the system that
binary is going to run on which may have newer version, in which case
the compile test used in curr_symbol is going to fail. Using runtime
check is more reliable.

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

llvm-svn: 352425
2019-01-28 20:39:50 +00:00
Kamil Rytarowski 7c56f115b4 Mark awk.pass.cpp as XFAIL for NetBSD
Reported on the NetBSD 8 build bot.

llvm-svn: 352097
2019-01-24 20:26:02 +00:00
Marshall Clow 5a8525e0b6 D14686: 'Protect against overloaded comma in random_shuffle and improve tests' I had to cut back on the tests with this, because they were not C++03 friendly. Thanks to gribozavr for the patch
llvm-svn: 352087
2019-01-24 19:20:19 +00:00
Louis Dionne c43f673090 [libcxx] Portability fix: unordered_set and unordered_multiset iterators are not required to be the same
The unordered_set and unordered_multiset iterators are specified in the standard as follows:

using iterator             = implementation-defined; // see [container.requirements]
using const_iterator       = implementation-defined; // see [container.requirements]
using local_iterator       = implementation-defined; // see [container.requirements]
using const_local_iterator = implementation-defined; // see [container.requirements]

The pairs iterator/const_iterator and local_iterator/const_local_iterator
are not required to be the same. The reasonable requirement would be that
iterator can convert to const_iterator and local_iterator can convert to
const_local_iterator. This patch weakens the check and makes the test
more portable.

Reviewed as https://reviews.llvm.org/D56493.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 352083
2019-01-24 19:09:22 +00:00
Kamil Rytarowski 47c0eb2bc2 Mark another test as flaky
Reported on the NetBSD 8 buildbot.

llvm-svn: 352064
2019-01-24 17:17:55 +00:00
Marshall Clow f6b6be2f7a Uncomment the entire test, but mark as XFAIL on linux-gnu because it uses locales that aren't generally available there, similar to the other regex tests
llvm-svn: 352006
2019-01-24 01:52:56 +00:00
Kamil Rytarowski d3068a2c2f Mark another test as flaky
Reported on the NetBSD 8 buildbot.

llvm-svn: 351995
2019-01-23 23:24:43 +00:00
Marshall Clow 28166dd9b3 Apply D28248: 'Work around GCC PR37804'. Thanks to mdaniels for the patch
llvm-svn: 351993
2019-01-23 23:06:18 +00:00
Casey Carter 1ecf6e55cd [test] Define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST in msvc_stdlib_force_include.hpp
...so the tests under test/std/utilities/any continue to
compile with MSVC's standard library.

While we're here, let's test >C++17 features when _HAS_CXX20.

llvm-svn: 351991
2019-01-23 22:49:44 +00:00
Kamil Rytarowski 829d916d7d Mark another test as flaky
Reported on the NetBSD 8 buildbot.

llvm-svn: 351988
2019-01-23 22:35:57 +00:00
Kamil Rytarowski 314bd26db1 Correct mark for flaky tests
Add missing trailing dot.

llvm-svn: 351983
2019-01-23 21:45:02 +00:00
Kamil Rytarowski 776cf71d4f Mark more tests flaky
Reported on the NetBSD 8 buildbot

llvm-svn: 351944
2019-01-23 11:36:19 +00:00
Kamil Rytarowski fe1991b55e Mark thread.condition.condvarany/wait_for.pass.cpp as flaky
Reported on the NetBSD 8 buildbot.

llvm-svn: 351937
2019-01-23 10:11:41 +00:00
Marshall Clow 8f302e6222 While reviewing D57058, Louis had some questions about the existing span constructor tests. They were not testing the stuff that they said they were. Updated the tests to test what they should have been doing
llvm-svn: 351887
2019-01-22 22:01:13 +00:00
Louis Dionne 53e8ece06a [libcxx] Include <cstring> in tests that use strcmp
Reviewed as https://reviews.llvm.org/D56503.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 351847
2019-01-22 17:45:00 +00:00
Eric Fiselier 85bdbbf9a1 Fix aligned allocation availability XFAILs after D56445.
D56445 bumped the minimum Mac OS X version required for aligned
allocation from 10.13 to 10.14. This caused libc++ tests depending
on the old value to break.

This patch updates the XFAILs for those tests to include 10.13.

llvm-svn: 351670
2019-01-20 01:21:35 +00:00
Eric Fiselier 3662572275 Revert "Fix aligned allocation availability XFAILs after D56445."
This reverts commit r351625.

That fix was incomplete. I'm reverting so I can commit a complete fix
in a single revision.

llvm-svn: 351669
2019-01-20 01:12:53 +00:00
Chandler Carruth b3ee4190e7 Update generator script to use the new license file header.
llvm-svn: 351650
2019-01-19 11:38:40 +00:00
Chandler Carruth 57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Eric Fiselier a32dd04238 Fix aligned allocation availability XFAILs after D56445.
D56445 bumped the minimum Mac OS X version required for aligned
allocation from 10.13 to 10.14. This caused libc++ tests depending
on the old value to break.

This patch updates the XFAILs for those tests to include 10.13.

llvm-svn: 351625
2019-01-19 03:27:05 +00:00
Eric Fiselier 973eab8a5d correct script name in generated tests
llvm-svn: 351299
2019-01-16 05:43:02 +00:00
Eric Fiselier efdac65f70 Attempt to make test_macros.h even more minimal
llvm-svn: 351292
2019-01-16 02:16:57 +00:00
Eric Fiselier 05019eb79f Fix feature test macros for atomics/mutexes without threading
llvm-svn: 351291
2019-01-16 02:10:28 +00:00
Eric Fiselier d01a4aa068 Fix PR40230 - std::pair may have padding on FreeBSD.
Summary:
FreeBSD ships a very old and deprecated ABI for std::pair where the copy and move constructors are not allowed to be trivial. D25389 change how this was implemented by introducing a non-trivial base class. This patch, introduced in October 2016, introduced an ABI bug that caused nested `std::pair` instantiations to have padding. For example:

```
using PairT = std::pair< std::pair<char, char>, char >;
static_assert(offsetof(PairT, first) == 0, "First member should exist at offset zero"); // Fails on FreeBSD!
```

The bug occurs because the base class for the first element (the nested pair) cannot be put at offset zero because the top-level pair already has the same base class laid out there.

This patch fixes that ABI bug by templating the dummy base class on the same parameters as the pair.

Technically this fix is an ABI break for users who depend on the "broken" ABI introduced in 2016. I'm putting this up for review so that the FreeBSD maintainers can sign off on fixing the ABI by breaking the ABI.
Another option, since we have to "break" the ABI to fix it, would be to move FreeBSD off the deprecated non-trivial pair ABI instead.

Also see:

* https://llvm.org/PR40230
* https://reviews.llvm.org/D21329



Reviewers: rsmith, dim, emaste

Reviewed By: rsmith

Subscribers: mclow.lists, krytarowski, christof, ldionne, libcxx-commits

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

llvm-svn: 351290
2019-01-16 01:54:34 +00:00
Eric Fiselier d108bf85b0 Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: ldionne, EricWF

Subscribers: jyknight, christof, libcxx-commits

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

llvm-svn: 351289
2019-01-16 01:51:12 +00:00
Eric Fiselier 32784a740a Implement feature test macros using a script.
Summary:
This patch implements all the feature test macros libc++ currently supports, as specified by the standard or cppreference prior to C++2a.

The tests and `<version>` header are generated using a script. The script contains a table of each feature test macro, the headers it should be accessible from, and its values of each dialect of C++.
When a new feature test macro is added or needed, the table should be updated and the script re-run.



Reviewers: mclow.lists, jfb, serge-sans-paille

Reviewed By: mclow.lists

Subscribers: arphaman, jfb, ldionne, libcxx-commits

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

llvm-svn: 351286
2019-01-16 01:37:43 +00:00
Dan Albert 5452d3f099 Add large file support to create_file for 32-bit.
Summary:
The tests need to create files larger than 2GB, but size_t is 32-bit
on a 32-bit system. Make use of explicit off64_t APIs so we can still
use a default off_t for the tests while enabling 64-bit file offsets
for create_file.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 351225
2019-01-15 19:14:15 +00:00
Petr Hosek 20c425cdab [libc++] Support different libc++ namespaces in the iterator test
libc++ allows changing the namespace, don't assume __1 in the test
to avoid the test failure if different namespace is being used.

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

llvm-svn: 351220
2019-01-15 18:55:55 +00:00
Casey Carter dcaaa1baed [test] Fix logic error in <compare> tests; enable for MSVC Dev16
Submitted upstream as https://reviews.llvm.org/D53763.

llvm-svn: 351148
2019-01-15 01:53:12 +00:00
Marshall Clow f3126c8bc5 Generalize the comparison test structure to support cross-type comparisons. NFC to the library
llvm-svn: 351140
2019-01-15 00:05:05 +00:00
Marshall Clow e495760140 Change from a to a . Fixes PR#39871.
llvm-svn: 350972
2019-01-11 21:57:12 +00:00
Marshall Clow 80378fd38b Don't use the form '2017y' in tests, since some gcc versions don't allow it
llvm-svn: 350930
2019-01-11 15:45:56 +00:00
Marshall Clow 5c08881343 Implement the 'sys_time' portions of the C++20 calendaring stuff. Reviewed as D56494
llvm-svn: 350929
2019-01-11 15:12:04 +00:00
Louis Dionne 1d5f6a81f5 [libcxx] Reorganize tests since the application of P0602R4
Summary:
P0602R4 makes the special member functions of optional and variant
conditionally trivial based on the types in the optional/variant.
We already implemented that, but the tests were organized as if this
were a non-standard extension. This patch reorganizes the tests in a
way that makes more sense since this is not an extension anymore.

Reviewers: EricWF, mpark, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 350884
2019-01-10 20:06:11 +00:00
JF Bastien a936f84863 Filesystem tests: fix fs.op.relative
Summary: The test wasn't using the testing infrastructure properly.

Reviewers: ldionne, mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 350872
2019-01-10 18:50:34 +00:00
JF Bastien 1026ce6de4 [NFC] Always lock free test: add indirection
I have a big patch coming up, and this indirection is required to avoid hitting the following after my big change:

  error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]

llvm-svn: 350772
2019-01-09 23:20:24 +00:00
JF Bastien 2f4df4c986 [NFC] Normalize some test 'main' signatures
There were 3 tests with 'int main(void)', and 6 with the return type on a different line. I'm about to send a patch for main in tests, and this NFC change is unrelated.

llvm-svn: 350770
2019-01-09 22:56:45 +00:00
Eric Fiselier e49fc07c69 Mark two UDL tests as being unsupported with Clang 7
llvm-svn: 350739
2019-01-09 16:34:17 +00:00
Louis Dionne ea443cf828 [libcxx] Remove outdated XFAILs for aligned deallocation
AppleClang 10 has been fixed and so these tests don't fail anymore.

llvm-svn: 350736
2019-01-09 16:13:04 +00:00
Eric Fiselier 7b03b66e5c Mark two more tests as FLAKY
llvm-svn: 350692
2019-01-09 05:48:54 +00:00
Louis Dionne 4d3366e257 [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
Summary:
r306722 added diagnostics when aligned allocation is used with deployment
targets that do not support it, but the first macosx supporting aligned
allocation was incorrectly set to 10.13. In reality, the dylib shipped
with macosx10.13 does not support aligned allocation, but the dylib
shipped with macosx10.14 does.

Reviewers: ahatanak

Subscribers: christof, jkorous, dexonsmith, cfe-commits

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

llvm-svn: 350649
2019-01-08 20:26:56 +00:00
Marshall Clow 8f9346922c Set the buffer of an fstream to empty when the underlying file is closed. This 'fixes' PR#38052 - std::fstream still good after closing and updating content.
llvm-svn: 350603
2019-01-08 02:48:45 +00:00
Volodymyr Sapsai fb0e1908d4 [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.
We already have a specialization that will use memcpy for construction
of trivial types from an iterator range like

    std::vector<int>(int *, int *);

But if we have const-ness mismatch like

    std::vector<int>(const int *, const int *);

we would use a slow path that copies each element individually. This change
enables the optimal specialization for const-ness mismatch. Fixes PR37574.

Contributions to the patch are made by Arthur O'Dwyer, Louis Dionne.

rdar://problem/40485845

Reviewers: mclow.lists, EricWF, ldionne, scanon

Reviewed By: ldionne

Subscribers: christof, ldionne, howard.hinnant, cfe-commits

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

llvm-svn: 350583
2019-01-08 00:03:16 +00:00
Eric Fiselier 389da901d0 Mark more tests as flaky
llvm-svn: 350550
2019-01-07 18:21:18 +00:00
Marshall Clow 4d4213f694 Add the feature test macros that were defined in p1353r0 to the headers of the appropriate tests. No actual tests yet, so NFC.
llvm-svn: 350535
2019-01-07 16:17:52 +00:00
Eric Fiselier b168a7c660 Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of
is harmful to common feature detection idioms.

We should also consider only emitting the warning when __DEPRECATED is
defined, like we do in the <ext/foo> headers. Users may want to specify
"-Werror=-W#warnings" while still ignoring the libc++ warnings.

llvm-svn: 350485
2019-01-06 00:37:31 +00:00
Eric Fiselier 5792cf42b7 Fix flaky symlink access time test.
last_write_time(sym, new_time) changes the modification time of the file
referenced by the symlink. But reading through the symlink may change the
symlinks's access time.

This meant the previous test that checked that the symlinks access
time was unchanged was incorrect and made the test flaky.

This patch removes this test (there really is no non-flaky way
to test that the new access time coorisponds to the time at which
the symlink was last dereferenced). This should unflake the test.

llvm-svn: 350478
2019-01-05 21:18:10 +00:00
Marshall Clow 71c1680d2c De-tab a couple tests. NFC
llvm-svn: 350330
2019-01-03 17:18:40 +00:00
Eric Fiselier aae39bf928 Fix test case breakages caused by lexically_relative change
llvm-svn: 349888
2018-12-21 04:38:22 +00:00
Eric Fiselier 8b1ad5cf8d Fix copy paste error in file_clock tests
llvm-svn: 349886
2018-12-21 04:27:45 +00:00
Eric Fiselier ba62831f7c Implement LWG 3096: path::lexically_relative is confused by trailing slashes
path("/dir/").lexically_relative("/dir"); now returns "." instead of ""

llvm-svn: 349885
2018-12-21 04:25:40 +00:00
Eric Fiselier 49b183a9ec Implement LWG 3065: Make path operators friends.
This prevents things like:

using namespace std::filesystem;
auto x = L"a/b" == std::string("a/b");

llvm-svn: 349884
2018-12-21 04:09:01 +00:00
Eric Fiselier 866885e12a Implement LWG 3145: file_clock breaks ABI for C++17 implementations.
This patch adds std::chrono::file_clock, but without breaking the
existing ABI for std::filesystem.

llvm-svn: 349883
2018-12-21 03:54:57 +00:00
Eric Fiselier 1425485773 Implement LWG 2936: Path comparison is defined in terms of the generic format
This patch implements path::compare according to the current spec. The
only observable change is the ordering of "/foo" and "foo", which orders
the two paths based on having or not having a root directory (instead
of lexically comparing "/" to "foo").

llvm-svn: 349881
2018-12-21 03:16:30 +00:00
Louis Dionne ebc2344a8b [libcxx] Fix order checking in unordered_multimap tests.
Some tests assume that iteration through an unordered multimap elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch introduces checks verifying that any iteration will return elements
exactly from a set of valid values and without repetition, but in no
particular order.

Reviewed as https://reviews.llvm.org/D54838.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 349780
2018-12-20 17:55:31 +00:00
Volodymyr Sapsai e7652f5c0d [libcxx] Use custom allocator's `construct` in C++03 when available.
Makes libc++ behavior consistent between C++03 and C++11.

Can use `decltype` in C++03 because `include/__config` defines a macro when
`decltype` is not available.

Reviewers: mclow.lists, EricWF, erik.pilkington, ldionne

Reviewed By: ldionne

Subscribers: dexonsmith, cfe-commits, howard.hinnant, ldionne, christof, jkorous, Quuxplusone

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

llvm-svn: 349676
2018-12-19 20:08:43 +00:00
Eric Fiselier 350ee4bb13 Work around GCC 9.0 regression
llvm-svn: 349663
2018-12-19 18:58:22 +00:00
Marshall Clow 8d221b40a7 Add missing include to test. NFC
llvm-svn: 349639
2018-12-19 16:39:04 +00:00
Marshall Clow 5a127cdcbf Portability fix: add missing includes and static_casts. Reviewed as https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch.
llvm-svn: 349566
2018-12-18 23:19:00 +00:00
Marshall Clow b766eb96ff Rework the C strings tests to use ASSERT_SAME_TYPE. NFC there. Also change cwchar.pass.cpp to avoid constructing a couple things from zero - since apparently they can be enums in some weird C library. NFC there, either, since the values were never used.
llvm-svn: 349522
2018-12-18 19:07:30 +00:00
Louis Dionne c19d729786 [libcxx] Remove XFAILs for older macOS versions
That test doesn't fail anymore since r349378, since the assertions that
r349378 removed must have been bugs in the dylib at some point.

llvm-svn: 349484
2018-12-18 13:46:28 +00:00
Louis Dionne 06caa6d2e6 [libcxx] Handle AppleClang 9 and 10 in XFAILs for aligned allocation tests
I forgot that those don't behave like Clang trunk, again.

llvm-svn: 349427
2018-12-18 00:42:09 +00:00
Louis Dionne afb1d72e7b [libcxx] Properly mark aligned allocation macro test as XFAIL on OS X
This test was initially marked as XFAIL using `XFAIL: macosx10.YY`, and
was then moved to `UNSUPPORTED: macosx10.YY`. The intent is to mark the
test as XFAILing when a deployment target older than macosx10.14 is used,
and the right way to do this is `XFAIL: availability=macosx10.YY`.

llvm-svn: 349426
2018-12-18 00:30:15 +00:00
Eric Fiselier 2a58b11a8a Fix FP comparisons when SSE isn't available
llvm-svn: 349387
2018-12-17 20:17:43 +00:00
Michal Gorny c32d47c6a8 [test] Add target_info for NetBSD, and XFAIL some of locale tests
Add a target_info definition for NetBSD.  The definition is based
on the one used by FreeBSD, with libcxxrt replaced by libc++abi,
and using llvm-libunwind since we need to use its unwinder
implementation to build anyway.

Additionally, XFAIL the 30 tests that fail because of non-implemented
locale features.  According to the manual, NetBSD implements only
LC_CTYPE part of locale handling.  However, there is a locale database
in the system and locale specifications are validated against it,
so it makes sense to list the common locales as supported.

If I'm counting correctly, this change enables additional 43 passing
tests.

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

llvm-svn: 349379
2018-12-17 19:14:08 +00:00
Michal Gorny 916bf993a2 [test] [re.traits] Remove asserts failing due to invalid UTF-8
Remove the two test cases for \xDA and \xFA with UTF-8 locale, as both
characters alone are invalid in UTF-8 (short sequences).  Upon removing
them, the test passes on Linux again (and also on NetBSD, after adding
appropriate locale configuration).

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

llvm-svn: 349378
2018-12-17 19:13:41 +00:00
Eric Fiselier 077a0aff16 Unbreak green dragon bots w/o __builtin_launder
llvm-svn: 349373
2018-12-17 18:37:59 +00:00
Eric Fiselier 2d6833c9c9 Expect Clang diagnostics in std::launder test
llvm-svn: 349364
2018-12-17 16:56:24 +00:00
Louis Dionne 04695a7539 [libcxx] Speeding up partition_point/lower_bound/upper_bound
This is a re-application of r345525, which had been reverted by fear of
a regression.

Reviewed as https://reviews.llvm.org/D53994.
Thanks to Denis Yaroshevskiy for the patch.

llvm-svn: 349358
2018-12-17 16:04:39 +00:00
Michal Gorny 4ce222198c [test] [support] Use socket()+bind() to create unix sockets portably
Replace the mknod() call with socket() + bind() for creating unix
sockets.  The mknod() method is not portable and does not work
on NetBSD while binding the socket should work on all systems supporting
unix sockets.

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

llvm-svn: 349305
2018-12-16 15:12:06 +00:00
Michal Gorny 16b9decb93 [test] [ctime] Ignore -Wformat-zero-length warnings
Explicitly disable the -Wformat-zero-length diagnostic when running
ctime tests, since one of the test cases passes zero-length format
string to strftime().  When strftime() is appropriately decorated
with __attribute__(format, ...), this caused the test to fail because
of this warning (e.g. on NetBSD).

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

llvm-svn: 349294
2018-12-16 09:18:31 +00:00
Eric Fiselier 241c73b191 Fix static assert diagnostic checks in i386
llvm-svn: 349252
2018-12-15 05:18:56 +00:00
Eric Fiselier 3e5d847fa0 Tolerate Clangs new static_assert messages
llvm-svn: 349189
2018-12-14 20:42:36 +00:00
Louis Dionne a5e2b081be [libcxx] Mark some tests as still failing on macosx10.14
llvm-svn: 349187
2018-12-14 20:22:44 +00:00
Marshall Clow f60c63c090 Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
llvm-svn: 349178
2018-12-14 18:49:35 +00:00
Louis Dionne 5f1706f3aa [libcxx] Fix pop_back() tests to make sure they don't always just pass
llvm-svn: 349071
2018-12-13 18:53:17 +00:00
Louis Dionne 589f1764fc [libcxx] Add assertion in deque::pop_back when popping from an empty deque
Also, add tests making sure that vector and deque both catch the problem
when assertions are enabled. Otherwise, deque would segfault and vector
would never terminate.

llvm-svn: 348994
2018-12-12 23:58:25 +00:00
Michal Gorny 68cbd6bdb2 [test] [depr.c.headers] XFAIL uchar.h on NetBSD
llvm-svn: 348973
2018-12-12 20:51:46 +00:00
Michal Gorny c22e62d9a7 [test] [filesystems] NetBSD can do symlink permissions too
llvm-svn: 348968
2018-12-12 20:28:52 +00:00
Michal Gorny e8e635ff5e [test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD
NetBSD also uses tv_sec==-1 as error status indicator, and does not
support setting such a value.

llvm-svn: 348967
2018-12-12 20:20:15 +00:00
Michal Gorny 97569391ea [test] Permit NetBSD in filesystem_dynamic_test_helper.py
llvm-svn: 348872
2018-12-11 18:29:35 +00:00
Louis Dionne 17b65c0d58 [libcxx] Fix test failure on GCC 4.9
GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.

llvm-svn: 348850
2018-12-11 15:27:10 +00:00
Louis Dionne 9f77b1a1de [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

This is a re-application of r348824, which broke the build in C++03 mode
because a test was marked as supported in C++03 when it shouldn't be.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

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

llvm-svn: 348847
2018-12-11 14:22:28 +00:00
Louis Dionne bca37ac8b8 [libcxx] Fix test on compilers that do not support char8_t yet
llvm-svn: 348846
2018-12-11 14:15:54 +00:00
Marshall Clow f17c5f6ba6 Fix problems with char8_t stuff on compilers that don't support char8_t yet
llvm-svn: 348829
2018-12-11 06:06:49 +00:00
Marshall Clow 7dad0bd68b Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
llvm-svn: 348828
2018-12-11 04:35:44 +00:00
Louis Dionne d5a20703c4 Revert "[pair] Mark constructors as conditionally noexcept"
This broke the tests on Linux. Reverting until I find out why the tests
are broken (tomorrow).

llvm-svn: 348825
2018-12-11 02:32:46 +00:00
Louis Dionne 76cce3b2bd [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

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

llvm-svn: 348824
2018-12-11 02:17:23 +00:00
Marshall Clow 655fb4a767 Update a couple of vector<bool> tests that were testing libc++-specific bahavior. Thanks to Andrey Maksimov for the catch.
llvm-svn: 348660
2018-12-07 22:16:26 +00:00
Louis Dionne 737be83d20 [libcxx] Remove the availability_markup LIT feature
It is now equivalent to the 'availability' LIT feature, so there's no
reason to keep both.

llvm-svn: 348653
2018-12-07 21:48:39 +00:00
Louis Dionne 3560fbf304 [libc++] Improve diagnostics for non-const comparators and hashers in associative containers
Summary:
When providing a non-const-callable comparator in a map or set, the
warning diagnostic does not include the point of instantiation of
the container that triggered the warning, which makes it difficult
to track down the problem. This commit improves the diagnostic by
placing it directly in the body of the associative container.

The same change is applied to unordered associative containers, which
had a similar problem.

Finally, this commit cleans up the forward declarations of several
map and unordered_map helpers, which are not needed anymore.

<rdar://problem/41370747>

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

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

llvm-svn: 348529
2018-12-06 21:46:17 +00:00
Louis Dionne bf3f90c34f [libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets
The tests were marked to fail based on the 'availability' LIT feature.
However, those tests should really only be failing when we run them
against the dylibs that were deployed on macosx10.7 and macosx10.8,
which the deployment target has nothing to do with.

This caused the tests to unexpectedly pass when running the tests
with deployment target macosx10.{7,8} but running with a recent dylib.

llvm-svn: 348520
2018-12-06 19:24:20 +00:00
Louis Dionne 7125b08d08 [libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end()
The standard section [array.zero] requires the return value of begin()
and end() methods of a zero-sized array to be unique. Eric Fiselier
clarifies: "That unique value cannot be null, and must be properly aligned".
This patch adds checks for the first part of this clarification: unique
value returned by these methods cannot be null.

Reviewed as https://reviews.llvm.org/D55366.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 348509
2018-12-06 18:24:39 +00:00
Louis Dionne 2a23317e69 [libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
Some people are still running the test suite using AppleClang 9.

llvm-svn: 348507
2018-12-06 18:06:47 +00:00
Louis Dionne 26f01c46e9 [libcxx] Make return value of array<T, 0>.data() checked only for libc++
The section array.zero says: "The return value of data() is unspecified".
This patch marks all checks of the array<T, 0>.data() return value as
libc++ specific.

Reviewed as https://reviews.llvm.org/D55364.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 348485
2018-12-06 13:52:20 +00:00
Louis Dionne 2d36473873 [libcxx] Mark some tests as failing on macosx 10.14
llvm-svn: 348437
2018-12-06 00:25:15 +00:00
Louis Dionne f7f5a1f778 [libcxx] Don't depend on availability markup to provide the streams in the dylib
Whether an explicit instantiation declaration should be provided is not
a matter of availability markup.

This problem is exemplified by the fact that some tests were incorrectly
marked as XFAIL when they should instead have been using the definition
of streams from the headers, and hence passing, and that, regardless of
whether visibility annotations are enabled.

llvm-svn: 348436
2018-12-06 00:24:58 +00:00
Louis Dionne bb9ca6d0bf [libcxx] Implement P0318: unwrap_ref_decay and unwrap_reference
Summary:
This was voted into C++20 in San Diego. Note that there was a revision
D0318R2 which did include unwrap_reference_t, but we mistakingly voted
P0318R1 into the C++20 Working Draft (which does not include
unwrap_reference_t). This patch implements D0318R2, which is what
we'll end up with in the Working Draft once this mistake has been
fixed.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, libcxx-commits

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

llvm-svn: 348138
2018-12-03 14:03:27 +00:00
Marshall Clow 08794627a3 First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane. (second try)
llvm-svn: 347930
2018-11-29 23:21:18 +00:00
Louis Dionne 9af1d12978 [libcxx] Make UNSUPPORTED for std::async test more fine grained
The test was previously marked as unsupported on all Apple platforms, when
we really just want to mark it as unsupported for previously shipped dylibs
on macosx.

llvm-svn: 347920
2018-11-29 21:25:29 +00:00
Marshall Clow 80fabab677 Revert commit r347904 because it broke older compilers
llvm-svn: 347908
2018-11-29 20:04:47 +00:00
Marshall Clow 8143278500 First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane.
llvm-svn: 347904
2018-11-29 19:49:48 +00:00
Louis Dionne e823b6d7e6 [libcxx] Remove bad_array_length
Summary:
std::bad_array_length was added by n3467, but this never made it into C++.
This commit removes the definition of std::bad_array_length from the headers
AND from the shared library. See the comments in the ABI changelog for details
about the ABI implications of this change.

Reviewers: mclow.lists, dexonsmith, howard.hinnant, EricWF

Subscribers: christof, jkorous, libcxx-commits

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

llvm-svn: 347903
2018-11-29 19:44:57 +00:00
Louis Dionne 8b1f5aae7e [libcxx] More fixes to XFAILs for aligned allocation tests for macosx 10.13
Those tests are a real pain to tweak.

llvm-svn: 347875
2018-11-29 15:52:36 +00:00
Eric Fiselier 9d25ada420 Revert "Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. "
This reverts commit 087f065cb0c7463f521a62599884493aaee2ea12.

The tests were failing on 32 bit builds, and I don't have time
to clean them up right now. I'll recommit tomorrow with fixed tests.

llvm-svn: 347816
2018-11-28 22:24:19 +00:00