Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Re-branch stable from swift-5.1-branch #1

Merged
merged 349 commits into from Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
349 commits
Select commit Hold shift + click to select a range
6735cca
Papers and Issues for San Diego
mclow Oct 6, 2018
c7cc669
Do the math in uniform_int_distribution::operator() as unsigned to pr…
mclow Oct 8, 2018
385cc71
[libcxx] Mark std::async race condition test as unsupported on Darwin
ldionne Oct 9, 2018
f7d5bd2
Annotate scoped_lock as with scoped_lockable attribute
aaronpuchert Oct 9, 2018
9c34c77
Fix linking filesystem benchmarks
EricWF Oct 10, 2018
697faed
Add test macros for always_inline and noinline
EricWF Oct 10, 2018
c4edc5a
Use std::scoped_lock only for C++17 and newer
aaronpuchert Oct 10, 2018
b5d4ffd
Use TEST_STD_VER instead of __cplusplus [NFC]
aaronpuchert Oct 10, 2018
657a130
Distinguish between library and language support for aligned allocation.
EricWF Oct 11, 2018
f9c56da
Fix use of removed _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE
EricWF Oct 11, 2018
e436a75
Add a test that shows what happens with throwing destructors. NFC.
mclow Oct 11, 2018
2199647
Prefer to use the __is_XXX compiler intrinsics to the (old, busted) _…
mclow Oct 11, 2018
b233fda
Revert commit r344254; does not work with C++03
mclow Oct 11, 2018
6331d2f
[NFC][libc++] Fix broken link in comment
ldionne Oct 12, 2018
11b8a46
Add benchmarks for std::function.
sbenzaquen Oct 12, 2018
477f04b
Update all the max_size tests to eliminate signed/unsigned comparison…
mclow Oct 12, 2018
8f07ece
Update the array tests to not use a local type; removes warnings in C…
mclow Oct 12, 2018
fa1a3d5
One more local type warning removed from the tests. NFC
mclow Oct 12, 2018
fc25eeb
Implement the first part of the calendar support for C++20. This is s…
mclow Oct 15, 2018
1b8e200
Wrap up the new chrono literals in an #ifdef so that old versions of …
mclow Oct 15, 2018
689f6cd
Mark a couple of test cases as 'C++17-only' pending the resolution of…
mclow Oct 15, 2018
9bc5d8e
[libcxx] Remove custom CMake code targeting Mac OS 10.6
ldionne Oct 16, 2018
7f20dc6
Revert r344529 "Implement the first part of the calendar support for …
haoNoQ Oct 16, 2018
93d0856
Re-apply r344546 "Mark a couple of test cases as 'C++17-only'..."
haoNoQ Oct 16, 2018
7e3ab17
Partial fix for PR38964. (<string> can't be built with gcc -std=c++03…
mclow Oct 16, 2018
cc5c12d
Recommit <chrono> changes with a couple xtra tests marked to fail on …
mclow Oct 16, 2018
3845a65
[libcxx] Remove _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
ldionne Oct 16, 2018
d74c17e
[libcxx] Avoid repeating the definition of std:: namespaces
ldionne Oct 16, 2018
4104ebe
[libcxx] Mark chrono literal unit tests as being unsupported on Apple…
ldionne Oct 17, 2018
6c34a15
[libcxx] Improve reporting when running the lit test suite
ldionne Oct 17, 2018
22b685e
Repair thread-unsafe modifications of n_alive in F.pass.cpp
BillyONeal Oct 19, 2018
87aef88
[libcxx] [test] Add missing <stdexcept> to map at tests.
BillyONeal Oct 19, 2018
0a890c9
[libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XX
BillyONeal Oct 20, 2018
3d1d923
Update commnents to reflect the changes for LWG#3122. NFC
mclow Oct 22, 2018
9110b80
Update commnents to reflect the changes for LWG#3127. NFC
mclow Oct 22, 2018
1f63d28
Update commnents to reflect the changes for LWG#3127. NFC
mclow Oct 22, 2018
dd10075
Added more notes to the issues.
mclow Oct 22, 2018
a894ebb
Add tests for match_results copy/move construction. NFC
mclow Oct 23, 2018
173057e
Updated the issue notes.
mclow Oct 23, 2018
268b4d0
Remove a 'const' from the synopsis. NFC
mclow Oct 23, 2018
374084f
Add tests for match_results copy/move assignment operators. NFC
mclow Oct 23, 2018
9678b5d
Mark the move construct/move assign tests as unsupported on C++03
mclow Oct 23, 2018
d8754ba
Add benchmark for std::set.
sbenzaquen Oct 23, 2018
b994bfe
When filling a vector<bool> with stuff, initialize the last word of t…
mclow Oct 23, 2018
ec22e35
Off-by-one errors strike again. Thank goodness for ASAN and the bots.
mclow Oct 23, 2018
0423faf
Adjust unsupported C++ versions in some tests
miyuki Oct 24, 2018
005bb4c
Fix use of libc++ specific macro in support/test_macros.h
EricWF Oct 24, 2018
842383f
Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"
petrhosek Oct 24, 2018
0cfdf55
Implement sized deallocation for std::allocator and friends.
EricWF Oct 24, 2018
d03e037
Fix use of __libcpp_deallocate in dynarray
EricWF Oct 25, 2018
1b9ee84
Temporarily Revert "Implement sized deallocation for std::allocator a…
echristo Oct 25, 2018
92d8736
Revert "Fix use of __libcpp_deallocate in dynarray"
echristo Oct 25, 2018
07f95bd
[libc++] Make sure we can build libc++ with -fvisibility=hidden
ldionne Oct 25, 2018
e09f85b
Implement sized deallocation for std::allocator and friends.
EricWF Oct 25, 2018
b3ae0c8
fix incorrect placement of _LIBCPP_ALWAYS_INLINE in valarray
EricWF Oct 25, 2018
5be2163
Run the min/max tests agaist the header <charconv>. Fix that header s…
mclow Oct 26, 2018
6dcb34a
XFAIL sized deallocation test with GCC
EricWF Oct 26, 2018
e696826
Fix incorrect use of aligned allocation in get_temporary_buffer.
EricWF Oct 26, 2018
73f498b
[NFC] Update comment in libc++ ABI changelog
ldionne Oct 26, 2018
924b8f3
Work around gcc.gnu.org/PR87766
EricWF Oct 26, 2018
293b83d
Fix PR39458 _LIBCPP_DEBUG breaks heterogeneous compare.
EricWF Oct 26, 2018
640fa25
[libc++] Use exclude_from_explicit_instantiation instead of always_in…
ldionne Oct 29, 2018
081dda5
Fix mismatch between size_t and uint64_t in std::set benchmark.
sbenzaquen Oct 29, 2018
207b919
Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by us…
EricWF Oct 29, 2018
c5a77b2
Added Phab link for P0927
mclow Oct 29, 2018
3238cbf
XFAIL test on OS X availability
EricWF Oct 29, 2018
94ce26b
Unify definition of _LIBCPP_BEGIN/END_NAMESPACE_STD
EricWF Oct 30, 2018
3b92bcd
Add more benchmarks for std::string.
sbenzaquen Oct 30, 2018
abfbf14
Update LLVM version used on Appveyor bot, remove MSVC 2015 bot
EricWF Oct 30, 2018
02bbf43
Add link to implementation for P1006R0
mclow Oct 30, 2018
e6f91d8
Make libc++'s versioning namespace customizable
EricWF Oct 30, 2018
831ab1b
[libcxx] Correct link to code review for P1006
ldionne Oct 30, 2018
74b3eac
Build with -fvisibility=hidden
EricWF Oct 30, 2018
381fd9e
Revert "Build with -fvisibility=hidden"
EricWF Oct 30, 2018
3a73f01
Correct ABI list change wrongly advertised as being in the 7.0 release
ldionne Oct 30, 2018
71ac96a
Second half of C++17's splicing maps and sets
epilk Oct 31, 2018
def3a40
[NFC] Mark "Splicing Maps and Sets" as done in LLVM 8.0
ldionne Oct 31, 2018
3fa96b3
[NFC] Replace C++1y and C++1z by C++14 and C++17, respectively
ldionne Oct 31, 2018
f10e0ac
[libcxx] Fix usage of _C2, which is a "nasty macro" in some environments
ldionne Nov 1, 2018
6115b72
Use C++11 fallthrough attribute syntax when available and add a break
rnk Nov 1, 2018
5dc3776
Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_boun…
ldionne Nov 1, 2018
73d2ecc
Fix test assumption that Linux implies glibc.
DanAlbert Nov 1, 2018
048b34a
[NFC] Fix incorrect comment in std::list
ldionne Nov 3, 2018
9b0b9d6
Fix the test for partition_copy so it is not ridiculously slow. Also,…
mclow Nov 4, 2018
d463495
Fix -Wimplicit-fallthrough warning
MaskRay Nov 7, 2018
55a3e6c
Attempt to enable -Wconversion
EricWF Nov 8, 2018
cc73b18
[libcxx] Provide thread annotations for shared_mutex
petrhosek Nov 9, 2018
0a36edc
[NFC] Fix typo in <tuple>
ldionne Nov 12, 2018
e754a7a
[NFC] Reformat std::optional tests
ldionne Nov 12, 2018
94664a1
Update to-do list with new work from WG21 meeting in San Diego
mclow Nov 12, 2018
3870a97
Fix PR39619 - iterator_traits isn't SFINAE-friendly enough. Thanks to…
mclow Nov 13, 2018
16a8e7e
Add emplace tests for multiset/unordered_multiset.
EricWF Nov 13, 2018
9140061
Attempt to make benchmarks fall back to -std=c++1z when C++17 isn't s…
EricWF Nov 13, 2018
64d50b3
[libcxx] GNU/Hurd uses BSD-based interfaces, but does not (and won't)…
ldionne Nov 13, 2018
52ddb5e
[libcxx] Implement http://wg21.link/p1006, constexpr in pointer_traits
ldionne Nov 13, 2018
d086fcc
[NFC][libcxx] Mark P1006 as implemented in LLVM 8.0
ldionne Nov 13, 2018
98d4ace
Implement P0972R0: <chrono> zero(), min(), and max() should be noexce…
mclow Nov 13, 2018
d9c2715
[NFC][libcxx] Mark P1006R1 as complete
ldionne Nov 13, 2018
87b4a05
Update status for issue 3122
mclow Nov 13, 2018
10180dc
Remove duplicate entry for issue 3134
mclow Nov 13, 2018
6b8b8a1
Fix UB in string.bench.cpp.
EricWF Nov 13, 2018
a4e279c
[NFC] Mark LWG3128 and LWG3132 as requiring no work
ldionne Nov 13, 2018
1595c0d
Mark #2184 as complete; the tests are fine. (I thought that they were…
mclow Nov 13, 2018
34aa86b
Fix "use of" uninitialized memory in benchmark.
EricWF Nov 13, 2018
2d7654e
Add cxx-benchmark-unittests target
EricWF Nov 13, 2018
ad46a18
[CMake] Passthrough CFLAGS when checking the compiler-rt path
petrhosek Nov 14, 2018
439de45
[libcxx] [test] Strip trailing whitespace. NFC.
StephanTLavavej Nov 14, 2018
eabc478
[libcxx] [test] Fix running tests on macOS with python3
arichardson Nov 14, 2018
b124ade
Rename cxx-benchmark-unittests target and convert to LIT.
EricWF Nov 14, 2018
c53065d
Exclude check-cxx-benchmarks from the global test target.
EricWF Nov 14, 2018
ca91cfc
Attempt to show progress bar in benchmark tests
EricWF Nov 14, 2018
5e97ad3
[libcxx] [test] Fix MSVC warning C4800.
StephanTLavavej Nov 14, 2018
5d11d6e
[libcxx] [test] Include <cassert> for assert().
StephanTLavavej Nov 14, 2018
c6da5c5
[libcxx] [test] Fix Clang -Wunused-local-typedef warnings.
StephanTLavavej Nov 14, 2018
c2c6c1d
Get tests compiling with -Wunused-local-typedef
EricWF Nov 15, 2018
09e56c1
Work around C++03 decltype limitations
EricWF Nov 15, 2018
3ea08cd
propagate __config_site includes when building benchmarks
EricWF Nov 15, 2018
622fc11
Upgrade Google Benchmark library to ToT
EricWF Nov 15, 2018
c5a5fa5
Disable filesystem benchmark when libstdc++ doesn't support it
EricWF Nov 15, 2018
7aac600
Remove BUILD file from google-benchmark
d0k Nov 16, 2018
1e04e9b
[libcxx] Mention restriction on inline namespaces in LIBCXX_ABI_NAMES…
ldionne Nov 16, 2018
20c43d2
[libcxx] Add missing includes in tests
ldionne Nov 16, 2018
13b7f7b
[libcxx] Add availability markup for bad_optional_access, bad_variant…
ldionne Nov 19, 2018
a320121
[libcxx] Add missing <cstddef> includes in tests
ldionne Nov 19, 2018
c8f7855
[libcxx] Fix incorrect #include for std::hash
ldionne Nov 19, 2018
f6726af
Add docker configurations used by the buildbots.
EricWF Nov 19, 2018
22507d6
[libcxx] Update test of trivial copyability of reference_wrapper
ldionne Nov 19, 2018
f9b79dc
[libcxx] Fix XFAIL for GCC 4.9
ldionne Nov 19, 2018
98dc85c
[NFC][libcxx] Fix incorrect comments
ldionne Nov 19, 2018
c1f6028
Add benchmarks for sorting and heap functions.
sbenzaquen Nov 20, 2018
3b4ca5b
Mark P0771 as complete; we already did this - I just added tests to b…
mclow Nov 20, 2018
44047a2
Note that P0899R1 requires no work.
mclow Nov 20, 2018
33f9849
[libcxx] Fix threads detection on GNU/Hurd
ldionne Nov 20, 2018
7c5126b
A couple of tests were broken when clang implemented the compiler par…
mclow Nov 20, 2018
ee720ea
[NFC] Fix formatting in availability documentation
ldionne Nov 20, 2018
7aa4878
[NFC] Reformat availability #defines in __config
ldionne Nov 20, 2018
739fdd4
[NFC] Rename lit feature to '-fsized-deallocation' for consistency
ldionne Nov 21, 2018
580cde0
[libc++] Implement P0487R1 - Fixing operator>>(basic_istream&, CharT*)
zhihaoy Nov 21, 2018
507fe40
[libcxx] Make sure we can build with -fvisibility=hidden on Linux
ldionne Nov 21, 2018
23e4ddc
[NFC][libcxx] Add revision number to ABI changelog
ldionne Nov 21, 2018
ee6e0ce
[libcxx] Mark stray symbols as hidden to try and fix the build
ldionne Nov 21, 2018
ce2232f
[libcxx] Make sure operator+ is declared with the right visibility at…
ldionne Nov 21, 2018
bac4a9b
Fix missing includes in test header
EricWF Nov 21, 2018
3ad8fb7
[libcxx] Mark strstreams tests as being supported on all OS X versions
ldionne Nov 21, 2018
5beaebf
[libcxx] Fix incorrect iterator type in vector container test
ldionne Nov 21, 2018
d898f74
[libcxx] Remove unused definition of aligned allocation macro on old …
ldionne Nov 21, 2018
ab883e8
[libcxx] Improve error message when an invalid directory is provided …
ldionne Nov 21, 2018
79132e8
[libcxx] Remove incorrect XFAIL on macos 10.12
ldionne Nov 22, 2018
efba04d
[NFC][libcxx] Print human-friendly command line when lit test fails
ldionne Nov 22, 2018
a0b648f
[libcxx] Add XFAIL for test on OS X 10.12 to 10.14
ldionne Nov 22, 2018
e9a1ea4
[libcxx] Reintroduce UNSUPPORTED annotation for strstreambuf overflow…
ldionne Nov 22, 2018
09861db
[NFC] Fix typo in comment
ldionne Nov 22, 2018
8008cf5
[libcxx] Use a type that is always an aggregate in variant's tests
ldionne Nov 26, 2018
8294000
[libcxx] Fix XFAIL for aligned deallocation test with trunk Clang
ldionne Nov 26, 2018
893cf80
[libcxx] Fix XFAILs for aligned allocation tests
ldionne Nov 26, 2018
f9782de
Add basic_string::__resize_default_init (from P1072)
EricWF Nov 26, 2018
5f3377c
Remove duplicate _LIBCPP_INLINE_VISIBILITY attributes.
EricWF Nov 26, 2018
f4e307b
Implement P1085R2 - Should Span be Regular?. This consists entirely o…
mclow Nov 27, 2018
f27a903
[libcxx] Fix libc++ re-exporting logic when Command Line Tools are no…
ldionne Nov 27, 2018
c56c9cf
[libcxx] Make sure the re-export logic works when paths contain spaces
ldionne Nov 27, 2018
6bc632f
[libcxx] Apply _LIBCPP_INLINE_VISIBILITY for std::hash for string_view
ldionne Nov 28, 2018
97c03fb
[libcxx] Use clang-verify in the lit test suite even when availabilit…
ldionne Nov 28, 2018
581671f
[libcxx] Remove dynarray
ldionne Nov 28, 2018
087f065
Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
EricWF Nov 28, 2018
7593e79
Implement P0966 - string::reserve should not shrink
mclow Nov 28, 2018
cf99ab7
Fix bad _LIBCPP_ALIGNOF test
EricWF Nov 28, 2018
e3e576a
Revert "Move internal usages of `alignof`/`__alignof` to use `_LIBCPP…
EricWF Nov 28, 2018
233c79a
[libcxx] More fixes to XFAILs for aligned allocation tests for macosx…
ldionne Nov 29, 2018
c28aca1
[libcxx] Remove bad_array_length
ldionne Nov 29, 2018
50509d1
First part of P0482 - Establish that char8_t is an integral type, and…
mclow Nov 29, 2018
ebdb547
Revert commit r347904 because it broke older compilers
mclow Nov 29, 2018
8e2d4ad
[libcxx] Make UNSUPPORTED for std::async test more fine grained
ldionne Nov 29, 2018
a815a3f
First part of P0482 - Establish that char8_t is an integral type, and…
mclow Nov 29, 2018
604afd7
[libcxx] Implement P0318: unwrap_ref_decay and unwrap_reference
ldionne Dec 3, 2018
bf62394
[libcxx] Always enable availability in the lit test suite.
ldionne Dec 4, 2018
caae3ec
[libcxx] Don't depend on availability markup to provide the streams i…
ldionne Dec 6, 2018
8bcb9ca
[libcxx] Mark some tests as failing on macosx 10.14
ldionne Dec 6, 2018
edfdc49
[libcxx] Make return value of array<T, 0>.data() checked only for libc++
ldionne Dec 6, 2018
7ea279f
[libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
ldionne Dec 6, 2018
5b19b0b
[libcxx] Add checks for unique value of array<T, 0>.begin() and array…
ldionne Dec 6, 2018
55a56d2
[libcxx] Fix incorrect XFAILs for chrono tests on old macos deploymen…
ldionne Dec 6, 2018
21e47d9
[libcxx] Always convert 'use_system_cxx_lib' to an absolute path
ldionne Dec 6, 2018
5fe0a6a
[libc++] Improve diagnostics for non-const comparators and hashers in…
ldionne Dec 6, 2018
a796feb
[libcxx] Add paranoid cast-to-void in comma operator
ldionne Dec 7, 2018
f01e82f
[libcxx] Remove the availability_markup LIT feature
ldionne Dec 7, 2018
49ad9aa
Update a couple of vector<bool> tests that were testing libc++-specif…
mclow Dec 7, 2018
5b31832
Refactor std::function to more easily support alternative implementat…
EricWF Dec 10, 2018
c1935f1
Add a version of std::function that includes a few optimizations in A…
EricWF Dec 11, 2018
adde8ae
[pair] Mark constructors as conditionally noexcept
ldionne Dec 11, 2018
21a8669
Revert "[pair] Mark constructors as conditionally noexcept"
ldionne Dec 11, 2018
9648447
Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/…
mclow Dec 11, 2018
544d1ba
Fix problems with char8_t stuff on compilers that don't support char8…
mclow Dec 11, 2018
31355b0
[libcxx] Fix test on compilers that do not support char8_t yet
ldionne Dec 11, 2018
bca4d67
[pair] Mark constructors as conditionally noexcept
ldionne Dec 11, 2018
649e69d
[libcxx] Fix test failure on GCC 4.9
ldionne Dec 11, 2018
2fa05e6
[NFC] Fix incorrect (but unreachable) LIT error message
ldionne Dec 11, 2018
3b06e97
[libcxx] Remove the no_default_flags LIT configuration
ldionne Dec 11, 2018
682614c
[libcxx] Only enable the availability LIT feature when we're testing …
ldionne Dec 11, 2018
2d13462
[test] Permit NetBSD in filesystem_dynamic_test_helper.py
mgorny Dec 11, 2018
413329e
[test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD
mgorny Dec 12, 2018
13d947c
[test] [filesystems] NetBSD can do symlink permissions too
mgorny Dec 12, 2018
f0c3a12
[test] [depr.c.headers] XFAIL uchar.h on NetBSD
mgorny Dec 12, 2018
f77ee9b
[libcxx] Add assertion in deque::pop_back when popping from an empty …
ldionne Dec 12, 2018
d3f2d5e
[libcxx] Fix pop_back() tests to make sure they don't always just pass
ldionne Dec 13, 2018
e713cc0
[libc++] Fix _LIBCPP_EXPORTED_FROM_ABI when visibility annotations ar…
tanderson-google Dec 13, 2018
114125f
Update google benchmark version
EricWF Dec 14, 2018
ea9230c
Update google benchmark again
EricWF Dec 14, 2018
7213ea7
[libcxx] Make sure use_system_cxx_lib does not override cxx_runtime_r…
ldionne Dec 14, 2018
f927635
Implement P1209 - Adopt Consistent Container Erasure from Library Fun…
mclow Dec 14, 2018
09e6741
When resolving a merge conflict, I put something inside an #ifdef. Fi…
mclow Dec 14, 2018
03017b2
[libcxx] Mark some tests as still failing on macosx10.14
ldionne Dec 14, 2018
01fac08
Tolerate Clangs new static_assert messages
EricWF Dec 14, 2018
c9296e7
Rework docker setup to make it easier to work around bugs on buildbots
EricWF Dec 15, 2018
9468ef1
Fix bug in buildbot start script
EricWF Dec 15, 2018
48df810
Try 2: Fix bug in buildbot start script
EricWF Dec 15, 2018
8c36703
Fix static assert diagnostic checks in i386
EricWF Dec 15, 2018
dc700f1
[regex] Use distinct __regex_word on NetBSD
mgorny Dec 16, 2018
36feb1b
[test] [ctime] Ignore -Wformat-zero-length warnings
mgorny Dec 16, 2018
a443a00
[test] [support] Use socket()+bind() to create unix sockets portably
mgorny Dec 16, 2018
8f7fa38
[libcxx] Speeding up partition_point/lower_bound/upper_bound
ldionne Dec 17, 2018
2d0643a
Expect Clang diagnostics in std::launder test
EricWF Dec 17, 2018
50f14e2
Unbreak green dragon bots w/o __builtin_launder
EricWF Dec 17, 2018
c88aa7f
[test] [re.traits] Remove asserts failing due to invalid UTF-8
mgorny Dec 17, 2018
4b8645f
[test] Add target_info for NetBSD, and XFAIL some of locale tests
mgorny Dec 17, 2018
dfa283e
Fix FP comparisons when SSE isn't available
EricWF Dec 17, 2018
ae5d5c8
[libcxx][NFC] Properly indent nested #ifdefs and #defines
ldionne Dec 17, 2018
3d4bcc1
[libcxx] Properly mark aligned allocation macro test as XFAIL on OS X
ldionne Dec 18, 2018
b8811ad
[libcxx] Handle AppleClang 9 and 10 in XFAILs for aligned allocation …
ldionne Dec 18, 2018
6ad9536
[libcxx] Remove XFAILs for older macOS versions
ldionne Dec 18, 2018
3af9c5f
Rework the C strings tests to use ASSERT_SAME_TYPE. NFC there. Also c…
mclow Dec 18, 2018
9ff404d
Portability fix: add missing includes and static_casts. Reviewed as h…
mclow Dec 18, 2018
ff04a56
Add missing include to test. NFC
mclow Dec 19, 2018
1e048a3
Work around GCC 9.0 regression
EricWF Dec 19, 2018
d805c87
[libcxx] Use custom allocator's `construct` in C++03 when available.
vsapsai Dec 19, 2018
8daffda
[libcxx] Fix order checking in unordered_multimap tests.
ldionne Dec 20, 2018
545d0b9
Mark two filesystem LWG issues as complete - nothing to do
EricWF Dec 21, 2018
a203728
Implement LWG 2936: Path comparison is defined in terms of the generi…
EricWF Dec 21, 2018
874280d
Implement LWG 3145: file_clock breaks ABI for C++17 implementations.
EricWF Dec 21, 2018
3cf34d1
Implement LWG 3065: Make path operators friends.
EricWF Dec 21, 2018
da05bdc
Implement LWG 3096: path::lexically_relative is confused by trailing …
EricWF Dec 21, 2018
fdb4802
Fix copy paste error in file_clock tests
EricWF Dec 21, 2018
1c5aabc
Don't forward declare _FilesystemClock in C++03
EricWF Dec 21, 2018
5f14fb5
Fix test case breakages caused by lexically_relative change
EricWF Dec 21, 2018
5de5c11
[NFC] Fix typo in comment
ldionne Dec 21, 2018
8c8f0e1
[libcxx] Remove unused macro _LIBCPP_HAS_UNIQUE_TYPEINFO
ldionne Dec 21, 2018
51895bf
More tolerance for flaky tests in libc++ on NetBSD
krytarowski Dec 30, 2018
7de83dc
De-tab a couple tests. NFC
mclow Jan 3, 2019
f2b22f5
[libcxx] Optimize vectors construction of trivial types from an itera…
vsapsai Jan 8, 2019
da512d0
[libc++] Avoid UB in the no-exceptions mode in a few places
ldionne Feb 12, 2019
1794f8f
Re-branch stable from swift-5.1-branch
shahmishal Feb 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
125 changes: 91 additions & 34 deletions CMakeLists.txt
Expand Up @@ -27,7 +27,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(libcxx CXX C)

set(PACKAGE_NAME libcxx)
set(PACKAGE_VERSION 7.0.0)
set(PACKAGE_VERSION 8.0.0svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")

Expand All @@ -50,9 +50,14 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
"${PROJECT_NAME} requires an out of source build. Please create a separate
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
message(STATUS "Configuring for clang-cl")
set(LIBCXX_TARGETING_CLANG_CL ON)
endif()

if (MSVC)
set(LIBCXX_TARGETING_MSVC ON)
message(STATUS "Configuring for MSVC")
else()
set(LIBCXX_TARGETING_MSVC OFF)
endif()
Expand All @@ -77,7 +82,12 @@ option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++fs.a"
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})

# Benchmark options -----------------------------------------------------------
option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependancies" ON)
option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependencies" ON)

set(LIBCXX_BENCHMARK_TEST_ARGS_DEFAULT --benchmark_min_time=0.01)
set(LIBCXX_BENCHMARK_TEST_ARGS "${LIBCXX_BENCHMARK_TEST_ARGS_DEFAULT}" CACHE STRING
"Arguments to pass when running the benchmarks using check-cxx-benchmarks")

set(LIBCXX_BENCHMARK_NATIVE_STDLIB "" CACHE STRING
"Build the benchmarks against the specified native STL.
The value must be one of libc++/libstdc++")
Expand Down Expand Up @@ -111,12 +121,8 @@ cmake_dependent_option(LIBCXX_INSTALL_FILESYSTEM_LIBRARY
"Install libc++fs.a" ON
"LIBCXX_ENABLE_FILESYSTEM;LIBCXX_INSTALL_LIBRARY" OFF)

if (FUCHSIA)
set(DEFAULT_ABI_VERSION 2)
else()
set(DEFAULT_ABI_VERSION 1)
endif()
set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VERSION} CACHE STRING "ABI version of libc++.")
set(LIBCXX_ABI_VERSION "1" CACHE STRING "ABI version of libc++. Can be either 1 or 2, where 2 is currently not stable. Defaults to 1.")
set(LIBCXX_ABI_NAMESPACE "" CACHE STRING "The inline ABI namespace used by libc++. It defaults to __n where `n` is the current ABI version.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.")
option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.")
Expand Down Expand Up @@ -503,14 +509,16 @@ remove_flags(-Wno-pedantic -pedantic-errors -pedantic)

# Required flags ==============================================================
set(LIBCXX_STANDARD_VER c++11 CACHE INTERNAL "internal option to change build dialect")
if (LIBCXX_HAS_MUSL_LIBC)
if (LIBCXX_HAS_MUSL_LIBC OR LIBCXX_TARGETING_CLANG_CL)
# musl's pthread implementations uses volatile types in their structs which is
# not a constexpr in C++11 but is in C++14, so we use C++14 with musl.
set(LIBCXX_STANDARD_VER c++14 CACHE INTERNAL "internal option to change build dialect")
endif()
add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})
add_compile_flags_if_supported("/std:${LIBCXX_STANDARD_VER}")
mangle_name("LIBCXX_SUPPORTS_STD_EQ_${LIBCXX_STANDARD_VER}_FLAG" SUPPORTS_DIALECT_NAME)
if(NOT ${SUPPORTS_DIALECT_NAME})
mangle_name("LIBCXX_SUPPORTS_STD_COLON_${LIBCXX_STANDARD_VER}_FLAG" SUPPORTS_DIALECT_NAME_MSVC)
if(NOT ${SUPPORTS_DIALECT_NAME} AND NOT ${SUPPORTS_DIALECT_NAME_MSVC})
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
message(FATAL_ERROR "C++11 or greater is required but the compiler does not support ${LIBCXX_STANDARD_VER}")
endif()
Expand Down Expand Up @@ -545,11 +553,29 @@ add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
add_compile_flags_if_supported(
-Wall -Wextra -W -Wwrite-strings
-Wno-unused-parameter -Wno-long-long
-Werror=return-type)
-Werror=return-type -Wextra-semi)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_flags_if_supported(
-Wno-user-defined-literals
-Wno-covered-switch-default)
if (LIBCXX_TARGETING_CLANG_CL)
add_compile_flags_if_supported(
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-c++11-compat
-Wno-undef
-Wno-reserved-id-macro
-Wno-gnu-include-next
-Wno-gcc-compat # For ignoring "'diagnose_if' is a clang extension" warnings
-Wno-zero-as-null-pointer-constant # FIXME: Remove this and fix all occurrences.
-Wno-deprecated-dynamic-exception-spec # For auto_ptr
-Wno-sign-conversion
-Wno-old-style-cast
-Wno-deprecated # FIXME: Remove this and fix all occurrences.
-Wno-shift-sign-overflow # FIXME: Why do we need this with clang-cl but not clang?
-Wno-double-promotion # FIXME: remove me
)
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
add_compile_flags_if_supported(
-Wno-literal-suffix
Expand Down Expand Up @@ -622,44 +648,63 @@ endif()

# Sanitizer flags =============================================================

# Configure for sanitizers. If LIBCXX_STANDALONE_BUILD then we have to do
# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.
if (LIBCXX_STANDALONE_BUILD)
set(LLVM_USE_SANITIZER "" CACHE STRING
"Define the sanitizer used to build the library and tests")
function(get_sanitizer_flags OUT_VAR USE_SANITIZER)
set(SANITIZER_FLAGS)
set(USE_SANITIZER "${USE_SANITIZER}")
# NOTE: LLVM_USE_SANITIZER checks for a UNIX like system instead of MSVC.
# But we don't have LLVM_ON_UNIX so checking for MSVC is the best we can do.
if (LLVM_USE_SANITIZER AND NOT MSVC)
add_flags_if_supported("-fno-omit-frame-pointer")
add_flags_if_supported("-gline-tables-only")
if (USE_SANITIZER AND NOT MSVC)
append_flags_if_supported(SANITIZER_FLAGS "-fno-omit-frame-pointer")
append_flags_if_supported(SANITIZER_FLAGS "-gline-tables-only")

if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND
NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
add_flags_if_supported("-gline-tables-only")
NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
append_flags_if_supported(SANITIZER_FLAGS "-gline-tables-only")
endif()
if (LLVM_USE_SANITIZER STREQUAL "Address")
add_flags("-fsanitize=address")
elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
add_flags(-fsanitize=memory)
if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
add_flags("-fsanitize-memory-track-origins")
if (USE_SANITIZER STREQUAL "Address")
append_flags(SANITIZER_FLAGS "-fsanitize=address")
elseif (USE_SANITIZER MATCHES "Memory(WithOrigins)?")
append_flags(SANITIZER_FLAGS -fsanitize=memory)
if (USE_SANITIZER STREQUAL "MemoryWithOrigins")
append_flags(SANITIZER_FLAGS "-fsanitize-memory-track-origins")
endif()
elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
add_flags("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all")
elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
add_flags(-fsanitize=thread)
elseif (USE_SANITIZER STREQUAL "Undefined")
append_flags(SANITIZER_FLAGS "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all")
elseif (USE_SANITIZER STREQUAL "Thread")
append_flags(SANITIZER_FLAGS -fsanitize=thread)
else()
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${USE_SANITIZER}")
endif()
elseif(LLVM_USE_SANITIZER AND MSVC)
elseif(USE_SANITIZER AND MSVC)
message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
endif()
set(${OUT_VAR} "${SANITIZER_FLAGS}" PARENT_SCOPE)
endfunction()

# Configure for sanitizers. If LIBCXX_STANDALONE_BUILD then we have to do
# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.
if (LIBCXX_STANDALONE_BUILD)
set(LLVM_USE_SANITIZER "" CACHE STRING
"Define the sanitizer used to build the library and tests")
endif()
get_sanitizer_flags(SANITIZER_FLAGS "${LLVM_USE_SANITIZER}")
if (LIBCXX_STANDALONE_BUILD AND SANITIZER_FLAGS)
add_flags(${SANITIZER_FLAGS})
endif()

# Configuration file flags =====================================================
if (NOT LIBCXX_ABI_VERSION EQUAL DEFAULT_ABI_VERSION)
if (NOT LIBCXX_ABI_VERSION EQUAL 1)
config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
endif()
if (NOT LIBCXX_ABI_NAMESPACE STREQUAL "")
if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*")
message(WARNING "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
endif()
if (LIBCXX_ABI_NAMESPACE MATCHES "__[0-9]+$")
message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE '${LIBCXX_ABI_NAMESPACE}' is reserved for use by libc++.")
endif()
config_define(${LIBCXX_ABI_NAMESPACE} _LIBCPP_ABI_NAMESPACE)
endif()
config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM)
config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT)
Expand Down Expand Up @@ -726,6 +771,18 @@ include_directories(include)
add_subdirectory(include)
add_subdirectory(lib)

