Commit Graph

309 Commits

Author SHA1 Message Date
Nico Weber
28db4445e2 libcxx: Rename .hpp files in libcxx/test/support to .h
LLVM uses .h as its extension for header files.

Files renamed using:

    for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done

References to the files updated using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
        a=$(basename $f);
        echo $a;
        rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
    done

HPP include guards updated manually using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
      echo ${f%.hpp}.h ;
    done | xargs mvim

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369481 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:14:12 +00:00
Eric Fiselier
590e3405ea Teach malloc_allocator how to count bytes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367606 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 19:52:46 +00:00
Eric Fiselier
6f5ab14489 Add option to disable variant narrowing conversion changes.
The paper P0608R3 - "A sane variant converting constructor" disallows
narrowing conversions in variant. It was meant to address this
surprising problem:

  std::variant<std::string, bool> v = "abc";
  assert(v.index() == 1); // constructs a bool.

However, it also disables every potentially narrowing conversion. For
example:

  variant<unsigned> v = 0; // ill-formed
  variant<string, double> v2 = 42; // ill-formed (int -> double narrows)

These latter changes break code. A lot of code. Within Google it broke
on the order of a hundred thousand target with thousands of root causes
responsible for the breakages.

Of the breakages related to the narrowing restrictions, none of them
exposed outstanding bugs. However, the breakages caused by boolean
conversions (~13 root causes), all but one of them were bugs.

For this reasons, I am adding a flag to disable the narrowing conversion
changes but not the boolean conversions one.

One purpose of this flag is to allow users to opt-out of breaking changes
in variant until the offending code can be cleaned up. For non-trivial
variant usages the amount of cleanup may be significant.

This flag is also required to support automated tooling, such as
clang-tidy, that can automatically fix code broken by this change.
In order for clang-tidy to know the correct alternative to construct,
it must know what alternative was being constructed previously, which
means running it over the old version of std::variant.

Because this change breaks so much code, I will be implementing the
aforementioned clang-tidy check in the very near future.

Additionally I'm plan present this new information to the committee so they can
re-consider if this is a breaking change we want to make.

I think libc++ should very seriously consider pulling this change
before the 9.0 release branch is cut. But that's a separate discussion
that I will start on the lists.

For now this is the minimal first step.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@365960 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 21:32:11 +00:00
Eric Fiselier
cd4a856d45 add header to help with template testing
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363503 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-15 21:16:57 +00:00
Marshall Clow
b6e011b18b Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 18:35:30 +00:00
Dan Gohman
d6842df3f7 [WebAssembly] WASI support for libcxx
This adds explicit support for the WASI platform to libcxx.

WASI libc uses some components from musl, however it's not fully compatible
with musl, so we're planning to stop using _LIBCPP_HAS_MUSL_LIBC and
customize for WASI libc specifically.

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

Reviewers: sbc100, ldionne


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359703 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 16:47:30 +00:00
Casey Carter
d8b79a0d07 [libc++][test] Fix noexcept assertions in variant's get tests
All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.

Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359220 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-25 18:36:29 +00:00
Marshall Clow
321a1f890d Implement midpoint for floating point types. Reviewed as https://reviews.llvm.org/D61014.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359184 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-25 12:11:43 +00:00
Eric Fiselier
8e365750a0 Avoid name conflict with kernel headers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359080 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 09:43:44 +00:00
Casey Carter
6f21f89dc4 [libc++] [test] Silence C++20 deprecation warnings in the MSVC STL
... when including msvc_stdlib_force_include.hpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 20:39:41 +00:00
Marshall Clow
2b866255ed Make to_chars/from_chars work back to C++11. This means that we can use them to implement to_string as well. Reviewed as https://reviews.llvm.org/D59598.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356585 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 18:13:23 +00:00
Eric Fiselier
e7641c9db9 Remove unused try catch blocks from old debug tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356429 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 00:00:30 +00:00
Eric Fiselier
f7d368bb1f Fix test failures after debug mode changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356421 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-18 22:12:09 +00:00
Eric Fiselier
eb2e397396 Remove exception throwing debug mode handler support.
Summary:
The reason libc++ implemented a throwing debug mode handler was for ease of testing. Specifically,
I thought that if a debug violation aborted, we could only test one violation per file. This made
it impossible to test debug mode. Which throwing behavior we could test more!

However, the throwing approach didn't work either, since there are debug violations underneath noexcept
functions. This lead to the introduction of `_NOEXCEPT_DEBUG`, which was only noexcept when debug
mode was off.

Having thought more and having grown wiser, `_NOEXCEPT_DEBUG` was a horrible decision. It was
viral, it didn't cover all the cases it needed to, and it was observable to the user -- at worst
changing the behavior of their program.

  This patch removes the throwing debug handler, and rewrites the debug tests using 'fork-ing' style
  death tests.

Reviewers: mclow.lists, ldionne, thomasanderson

Reviewed By: ldionne

