Commit Graph

152 Commits

Author SHA1 Message Date
Yabin Cui
4b737c774c Remove test for -fcoroutines-ts
After clang update, we got the below error:
  external/libcxx/libcxx_test_template.cpp
  clang++: error: unknown argument: '-fcoroutines-ts'

Since this option has been removed in clang, remove test for it.

Bug: 280683256
Test: build with clang-r498229
Change-Id: Icecd7152f8d724d680bf17e3f920f15365b285a6
2023-06-08 18:09:17 +00:00
Dan Albert
fd86c1f3ed Enable testing C++ coroutines TS.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: I620c999b6c156129257d3937b0893f45a6d3fddd
2019-02-28 15:11:47 -08:00
Dan Albert
e4b6d367d4 Merge to upstream r350972.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: I96552544c8305853be519855982caf716930519e
2019-01-11 14:07:42 -08:00
Dan Albert
4d4d6a8f06 Add std::filesystem support.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: Ie277f503b754321eba04b906fa4ee6d670b2c1b2
2019-01-10 21:26:33 -08:00
Treehugger Robot
b2ed3ee88f Merge changes Ifc661bd2,Iba4ed7be
* changes:
  Run device tests as the shell user.
  Remove dead code.
2019-01-10 20:09:43 +00:00
Dan Albert
35cb7a0541 Run device tests as the shell user.
A handful of the std::filesystem tests assume non-root (such as
checking readability of a file that has mode 000). We probably
shouldn't be running as root for these tests anyway.

Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Bug: None
Change-Id: Ifc661bd245c3d802d8816d1c098b0e47d011c4fa
2019-01-09 22:17:50 -08:00
Dan Albert
fc8f268b2c Add and test libc++experimental.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: I9f712f8f73a8335aadf82af6686158de819442be
2019-01-09 21:29:39 -08:00
Dan Albert
a319cc895c Remove dead code.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Bug: None
Change-Id: Iba4ed7bedf092bf642ba135230c405b29f082e05
2019-01-09 14:28:25 -08:00
Louis Dionne
0ef5c29792 [libcxx] Add a script to run CI on older MacOS versions
This script can be used by CI systems to test things like availability
markup and binary compatibility on older MacOS versions. This is still
a bit rough on the edges, for example we don't test libc++abi yet.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350752 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 19:40:20 +00:00
Louis Dionne
504008e535 [libcxx] Add a script to run CI on MacOS
CI systems like Green Dragon should use this script so as to make
reproducing errors easy locally.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350740 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 16:35:55 +00:00
Dan Albert
40cbe812b7 Merge to upstream r348296.
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Bug: None
Change-Id: I79cdb1e5f146e42e383426c8e12a231b53a9459a
2019-01-08 15:37:39 -08:00
Kamil Rytarowski
73aa3a8936 Revert "D56064: More tolerance for flaky tests in libc++ on NetBSD"
Requested by EricWF.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350477 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-05 20:11:54 +00:00
Kamil Rytarowski
51895bf735 More tolerance for flaky tests in libc++ on NetBSD
Summary:
Tests marked with the flaky attribute ("FLAKY_TEST.")
can still report false positives in local tests and on the
NetBSD buildbot.

Additionally a number of tests (probably all threaded
ones) unmarked with the flaky attribute is flaky on
NetBSD.

An ideal solution on the libcxx side would be to raise
max retries for NetBSD and mark failing tests with
the flaky flag, however this adds more maintenance
burden and constant monitoring of flaky tests.

Reduce the work and handle flaky tests as more flaky
on NetBSD and allow flakiness  of other tests on
NetBSD.

Reviewers: mgorny, EricWF

Reviewed By: mgorny