set(LIBCXX_TEST_DEPS "")

if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
list(APPEND LIBCXX_TEST_DEPS cxx_experimental)
endif()
if (LIBCXX_ENABLE_FILESYSTEM)
list(APPEND LIBCXX_TEST_DEPS cxx_filesystem)
endif()

if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
list(APPEND LIBCXX_TEST_DEPS cxx_external_threads)
endif()

if (LIBCXX_INCLUDE_BENCHMARKS)
add_subdirectory(benchmarks)
Expand Down
2 changes: 1 addition & 1 deletion appveyor-reqs-install.cmd
Expand Up @@ -9,7 +9,7 @@ cd C:\projects\deps
:: Setup Compiler
::###########################################################################
if NOT EXIST llvm-installer.exe (
appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r325576-win32.exe -FileName llvm-installer.exe
appveyor DownloadFile https://prereleases.llvm.org/win-snapshots/LLVM-8.0.0-r345380-win32.exe -FileName llvm-installer.exe
)
if "%CLANG_VERSION%"=="ToT" (
START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM"
Expand Down
8 changes: 0 additions & 8 deletions appveyor.yml
Expand Up @@ -18,14 +18,6 @@ environment:
GENERATOR: Ninja
MAKE_PROGRAM: ninja
APPVEYOR_SAVE_CACHE_ON_ERROR: true
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
CLANG_VERSION: 4
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
MSVC_SETUP_ARG: x86_amd64
GENERATOR: Ninja
MAKE_PROGRAM: ninja
APPVEYOR_SAVE_CACHE_ON_ERROR: true
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
MINGW_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
GENERATOR: MinGW Makefiles
Expand Down
81 changes: 74 additions & 7 deletions benchmarks/CMakeLists.txt
Expand Up @@ -11,17 +11,21 @@ set(BENCHMARK_LIBCXX_COMPILE_FLAGS
-isystem ${LIBCXX_SOURCE_DIR}/include
-L${LIBCXX_LIBRARY_DIR}
-Wl,-rpath,${LIBCXX_LIBRARY_DIR}
${SANITIZER_FLAGS}
)
if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS
-L${LIBCXX_CXX_ABI_LIBRARY_PATH}
-Wl,-rpath,${LIBCXX_CXX_ABI_LIBRARY_PATH})
endif()
if (LIBCXX_NEEDS_SITE_CONFIG)
list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS -include "${LIBCXX_BINARY_DIR}/__config_site")
endif()
split_list(BENCHMARK_LIBCXX_COMPILE_FLAGS)

