5170 Commits

Author SHA1 Message Date
Louis Dionne
09861dbf93 [NFC] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 19:10:28 +00:00
Louis Dionne
e9a1ea42bf [libcxx] Reintroduce UNSUPPORTED annotation for strstreambuf overflow test
This is a revert of r347421, except I'm using the with_system_cxx_lib
lit feature instead of availability to mark the test as unsupported
(because the problem is a bug in the dylib itself). In r347421, I said
I wasn't able to reproduce the issue and that's why I was removing it:
this was because I ran lit slightly wrong. The problem mentioned really
exists.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 17:43:22 +00:00
Louis Dionne
a0b648f164 [libcxx] Add XFAIL for test on OS X 10.12 to 10.14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347473 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 16:38:03 +00:00
Louis Dionne
efba04d1fe [NFC][libcxx] Print human-friendly command line when lit test fails
We used to print a Python list corresponding to the command. It is more
useful to print the joined string so it can be copy/pasted directly when
a test fails.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347471 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 16:10:49 +00:00
Louis Dionne
79132e8628 [libcxx] Remove incorrect XFAIL on macos 10.12
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347461 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 13:40:56 +00:00
Louis Dionne
ab883e8c3b [libcxx] Improve error message when an invalid directory is provided as use_system_cxx_lib
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347435 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 23:00:45 +00:00
Louis Dionne
d898f74a78 [libcxx] Remove unused definition of aligned allocation macro on old OS X
We don't support mac OS 10.6 and older anymore, so this macro can never
be defined. This bit of code had been added in D28931 as a fix for
PR31448, but it doesn't seem necessary anymore.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347427 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 21:22:08 +00:00
Louis Dionne
5beaebf500 [libcxx] Fix incorrect iterator type in vector container test
The iterator types for different specializations of containers with the
same element type but different allocators are not required to be
convertible. This patch makes the test to take the iterator type from
the same container specialization as the created container.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347423 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 20:53:07 +00:00
Louis Dionne
3ad8fb7ecd [libcxx] Mark strstreams tests as being supported on all OS X versions
I wasn't able to reproduce the issue referred to by the comment using
the libc++'s shipped with mac OS X 10.7 and 10.8, so I assume this may
have been fixed in a function that is now shipped in the headers. In
that case, the tests will pass no matter what dylib we're using.

In the worst case, some test bots will start failing and I'll understand
why I was wrong, and I can create an actual lit feature for it. Note
that I could just leave this test alone, but this change is on the path
towards eradicating vendor-specific availability markup from the test
suite.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347421 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 20:47:00 +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
ce2232ff86 [libcxx] Make sure operator+ is declared with the right visibility attribute
Otherwise, Clang complains about internal_linkage not being applied to the
first declaration of the operator (and rightfully so).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347400 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 17:31:55 +00:00
Louis Dionne
ee6e0ce13f [libcxx] Mark stray symbols as hidden to try and fix the build
r347395 changed the ABI list on Linux, but two of those symbols are still
being exported from the shared object:

    _ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_
    _ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_

This commit makes sure those symbols are not exported, as they should be.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 17:00:52 +00:00
Louis Dionne
23e4ddc020 [NFC][libcxx] Add revision number to ABI changelog
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347396 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 16:27:14 +00:00
Louis Dionne
507fe4022b [libcxx] Make sure we can build with -fvisibility=hidden on Linux
Summary:
This commit marks a few functions as hidden and removes them from the ABI list
on Linux such that libc++ can be built with -fvisibility=hidden. The functions
marked as hidden by this patch were exported from the shared object only
because they were implicitly instantiated function templates. It is safe
to stop exporting those symbols from the shared object because nobody could
actually depend on them: implicit instantiations are not taken from shared
objects.

