Commit Graph

5092 Commits

Author SHA1 Message Date
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
Louis Dionne
a4e279c31f [NFC] Mark LWG3128 and LWG3132 as requiring no work
Those LWG issues were adopted in San Diego and require no work
on our side.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346799 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 21:13:10 +00:00
Eric Fiselier
6b8b8a113d Fix UB in string.bench.cpp.
The usage of aligned_storage failed to pass the alignment it wanted,
which caused it to have a larger size and alignment that the
std::string's it was intended to store.

This patch manually specifies the alignment, as well as cleaning up
type alias bugs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 19:16:19 +00:00
Marshall Clow
10180dc28f Remove duplicate entry for issue 3134
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346772 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 18:07:51 +00:00
Marshall Clow
87b4a050de Update status for issue 3122
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346771 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 18:05:10 +00:00
Louis Dionne
d9c27151e9 [NFC][libcxx] Mark P1006R1 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 17:33:11 +00:00
Marshall Clow
98d4ace735 Implement P0972R0: <chrono> zero(), min(), and max() should be noexcept. Reviewed as https://reviews.llvm.org/D53828
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346766 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 17:22:41 +00:00
Louis Dionne
d086fccc3a [NFC][libcxx] Mark P1006 as implemented in LLVM 8.0
It was implemented in https://reviews.llvm.org/D53867

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346765 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 17:09:25 +00:00
Louis Dionne
52ddb5e2b8 [libcxx] Implement http://wg21.link/p1006, constexpr in pointer_traits
Summary:
P1006 adds support for constexpr in the specialization of pointer_traits
for raw pointers. This is necessary in order to use pointer_traits in
the upcoming constexpr containers. We expect P1006 to be voted into the
working draft for C++20 at the San Diego meeting.

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346764 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 17:04:05 +00:00
Louis Dionne
64d50b3eb5 [libcxx] GNU/Hurd uses BSD-based interfaces, but does not (and won't) provide <sys/sysctl.h>
Reviewed as https://reviews.llvm.org/D54338.

Thanks to sthibaul for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 17:00:04 +00:00
Eric Fiselier
91400619da Attempt to make benchmarks fall back to -std=c++1z when C++17 isn't supported.
The benchmarks currently require C++17, however Clang 3.9 doesn't
support -std=c++17 while still supporting all the C++17 features needed
to compile the benchmarks.

This patch makes the benchmark build attempt to fall back to -std=c++1z
when -std=c++17 isn't supported.

See llvm.org/PR39629

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346744 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 07:03:16 +00:00
Eric Fiselier
16a8e7ec37 Add emplace tests for multiset/unordered_multiset.
This patch adds tests to ensure that multiset/unordered_multiset's emplace
method correctly constructs the elements without any intervening
constructions.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346743 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 06:30:36 +00:00
Marshall Clow
3870a97d86 Fix PR39619 - iterator_traits isn't SFINAE-friendly enough. Thanks to Eric for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346738 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 05:33:31 +00:00
Marshall Clow
94664a1ad8 Update to-do list with new work from WG21 meeting in San Diego
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346634 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-12 04:58:00 +00:00
Louis Dionne
e754a7a9d2 [NFC] Reformat std::optional tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346630 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-12 01:38:30 +00:00
Louis Dionne
0a36edc613 [NFC] Fix typo in <tuple>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346629 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-12 01:28:07 +00:00
Petr Hosek
cc73b180eb [libcxx] Provide thread annotations for shared_mutex
shared_mutex was introduced in C++17 but its implementation currently
doesn't use Clang's thread annotations like regular mutex. This change
adds those.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346567 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-09 23:32:25 +00:00
Eric Fiselier
55a3e6c1f2 Attempt to enable -Wconversion
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346451 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08 23:57:32 +00:00
Fangrui Song
d46349516c Fix -Wimplicit-fallthrough warning
Reviewers: EricWF, ldionne, mclow.lists

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07 23:51:13 +00:00
Marshall Clow
9b0b9d6ce6 Fix the test for partition_copy so it is not ridiculously slow. Also, detab.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346104 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-04 17:57:25 +00:00
Louis Dionne
048b34a304 [NFC] Fix incorrect comment in std::list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346072 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-03 17:51:09 +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
5dc37768e2 Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible."
This reverts r345525. I'm reverting because that patch apparently caused
a regression on certain platforms (see https://reviews.llvm.org/D53994).
Since we don't fully understand the reasons for the regression, I'm
reverting until we can provide a fix we understand.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345893 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 21:24:32 +00:00
Reid Kleckner
6115b72f60 Use C++11 fallthrough attribute syntax when available and add a break
Summary:
This silences the two -Wimplicit-fallthrough warnings clang finds in
ItaniumDemangle.h in libc++abi.

Clang does not have a GNU attribute spelling for this attribute, so this
is necessary.

I will commit the same change to the LLVM demangler soon.

Reviewers: EricWF, ldionne

Subscribers: christof, erik.pilkington, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345870 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01 18:24:03 +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
Louis Dionne
3fa96b3738 [NFC] Replace C++1y and C++1z by C++14 and C++17, respectively
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345762 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 18:53:31 +00:00
Louis Dionne
def3a4042e [NFC] Mark "Splicing Maps and Sets" as done in LLVM 8.0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345759 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 18:33:11 +00:00
Erik Pilkington
71ac96a43b Second half of C++17's splicing maps and sets
This commit adds a merge member function to all the map and set containers,
which splices nodes from the source container. This completes support for
P0083r3.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345744 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 17:31:35 +00:00
Louis Dionne
3a73f018a2 Correct ABI list change wrongly advertised as being in the 7.0 release
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345670 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-30 23:24:02 +00:00