ExternalProject_Add(google-benchmark-libcxx
EXCLUDE_FROM_ALL ON
DEPENDS cxx
DEPENDS cxx cxx-headers
PREFIX benchmark-libcxx
SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx
Expand Down Expand Up @@ -67,20 +71,38 @@ add_custom_target(cxx-benchmarks)
set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)

check_flag_supported("-std=c++17")
mangle_name("LIBCXX_SUPPORTS_STD_EQ_c++17_FLAG" BENCHMARK_SUPPORTS_STD_CXX17_FLAG)
if (${BENCHMARK_SUPPORTS_STD_CXX17_FLAG})
set(BENCHMARK_DIALECT_FLAG "-std=c++17")
else()
# If the compiler doesn't support -std=c++17, attempt to fall back to -std=c++1z while still
# requiring C++17 language features.
set(BENCHMARK_DIALECT_FLAG "-std=c++1z")
endif()

set(BENCHMARK_TEST_COMPILE_FLAGS
-std=c++17 -O2
${BENCHMARK_DIALECT_FLAG} -O2
-I${BENCHMARK_LIBCXX_INSTALL}/include
-I${LIBCXX_SOURCE_DIR}/test/support
)
set(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS
-nostdinc++
-isystem ${LIBCXX_SOURCE_DIR}/include
${BENCHMARK_TEST_COMPILE_FLAGS}
${SANITIZER_FLAGS}
-Wno-user-defined-literals
)
if (LIBCXX_NEEDS_SITE_CONFIG)
list(APPEND BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS
-include "${LIBCXX_BINARY_DIR}/__config_site")
endif()