The symbols removed in this commit are basically the same that had been
removed in https://reviews.llvm.org/D53868, but that patch had to be reverted
because it broke the build (because the functions were not marked as hidden
like this patch does).

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347395 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 16:24:46 +00:00
Zhihao Yuan
580cde08e1 [libc++] Implement P0487R1 - Fixing operator>>(basic_istream&, CharT*)
Summary:
Avoid buffer overflow by replacing the pointer interface with an array reference interface in C++2a.
Tentatively ready on Batavia2018.

 https://wg21.link/lwg2499
 https://wg21.link/p0487

Reviewers: mclow.lists, ldionne, EricWF

Reviewed By: ldionne

Subscribers: libcxx-commits, cfe-commits, christof

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347377 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-21 03:30:10 +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
Louis Dionne
7aa4878d6f [NFC] Reformat availability #defines in __config
Aligning everything makes what we're doing more obvious.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347363 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 23:18:25 +00:00
Louis Dionne
ee720ea18f [NFC] Fix formatting in availability documentation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347362 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 23:07:01 +00:00
Marshall Clow
7c5126bcc4 A couple of tests were broken when clang implemented the compiler parts of P0482 (support for char8_t). Comment out those bits until we implement the corresponding bits in libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347360 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 22:55:40 +00:00
Louis Dionne
33f9849b15 [libcxx] Fix threads detection on GNU/Hurd
GNU/Hurd provides standard Posix threads

Reviewed as https://reviews.llvm.org/D54339.
Thanks to Samuel Thibault for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347347 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 21:14:05 +00:00
Marshall Clow
44047a25fd Note that P0899R1 requires no work.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347344 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 20:38:15 +00:00
Marshall Clow
3b4ca5b4af Mark P0771 as complete; we already did this - I just added tests to be sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347343 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 20:37:07 +00:00
Samuel Benzaquen
c1f6028e00 Add benchmarks for sorting and heap functions.
Summary:
Benchmarks for std::sort, std::stable_sort, std::make_heap,
std::sort_heap, std::pop_heap and std::push_heap.

The benchmarks are run with integers and strings, and with different
sorted input.

Reviewers: EricWF

Subscribers: christof, mgrang, ldionne, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347329 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-20 17:15:17 +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
f9b79dcfc3 [libcxx] Fix XFAIL for GCC 4.9
The XFAIL started passing since we're only testing for trivial-copyability of
reference_wrapper in C++14 and above. This commit constrains the XFAIL to
gcc-4.9 with C++14 (it would also fail on C++17 and above, but those standards
are not available with GCC 4.9).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347264 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 20:53:38 +00:00
Louis Dionne
22507d63b6 [libcxx] Update test of trivial copyability of reference_wrapper
N4151 is not an extension anymore, it was standardized in C++14.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347263 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 20:21:45 +00:00
Eric Fiselier
f6726af01a Add docker configurations used by the buildbots.
These are the scripts I use to create the docker images for
the build bots and run them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347244 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 18:43:31 +00:00
Louis Dionne
c8f785547c [libcxx] Fix incorrect #include for std::hash
Reviewed as https://reviews.llvm.org/D54705.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347233 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 17:40:16 +00:00
Louis Dionne
a320121c4c [libcxx] Add missing <cstddef> includes in tests
Some tests use type std::max_align_t, but don't include <cstddef> header
directly. As a result, these tests won't compile against some conformant
libraries.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347232 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-19 17:39:50 +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
Louis Dionne
20c43d22bb [libcxx] Add missing includes in tests
A bunch of unordered containers tests call library functions but don't directly
include the corresponding header files:

- fabs() (defined in <cmath> which is not included);
- is_permutation() (defined in <algorithm> which is not included);
- next() (defined in <iterator> which is not included).
- As a result, these tests won't compile against some conformant libraries.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347085 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-16 19:52:47 +00:00
Louis Dionne
1e04e9b111 [libcxx] Mention restriction on inline namespaces in LIBCXX_ABI_NAMESPACE docs
I also kept the original "vague" documentation that saying that users are
responsible for not breaking us. This doesn't mean anything because there's
no way they can actually enforce that unless we restrict ourselves to a
specific naming scheme, but I left the documentation because it acts as a
good warning and gives us more leeway.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347052 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-16 14:57:47 +00:00
Benjamin Kramer
7aac600eba Remove BUILD file from google-benchmark
This was removed in r336666, but accidentally re-added in r346984.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347046 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-16 12:53:17 +00:00
Eric Fiselier
c5a5fa5978 Disable filesystem benchmark when libstdc++ doesn't support it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 19:53:43 +00:00
Eric Fiselier
622fc11b5e Upgrade Google Benchmark library to ToT
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346984 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 19:22:53 +00:00
Eric Fiselier
3ea08cd28a propagate __config_site includes when building benchmarks
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346933 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 07:29:56 +00:00
Eric Fiselier
09e56c1598 Work around C++03 decltype limitations
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346917 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 00:27:06 +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
c6da5c57fe [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.
C++11's [hash.requirements] never required these typedefs from users.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346912 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 23:23:55 +00:00
Stephan T. Lavavej
5d11d6e664 [libcxx] [test] Include <cassert> for assert().
This fixes compiler errors with MSVC's STL.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346911 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 23:23:51 +00:00
Stephan T. Lavavej
5e97ad3674 [libcxx] [test] Fix MSVC warning C4800.
This was implicitly converting [1, 3] to bool, which triggers
an MSVC warning. The test should just pass `true`, which is
simpler, has the same behavior, and avoids the warning. (This
is a library test, not a compiler test, and the conversion happens
before calling `push_back`, so passing [1, 3] isn't interesting
in any way. This resembles a previous change to stop passing
`1 == 1` in the `vector<bool>` tests.)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 23:23:46 +00:00
Eric Fiselier
ca91cfcbf4 Attempt to show progress bar in benchmark tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346905 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 22:49:42 +00:00
Eric Fiselier
c53065de3a Exclude check-cxx-benchmarks from the global test target.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 22:48:43 +00:00
Eric Fiselier
b124ade497 Rename cxx-benchmark-unittests target and convert to LIT.
This patch renames the cxx-benchmark-unittests to check-cxx-benchmarks
and converts the target to use LIT in order to make the tests run faster
and provide better output.

In particular this runs each benchmark in a suite one by one, allowing
more parallelism while ensuring output isn't garbage with multiple threads.

Additionally, it adds the CMake flag '-DLIBCXX_BENCHMARK_TEST_ARGS=<list>'
to specify what options are passed when running the benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346888 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 20:38:46 +00:00
Alexander Richardson
eabc47899b [libcxx] [test] Fix running tests on macOS with python3
Summary:
The result of subprocess.check_output() is bytes in python3 which we need
to convert to str(). Simplify this by using the executeCommand() helper.

Reviewers: ldionne, EricWF

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346878 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 17:58:55 +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
Petr Hosek
ad46a18a84 [CMake] Passthrough CFLAGS when checking the compiler-rt path
This is needed when cross-compiling for a different target since
CFLAGS may contain additional flags like -resource-dir which
change the location in which compiler-rt builtins are found.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346820 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 00:09:26 +00:00
Eric Fiselier
2d7654ea66 Add cxx-benchmark-unittests target
This patch adds the cxx-benchmark-unittests target so we can start
getting test coverage on the benchmarks, including building with
sanitizers. Because we're only looking for test-coverage, the benchmarks
run for the shortest time possible, and in parallel.

The target is excluded from all by default. It only
builds and runs the libcxx configurations of the benchmarks, and not
any versions built against the systems native standard library.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346811 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 23:08:31 +00:00
Eric Fiselier
34aa86bc39 Fix "use of" uninitialized memory in benchmark.
An argument to DoNotOptimize was not fully initialized, which caused
msan to complain.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346808 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 23:00:55 +00:00
Marshall Clow
1595c0dd31 Mark #2184 as complete; the tests are fine. (I thought that they were wrong before)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346805 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 22:26:03 +00:00