Subscribers: christof, llvm-commits, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350170 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-30 23:05:14 +00:00
Michal Gorny
4b8645f0dc [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349379 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 19:14:08 +00:00
Eric Fiselier
48df810b1a Try 2: Fix bug in buildbot start script
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349236 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 03:48:08 +00:00
Eric Fiselier
9468ef1494 Fix bug in buildbot start script
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349235 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 03:45:21 +00:00
Eric Fiselier
c9296e7eab Rework docker setup to make it easier to work around bugs on buildbots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349234 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 03:24:33 +00:00
Louis Dionne
7213ea7c13 [libcxx] Make sure use_system_cxx_lib does not override cxx_runtime_root for DYLD_LIBRARY_PATH
Otherwise, even specifying a runtime root different from the library
we're linking against won't work -- the library we're linking against
is always used. This is undesirable if we try testing something like
linking against a recent libc++.dylib but running the tests against an
older version (the back-deployment use case).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349171 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 18:19:14 +00:00
Eric Fiselier
ea9230c04b Update google benchmark again
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349127 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 03:48:09 +00:00
Eric Fiselier
114125f97b Update google benchmark version
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349126 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 03:37:13 +00:00
Louis Dionne
682614cc53 [libcxx] Only enable the availability LIT feature when we're testing libc++
Other standard libraries don't implement availability markup, so it doesn't
make sense to e.g. XFAIL tests based on availability markup outside of
libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348871 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 18:05:38 +00:00
Louis Dionne
3b06e97b93 [libcxx] Remove the no_default_flags LIT configuration
This is part of an ongoing cleanup of the LIT test suite, where I'm
trying to reduce the number of configuration options. In this case,
the original intent seemed to be running the test suite with libstdc++,
but this is now supported by specifying cxx_stdlib_under_test=libstdc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348868 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 17:29:55 +00:00
Louis Dionne
2fa05e61c8 [NFC] Fix incorrect (but unreachable) LIT error message
It is unreachable because we test that the cxx_stdlib_under_test is
in the supported set of libraries elsewhere. Furthermore, this code
relied on the `use_stdlib_type`, which is never defined.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348867 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 17:05:20 +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
21e47d9ff8 [libcxx] Always convert 'use_system_cxx_lib' to an absolute path
Otherwise, some tests would fail when a relative path was passed,
because they'd use the relative path from a different directory
than the current working directory.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348525 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 20:09:15 +00:00
Peter Collingbourne
26cd9b82f8 Update run_tests.py to use Soong.
run_tests.py had bitrotted since it was last run (e.g. it used perl
which is now not allowed and the warning flags were out of date).
I changed it to use a different way of extracting the compile command
which is based on Soong instead of makefiles. This way is also
compatible with multiple build directories since it doesn't clobber
the source directory and doesn't require OUT_DIR == out.

This also changes run_tests.py to run the libcxxabi tests as well,
since they can be run using the same mechanism.

Bug: 120510768
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Test: ./run_tests.py --bitness 64 --host
Change-Id: Id30129161f8519fa6c1bc106727326373ca9ab82
2018-12-05 15:47:23 -08:00
Louis Dionne
bf62394ab6 [libcxx] Always enable availability in the lit test suite.
Summary:
Running the tests without availability enabled doesn't really make sense:
availability annotations allow catching errors at compile-time instead
of link-time. Running the tests without availability enabled allows
confirming that a test breaks at link-time under some configuration,
but it is more useful to instead check that it should fail at compile-time.

Always enabling availability in the lit test suite will greatly simplify
XFAILs and troubleshooting of failing tests, which is currently a giant
pain because we have these two levels of possible failure: link-time and
compile-time.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348296 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-04 19:31:08 +00:00
Louis Dionne
97c03fb705 [libcxx] Use clang-verify in the lit test suite even when availability is enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347780 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 17:31:17 +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
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
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
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
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
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
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
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
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
Eric Fiselier
3238cbf311 XFAIL test on OS X availability
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-29 19:52:22 +00:00
Louis Dionne
6c34a15a1f [libcxx] Improve reporting when running the lit test suite
Summary:
Running the test suite with -a will now properly show all the executed
commands. The reports also include the environment under which the test
is being executed, which is helpful for reproducing issues.

Reviewers: EricWF

Subscribers: christof, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344700 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-17 16:12:04 +00:00
Louis Dionne
6331d2ff0b [NFC][libc++] Fix broken link in comment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 17:12:41 +00:00
Roman Lebedev
caf40ae419 [libc++] Add _LIBCPP_ENABLE_NODISCARD and _LIBCPP_NODISCARD_EXT to allow pre-C++2a [[nodiscard]]
Summary:
The `[[nodiscard]]` attribute is intended to help users find bugs where
function return values are ignored when they shouldn't be. After C++17 the
C++ standard has started to declared such library functions as `[[nodiscard]]`.
However, this application is limited and applies only to dialects after C++17.
Users who want help diagnosing misuses of STL functions may desire a more
liberal application of `[[nodiscard]]`.

For this reason libc++ provides an extension that does just that! The
extension must be enabled by defining `_LIBCPP_ENABLE_NODISCARD`. The extended
applications of `[[nodiscard]]` takes two forms:

1. Backporting `[[nodiscard]]` to entities declared as such by the
   standard in newer dialects, but not in the present one.

2. Extended applications of `[[nodiscard]]`, at the libraries discretion,
   applied to entities never declared as such by the standard.

Users may also opt-out of additional applications `[[nodiscard]]` using
additional macros.

Applications of the first form, which backport `[[nodiscard]]` from a newer
dialect may be disabled using macros specific to the dialect it was added. For
example `_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17`.

Applications of the second form, which are pure extensions, may be disabled
by defining `_LIBCPP_DISABLE_NODISCARD_EXT`.

This patch was originally written by me (Roman Lebedev),
then but then reworked by Eric Fiselier.

Reviewers: mclow.lists, thakis, EricWF

Reviewed By: thakis, EricWF

Subscribers: llvm-commits, mclow.lists, lebedev.ri, EricWF, rjmccall, Quuxplusone, cfe-commits, christof

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342808 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-22 17:54:48 +00:00
Eric Fiselier
1e22fa5b1b Attempt to unbreak filesystem tests on certain linux distros.
On some platforms clock_gettime is in librt, which we don't
link by default when building the tests. However it is required
by the filesystem tests.

This patch introduces a workaround which links librt whenever
the filesystem tests are enabled. The workaround should later
be replaced with a patch that selectively links both libc++fs
and librt only when building filesystem specific tests. However,
the way the test configuration is set up right now, this is
non-trivial.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 13:29:52 +00:00
Louis Dionne
61b0a0088b [libcxx] By default, do not use internal_linkage to hide symbols from the ABI
Summary:
https://reviews.llvm.org/D49240 led to symbol size problems in Chromium, and
we expect this may be the case in other projects built in debug mode too.
Instead, unless users explicitly ask for internal_linkage, we use always_inline
like we used to.

In the future, when we have a solution that allows us to drop always_inline
without falling back on internal_linkage, we can replace always_inline by
that.

Note that this commit introduces a change in contract for existing libc++
users: by default, libc++ used to guarantee that TUs built with different
versions of libc++ could be linked together. With the introduction of the
_LIBCPP_HIDE_FROM_ABI_PER_TU macro, the default behavior is that TUs built
with different libc++ versions are not guaranteed to link. This is a change
in contract but not a change in behavior, since the current implementation
still allows linking TUs built with different libc++ versions together.

Reviewers: EricWF, mclow.lists, dexonsmith, hans, rnk

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339874 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 12:44:28 +00:00
Eric Fiselier
a0866c5fb5 Implement <filesystem>
This patch implements the <filesystem> header and uses that
to provide <experimental/filesystem>.

Unlike other standard headers, the symbols needed for <filesystem>
have not yet been placed in libc++.so. Instead they live in the
new libc++fs.a library. Users of filesystem are required to link this
library. (Also note that libc++experimental no longer contains the
definition of <experimental/filesystem>, which now requires linking libc++fs).

The reason for keeping <filesystem> out of the dylib for now is that
it's still somewhat experimental, and the possibility of requiring an
ABI breaking change is very real. In the future the symbols will likely
be moved into the dylib, or the dylib will be made to link libc++fs automagically).