set(BENCHMARK_TEST_LIBCXX_LINK_FLAGS
-nodefaultlibs
-L${BENCHMARK_LIBCXX_INSTALL}/lib/
${SANITIZER_FLAGS}
)
set(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS
${BENCHMARK_NATIVE_TARGET_FLAGS}
Expand All @@ -95,10 +117,25 @@ split_list(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS)
split_list(BENCHMARK_TEST_LIBCXX_LINK_FLAGS)
split_list(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS)
split_list(BENCHMARK_TEST_NATIVE_LINK_FLAGS)
macro(add_benchmark_test name source_file)

if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
find_library(LIBSTDCXX_FILESYSTEM_TEST stdc++fs
PATHS ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN}
PATH_SUFFIXES lib lib64
DOC "The libstdc++ filesystem library used by the benchmarks"
)
if (NOT "${LIBSTDCXX_FILESYSTEM_TEST}" STREQUAL "LIBSTDCXX_FILESYSTEM_TEST-NOTFOUND")
set(LIBSTDCXX_FILESYSTEM_LIB "stdc++fs")
endif()
endif()

set(libcxx_benchmark_targets)

function(add_benchmark_test name source_file)
set(libcxx_target ${name}_libcxx)
list(APPEND libcxx_benchmark_targets ${libcxx_target})
add_executable(${libcxx_target} EXCLUDE_FROM_ALL ${source_file})
add_dependencies(${libcxx_target} cxx google-benchmark-libcxx)
add_dependencies(${libcxx_target} cxx cxx-headers google-benchmark-libcxx)
add_dependencies(cxx-benchmarks ${libcxx_target})
if (LIBCXX_ENABLE_SHARED)
target_link_libraries(${libcxx_target} cxx_shared)
Expand All @@ -108,23 +145,33 @@ macro(add_benchmark_test name source_file)
if (TARGET cxx_experimental)
target_link_libraries(${libcxx_target} cxx_experimental)
endif()
if (TARGET cxx_filesystem)
target_link_libraries(${libcxx_target} cxx_filesystem)
endif()
target_link_libraries(${libcxx_target} -lbenchmark)
if (LLVM_USE_SANITIZER)
target_link_libraries(${libcxx_target} -ldl)
endif()
set_target_properties(${libcxx_target}
PROPERTIES
OUTPUT_NAME "${name}.libcxx.out"
RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}"
LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}")
if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++" AND NOT DEFINED LIBSTDCXX_FILESYSTEM_LIB
AND "${name}" STREQUAL "filesystem")
return()
endif()
set(native_target ${name}_native)
add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
add_dependencies(${native_target} google-benchmark-native
google-benchmark-libcxx)
target_link_libraries(${native_target} -lbenchmark)
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
target_link_libraries(${native_target} -lstdc++fs)
target_link_libraries(${native_target} ${LIBSTDCXX_FILESYSTEM_LIB})
elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
target_link_libraries(${native_target} -lc++experimental)
target_link_libraries(${native_target} -lc++fs -lc++experimental)
endif()
if (LIBCXX_HAS_PTHREAD_LIB)
target_link_libraries(${native_target} -pthread)
Expand All @@ -138,7 +185,7 @@ macro(add_benchmark_test name source_file)
COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}"
LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}")
endif()
endmacro()
endfunction()


#==============================================================================
Expand All @@ -155,3 +202,23 @@ foreach(test_path ${BENCHMARK_TESTS})
endif()
add_benchmark_test(${test_name} ${test_file})
endforeach()

if (LIBCXX_INCLUDE_TESTS)
include(AddLLVM)

if (NOT DEFINED LIBCXX_TEST_DEPS)
message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined")
endif()

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)

set(BENCHMARK_LIT_ARGS "--show-all --show-xfail --show-unsupported ${LIT_ARGS_DEFAULT}")

add_lit_target(check-cxx-benchmarks
"Running libcxx benchmarks tests"
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS cxx-benchmarks ${LIBCXX_TEST_DEPS}
ARGS ${BENCHMARK_LIT_ARGS})
endif()