Subscribers: christof, arphaman, libcxx-commits, #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356417 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-18 21:50:12 +00:00
JF Bastien
e15dd4e32e 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353086 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 20:31:13 +00:00
Thomas Anderson
b7568024ed [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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352561 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 23:19:45 +00:00
Casey Carter
96442b7341 [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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351991 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 22:49:44 +00:00
Chandler Carruth
7c3769df62 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 10:56:40 +00:00
Chandler Carruth
4abbf7dac3 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Eric Fiselier
455f16a829 Attempt to make test_macros.h even more minimal
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351292 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 02:16:57 +00:00
Eric Fiselier
272871b658 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351289 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 01:51:12 +00:00
Eric Fiselier
a8b9f59e8c 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351286 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 01:37:43 +00:00
Dan Albert
ae62476eac 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351225 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 19:14:15 +00:00
Casey Carter
9e69b7db4d [test] Fix logic error in <compare> tests; enable for MSVC Dev16
Submitted upstream as https://reviews.llvm.org/D53763.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351148 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 01:53:12 +00:00
Marshall Clow
65c8c4faa6 Generalize the comparison test structure to support cross-type comparisons. NFC to the library
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351140 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 00:05:05 +00:00
Volodymyr Sapsai
d805c8746a [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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 20:08:43 +00:00
Eric Fiselier
dfa283e2cf Fix FP comparisons when SSE isn't available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349387 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 20:17:43 +00:00
Michal Gorny
a443a0013d [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349305 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 15:12:06 +00:00
Michal Gorny
2d1346288e [test] Permit NetBSD in filesystem_dynamic_test_helper.py
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348872 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 18:29:35 +00:00
Louis Dionne
bca4d67c16 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348847 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:22:28 +00:00
Louis Dionne
21a8669ade Revert "[pair] Mark constructors as conditionally noexcept"
This broke the tests on Linux. Reverting until I find out why the tests
are broken (tomorrow).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:32:46 +00:00
Louis Dionne
adde8aeb1c [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:17:23 +00:00
Eric Fiselier
e3e576ae50 Revert "Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF. "
This reverts commit 087f065cb0.

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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 22:24:19 +00:00
Eric Fiselier
087f065cb0 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: EricWF

Subscribers: christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347787 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:16:02 +00:00
Eric Fiselier
bac4a9b67f Fix missing includes in test header
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 20:39:24 +00:00
Louis Dionne
98dc85caf6 [NFC][libcxx] Fix incorrect comments
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347267 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 22:06:42 +00:00
Louis Dionne
13b7f7b500 [libcxx] Add availability markup for bad_optional_access, bad_variant_access and bad_any_cast
Reviewers: dexonsmith, EricWF

Subscribers: christof, arphaman, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347219 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 15:37:04 +00:00
Eric Fiselier
c2c6c1de6b Get tests compiling with -Wunused-local-typedef
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346914 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 00:11:02 +00:00
Stephan T. Lavavej
439de45011 [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346826 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 03:06:06 +00:00
Dan Albert
73d2eccc78 Fix test assumption that Linux implies glibc.
Summary:
This fixes an regression when using bionic introduced in r345173.

I need to follow up and figure out what exactly is implied by
TEST_HAS_C11_FEATURES and see what the correct configuration is for
bionic (new versions should have everything the tests care about,
versions that predate C11 certainly don't), but this gets the tests
back to the old behavior.

Reviewers: EricWF

Reviewed By: EricWF

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

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345900 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 22:35:51 +00:00
Louis Dionne
f10e0ac7b0 [libcxx] Fix usage of _C2, which is a "nasty macro" in some environments
The problem was pointed out in https://reviews.llvm.org/D48896#inline-475775.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345834 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 14:41:37 +00:00
Eric Fiselier
005bb4c72c Fix use of libc++ specific macro in support/test_macros.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345173 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24 18:37:42 +00:00
Eric Fiselier
697faed467 Add test macros for always_inline and noinline
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344167 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10 18:22:23 +00:00
Marshall Clow
43d7c79aae Selectively import timespec_get into namespace std, since some C libraries don't have it. Reviewed as https://reviews.llvm.org/D50799
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:19:08 +00:00
Dimitry Andric
f27313afa2 For FreeBSD, don't define _M in nasty_macros.hpp
Because FreeBSD uses _M in its <sys/types.h>, and it is hard to avoid
including that header, only define _M to NASTY_MACRO for other operating
systems.  This fixes almost 2000 unexpected test failures.

Discussed with Eric Fiselier.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339794 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 17:30:32 +00:00
Louis Dionne
cbc40b6d2e [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
Summary:
The macro was not defined in C++11 mode when it should have been, at least
according to how _LIBCPP_HAS_C11_FEATURES is defined.

Reviewers: mclow.lists, EricWF, jfb, dexonsmith

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339702 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 18:16:56 +00:00
Marshall Clow
e25adff05a Make my new test harness work w/c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338803 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 02:58:16 +00:00
Zhihao Yuan
80f0ca024a [libc++] Fix build failures after merging <charconv>
Summary:
- fix a stupid unit test typo
- add <charconv> symbols to Linux abilist

Reviewers: EricWF

Subscribers: christof, ldionne, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338486 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 05:21:26 +00:00
Zhihao Yuan
dc38e97601 [libc++][C++17] Elementary string conversions for integral types
Summary:
Major QoI considerations:

- The facility is backported to C++14, same as libstdc++.
- Efforts have been made to minimize the header dependencies.
- The design is friendly to the uses of MSVC intrinsics (`__emulu`, `_umul128`, `_BitScanForward`, `_BitScanForward64`) but not implemented; future contributions are welcome.

Thanks to Milo Yip for contributing the implementation of `__u64toa` and `__u32toa`.

References:
 https://wg21.link/p0067r5
 https://wg21.link/p0682r1

Reviewers: mclow.lists, EricWF

Reviewed By: mclow.lists

Subscribers: ldionne, Quuxplusone, christof, mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 02:38:30 +00:00
Erik Pilkington
36fc737189 First half of C++17's splicing maps and sets
This commit adds a node handle type, (located in __node_handle), and adds
extract() and insert() members to all map and set types, as well as their
implementations in __tree and __hash_table.

The second half of this feature is adding merge() members, which splice nodes
in bulk from one container into another. This will be committed in a follow-up.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338472 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 01:33:38 +00:00