Note that moving the symbols out of libc++experimental may break user builds
until they update to -lc++fs. This should be OK, because the experimental
library provides no stability guarantees. However, I plan on looking into
ways we can force libc++experimental to automagically link libc++fs.

In order to use a single implementation and set of tests for <filesystem>, it
has been placed in a special `__fs` namespace. This namespace is inline in
C++17 onward, but not before that. As such implementation is available
in C++11 onward, but no filesystem namespace is present "directly", and
as such name conflicts shouldn't occur in C++11 or C++14.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338093 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:07:09 +00:00
Eric Fiselier
7a0f119777 Remove BUILD file from google-benchmark
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336666 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10 13:25:26 +00:00
Eric Fiselier
ffc31db661 Update google-benchark to trunk
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336635 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10 04:02:00 +00:00
Eric Fiselier
e5a3de1bd1 Remove old workaround that is no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336297 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-04 20:16:05 +00:00
Dan Albert
38a905636d Merge to upstream r334917.
Bug: None
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Change-Id: If8594f80130bd7dd55d3c4f8224fde54844b1d4a
2018-06-21 15:12:15 -07:00
Richard Smith
5aa278078e Fix libcxx tests after clang r334677.
Feature test macro versions may have a trailing L.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334917 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-17 19:58:45 +00:00