Commit Graph

159 Commits

Author SHA1 Message Date
Thomas A
a574ade231 Downgrading libcxx to llvmorg-13.0.1
It turns out that llvmorg-14.0.6 might be too new for dyld (the vector base class no longer exist in that release).
2022-06-26 13:05:32 -07:00
Thomas A
e3bbeb7fdc Update libcxx source to llvmorg-14.0.6 2022-06-26 09:13:52 -07:00
Louis Dionne
00f026a08c [libc++] Take 2: Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

This was previously committed as r372777 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372983 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 14:51:10 +00:00
Louis Dionne
172204fa13 [libc++] Purge mentions of GCC 4 from the test suite
We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.

This is a re-application of r372787.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372916 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 19:40:48 +00:00
Ilya Biryukov
29a4eab8c5 Revert r372777: [libc++] Implement LWG 2510 and its follow-ups
This also reverts:
 - r372778: [libc++] Implement LWG 3158
 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older
 - r372787: Purge mentions of GCC 4 from the test suite

Reason: the change breaks compilation of LLVM with libc++, for details see
http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372832 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 09:10:38 +00:00
Louis Dionne
1ee6c64cc8 [libc++] Purge mentions of GCC 4 from the test suite
We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372787 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 22:42:36 +00:00
Louis Dionne
afa5393dd5 [libc++] Try fixing tests that fail on GCC 5 and older
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 22:13:17 +00:00
Louis Dionne
3d85029503 [libc++] Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 20:18:54 +00:00
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
Louis Dionne
e2586fd18f [libcxx] Rejigger test for destroying delete feature-test macros
In r361572, we introduced library support for C++20 destroying delete
and decided to only define the library feature-test macro when the
compiler supports the underlying language feature. This patch reworks
the tests to mirror that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@366263 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-16 21:13:40 +00:00
Eric Fiselier
6507e2af11 Mark destroying delete test as UNSUPPORTED with clang 7
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@365856 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 01:16:08 +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
Eric Fiselier
bfea7307ae fix test for older clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361594 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 03:15:32 +00:00
Eric Fiselier
57436c8125 fix destroying delete test with older apple compilers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361593 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 02:46:34 +00:00
Eric Fiselier
087c094fec P0722R3: Implement library support for destroying delete
Summary:
This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature).

However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and  C++2a.


Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361572 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 23:46:44 +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
250205c9d2 Add std::is_constant_evaluated.
Clang recently added __builtin_is_constant_evaluated() and GCC 9.0
has it as well.

This patch adds support for it in libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359119 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:54:25 +00:00
Eric Fiselier
dbd4f51025 Fix implementation of ::abs and std::abs LWG 2192.
Summary:
All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers. 

This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself.

Suggestions for a cleaner implementation are welcome.

Reviewers: mclow.lists, ldionne

Reviewed By: ldionne

Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359020 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 18:01:58 +00:00
Billy Robert O'Neal III
3fd12d449b [libcxx] [test] Revert r356632 add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]]."
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356635 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 00:24:43 +00:00
Billy Robert O'Neal III
82e238eecb [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]].
This allows these tests to pass when compiled by MSVC++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356632 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 23:58:46 +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
Eric Fiselier
23b5c8797f 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-02 23:13:49 +00:00
Louis Dionne
8734fa79ec [libcxx] Include <cstring> in tests that use strcmp
Reviewed as https://reviews.llvm.org/D56503.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351847 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22 17:45:00 +00:00
Eric Fiselier
c6fd2de6a1 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351670 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-20 01:21:35 +00:00
Eric Fiselier
d162d3fe47 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351669 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-20 01:12:53 +00:00
Chandler Carruth
9daab637c1 Update generator script to use the new license file header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351650 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 11:38:40 +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
Eric Fiselier
14072788a3 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351625 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 03:27:05 +00:00
Eric Fiselier
89e287b0ae correct script name in generated tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351299 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 05:43:02 +00:00
Eric Fiselier
8290a8d271 Fix feature test macros for atomics/mutexes without threading
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351291 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 02:10:28 +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
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
a9c67b27fa Add the feature test macros that were defined in p1353r0 to the headers of the appropriate tests. No actual tests yet, so NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350535 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 16:17:52 +00:00
Eric Fiselier
50f14e23b5 Unbreak green dragon bots w/o __builtin_launder
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349373 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 18:37:59 +00:00
Eric Fiselier
2d0643acea Expect Clang diagnostics in std::launder test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349364 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:56:24 +00:00
Marshall Clow
f927635d87 Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349178 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 18:49:35 +00:00
Marshall Clow
544d1ba9a3 Fix problems with char8_t stuff on compilers that don't support char8_t yet
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 06:06:49 +00:00
Marshall Clow
96484477d1 Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348828 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 04:35:44 +00:00
Louis Dionne
f01e82fd42 [libcxx] Remove the availability_markup LIT feature
It is now equivalent to the 'availability' LIT feature, so there's no
reason to keep both.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348653 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 21:48:39 +00:00
Louis Dionne
7ea279fbed [libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
Some people are still running the test suite using AppleClang 9.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348507 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 18:06:47 +00:00
Marshall Clow
a815a3f8cc First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane. (second try)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347930 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 23:21:18 +00:00
Marshall Clow
ebdb54773c Revert commit r347904 because it broke older compilers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347908 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 20:04:47 +00:00
Marshall Clow
50509d15b8 First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 19:49:48 +00:00
Louis Dionne
893cf80335 [libcxx] Fix XFAILs for aligned allocation tests
In r339743, I marked several aligned allocation tests as downright
unsupported on macosx in an attempt to unbreak the build. It turns
out that marking them as unuspported whenever we're on OS X is way
too coarse grained. This commit marks the tests as XFAIL with more
granularity.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 19:30:08 +00:00
Louis Dionne
739fdd4850 [NFC] Rename lit feature to '-fsized-deallocation' for consistency
The '-faligned-allocation' flag uses a feature with the same name (with a
leading dash).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347367 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 00:03:17 +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
Marshall Clow
9110b80a63 Update commnents to reflect the changes for LWG#3127. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-22 20:49:50 +00:00
Marshall Clow
3d1d9230d8 Update commnents to reflect the changes for LWG#3122. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344950 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-22 20:44:37 +00:00
Billy Robert O'Neal III
0a890c95ca [libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XX
The test is trying to avoid saying aligned_alloc on Windows' UCRT, which does not (and can not) implement aligned_alloc. However, it's testing for c1xx, meaning clang on Windows will fail this test when using the UCRT.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-20 03:35:45 +00:00
Eric Fiselier
52a8692f86 Fix threaded test under no-threading configuration
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@343432 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 01:05:51 +00:00