summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Mark <filesystem> as unavailable on Apple platforms using pragmasLouis Dionne2019-03-203-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Also add the corresponding XFAILs to tests that require filesystem. The approach taken to mark <filesystem> as unavailable in this patch is to mark all the header as unavailable using #pragma clang attribute. Marking each declaration using the attribute is more intrusive and does not provide a lot of value right now because pretty much everything in <filesystem> requires dylib support, often transitively. This is an alternative to https://reviews.llvm.org/D59093. A similar (but partial) patch was already applied in r356558. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59224 llvm-svn: 356616
* Mark <charconv> tests as unsupported for C++11 and C++14 if you're not ↵Marshall Clow2019-03-204-0/+8
| | | | | | testing libc++. Thanks to Louis for the suggestion. llvm-svn: 356602
* Make to_chars/from_chars work back to C++11. This means that we can use them ↵Marshall Clow2019-03-204-4/+4
| | | | | | to implement to_string as well. Reviewed as https://reviews.llvm.org/D59598. llvm-svn: 356585
* [libc++] Mark <filesystem> tests as failing when the dylib doesn't support ↵Louis Dionne2019-03-201-0/+1
| | | | | | | | | | | | filesystem This fixes CI for back-deployment testers on platforms that don't have <filesystem> support in the dylib. This is effectively half of https://reviews.llvm.org/D59224. The other half requires fixes in Clang. llvm-svn: 356558
* [libc++] Flag file_clock test as expected to fail with ASANLouis Dionne2019-03-191-0/+4
| | | | | | | This silences a known issue, as can be seen by looking at similar tests for other clocks, like time.clock.steady/consistency.pass.cpp. llvm-svn: 356528
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-193-9/+0
| | | | | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Unlike the previous attempt (r356500), this doesn't remove all the filesystem tests. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356518
* Revert "[libc++] Build <filesystem> support as part of the dylib"Louis Dionne2019-03-193-0/+9
| | | | | | | | When I applied r356500 (https://reviews.llvm.org/D59152), I somehow deleted all of filesystem's tests. I will revert r356500 and re-apply it properly. llvm-svn: 356505
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-193-9/+0
| | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356500
* [libc++] Enable deprecation warnings by defaultLouis Dionne2019-03-1212-12/+15
| | | | | | | | | | | | | | | | | | | Summary: In r342843, I added deprecation warnings to some facilities that were deprectated in C++14 and C++17. However, those deprecation warnings were not enabled by default. After discussing this on IRC, we had finally gotten consensus to enable those warnings by default, and I'm getting around to doing that only now. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58140 llvm-svn: 355961
* Allow optional to tolerate being used with a nested class.Eric Fiselier2019-03-111-0/+41
| | | | | | | | | | | | | | | When Clang tries to complete a type containing `std::optional` it considers the `in_place_t` constructor with no arguments which checks if the value type is default constructible. If the value type is a nested class type, then this check occurs too early and poisons the is_default_constructible trait. This patch makes optional deduce `in_place_t` so we can prevent this early SFINAE evaluation. Technically this could break people doing weird things with the in_place_t tag, but that seems less important than making the nested class case work. llvm-svn: 355877
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-271-0/+5
| | | | | | | | | | | | | | | Those tests fail when linking against a new dylib but running against macosx10.7. I believe this is caused by a duplicate definition of the RTTI for exception classes in libc++.dylib and libc++abi.dylib, but this matter still needs some investigation. This issue was not caught previously because all the tests always linked against the same dylib used for running (because LIT made it impossible to do otherwise before r349171). rdar://problem/46809586 llvm-svn: 354940
* Implement P1357: Traits for [Un]bounded Arrays; adopted in KonaMarshall Clow2019-02-262-0/+142
| | | | llvm-svn: 354891
* [NFC] Fix incorrect comment in std::function testLouis Dionne2019-02-211-1/+1
| | | | llvm-svn: 354537
* [libc++] Fix XFAILs when exceptions are disabledLouis Dionne2019-02-053-3/+3
| | | | | | | | It turns out that I un-XFAILed too many tests in r353210: some tests actually fail whether exceptions are enabled or not because they use types that are marked as unavailable even when exceptions are disabled. llvm-svn: 353215
* [libc++] Fix XFAILs on macOS when exceptions are disabledLouis Dionne2019-02-0545-45/+45
| | | | | | | | Some tests are marked as failing on platforms where the dylib does not provide the required exception classes. However, when testing with exceptions disabled, those tests shouldn't be marked as failing. llvm-svn: 353210
* [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdefLouis Dionne2019-02-054-26/+8
| | | | | | | | | | | When the whole test only works starting at some version of the Standard, use UNSUPPORTED lit markup instead of #ifdef TEST_STD_VER. This provides more visibility into the test suite. Reviewed as https://reviews.llvm.org/D57704. Thanks to Andrey Maksimov for the patch. llvm-svn: 353206
* [libcxx] Start defining lit features for tests depending on availabilityLouis Dionne2019-02-0545-321/+47
| | | | | | | | | | | | | | | | | This patch removes some vendor-specific availability XFAILs from the test suite. In the future, when a new feature is introduced in the dylib, an availability macro should be created and a matching lit feature should be created. That way, the test suite can XFAIL whenever the implementation lacks the necessary feature instead of being cluttered by vendor-specific annotations. Right now, those vendor-specific annotations are still somewhat cluttering the test suite by being in `config.py`, but at least they are localized. In the future, we could design a way to define those less intrusively or even automatically based on the availability macros that already exist in <__config>. llvm-svn: 353201
* Support tests in freestandingJF Bastien2019-02-041186-1190/+3547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Fix PR40495 - is_invokable_v<void> does not compileEric Fiselier2019-01-292-182/+356
| | | | | | | | | | | The meta-programming that attempted to form the invoke call expression was not in a SFINAE context. This made it a hard error to provide non-referencable types like 'void' or 'void (...) const'. This patch fixes the error by checking the validity of the call expression within a SFINAE context. llvm-svn: 352522
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191190-4760/+3570
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2019-01-162-7/+10
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: ldionne, EricWF Subscribers: jyknight, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 351289
* Change from a to a . Fixes PR#39871.Marshall Clow2019-01-113-8/+8
| | | | llvm-svn: 350972
* Don't use the form '2017y' in tests, since some gcc versions don't allow itMarshall Clow2019-01-112-6/+6
| | | | llvm-svn: 350930
* Implement the 'sys_time' portions of the C++20 calendaring stuff. Reviewed ↵Marshall Clow2019-01-1120-113/+1052
| | | | | | as D56494 llvm-svn: 350929
* [libcxx] Reorganize tests since the application of P0602R4Louis Dionne2019-01-1010-189/+273
| | | | | | | | | | | | | | | | | Summary: P0602R4 makes the special member functions of optional and variant conditionally trivial based on the types in the optional/variant. We already implemented that, but the tests were organized as if this were a non-standard extension. This patch reorganizes the tests in a way that makes more sense since this is not an extension anymore. Reviewers: EricWF, mpark, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54772 llvm-svn: 350884
* [NFC] Normalize some test 'main' signaturesJF Bastien2019-01-094-8/+4
| | | | | | There were 3 tests with 'int main(void)', and 6 with the return type on a different line. I'm about to send a patch for main in tests, and this NFC change is unrelated. llvm-svn: 350770
* Mark two UDL tests as being unsupported with Clang 7Eric Fiselier2019-01-092-2/+2
| | | | llvm-svn: 350739
* De-tab a couple tests. NFCMarshall Clow2019-01-033-6/+6
| | | | llvm-svn: 350330
* Fix copy paste error in file_clock testsEric Fiselier2018-12-211-3/+3
| | | | llvm-svn: 349886
* Implement LWG 3145: file_clock breaks ABI for C++17 implementations.Eric Fiselier2018-12-214-0/+128
| | | | | | | This patch adds std::chrono::file_clock, but without breaking the existing ABI for std::filesystem. llvm-svn: 349883
* [libcxx] Use custom allocator's `construct` in C++03 when available.Volodymyr Sapsai2018-12-191-1/+1
| | | | | | | | | | | | | | | | | Makes libc++ behavior consistent between C++03 and C++11. Can use `decltype` in C++03 because `include/__config` defines a macro when `decltype` is not available. Reviewers: mclow.lists, EricWF, erik.pilkington, ldionne Reviewed By: ldionne Subscribers: dexonsmith, cfe-commits, howard.hinnant, ldionne, christof, jkorous, Quuxplusone Differential Revision: https://reviews.llvm.org/D48753 llvm-svn: 349676
* Portability fix: add missing includes and static_casts. Reviewed as ↵Marshall Clow2018-12-184-0/+4
| | | | | | https://reviews.llvm.org/D55777. Thanks to Andrey Maksimov for the patch. llvm-svn: 349566
* Fix FP comparisons when SSE isn't availableEric Fiselier2018-12-171-1/+2
| | | | llvm-svn: 349387
* [test] [ctime] Ignore -Wformat-zero-length warningsMichal Gorny2018-12-161-0/+4
| | | | | | | | | | | | Explicitly disable the -Wformat-zero-length diagnostic when running ctime tests, since one of the test cases passes zero-length format string to strftime(). When strftime() is appropriately decorated with __attribute__(format, ...), this caused the test to fail because of this warning (e.g. on NetBSD). Differential Revision: https://reviews.llvm.org/D55661 llvm-svn: 349294
* [libcxx] Mark some tests as still failing on macosx10.14Louis Dionne2018-12-142-0/+2
| | | | llvm-svn: 349187
* [pair] Mark constructors as conditionally noexceptLouis Dionne2018-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: std::tuple marks its constructors as noexcept when the corresponding memberwise constructors are noexcept too -- this commit improves std::pair so that it behaves the same. This is a re-application of r348824, which broke the build in C++03 mode because a test was marked as supported in C++03 when it shouldn't be. Note: I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)` constructors because those are non-standard extensions, and supporting them properly is tedious (we have to copy the rvalue-referenceness of the deduced _Tuple&& onto the result of tuple_element). <rdar://problem/29537079> Reviewers: mclow.lists, EricWF Subscribers: christof, llvm-commits Differential Revision: https://reviews.llvm.org/D48669 llvm-svn: 348847
* Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308Marshall Clow2018-12-111-1/+1
| | | | llvm-svn: 348828
* Revert "[pair] Mark constructors as conditionally noexcept"Louis Dionne2018-12-111-3/+2
| | | | | | | This broke the tests on Linux. Reverting until I find out why the tests are broken (tomorrow). llvm-svn: 348825
* [pair] Mark constructors as conditionally noexceptLouis Dionne2018-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: std::tuple marks its constructors as noexcept when the corresponding memberwise constructors are noexcept too -- this commit improves std::pair so that it behaves the same. Note: I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)` constructors because those are non-standard extensions, and supporting them properly is tedious (we have to copy the rvalue-referenceness of the deduced _Tuple&& onto the result of tuple_element). <rdar://problem/29537079> Reviewers: mclow.lists, EricWF Subscribers: christof, llvm-commits Differential Revision: https://reviews.llvm.org/D48669 llvm-svn: 348824
* [libcxx] Remove the availability_markup LIT featureLouis Dionne2018-12-075-35/+35
| | | | | | | It is now equivalent to the 'availability' LIT feature, so there's no reason to keep both. llvm-svn: 348653
* [libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targetsLouis Dionne2018-12-063-9/+12
| | | | | | | | | | | | The tests were marked to fail based on the 'availability' LIT feature. However, those tests should really only be failing when we run them against the dylibs that were deployed on macosx10.7 and macosx10.8, which the deployment target has nothing to do with. This caused the tests to unexpectedly pass when running the tests with deployment target macosx10.{7,8} but running with a recent dylib. llvm-svn: 348520
* [libcxx] Implement P0318: unwrap_ref_decay and unwrap_referenceLouis Dionne2018-12-032-0/+109
| | | | | | | | | | | | | | | | | | Summary: This was voted into C++20 in San Diego. Note that there was a revision D0318R2 which did include unwrap_reference_t, but we mistakingly voted P0318R1 into the C++20 Working Draft (which does not include unwrap_reference_t). This patch implements D0318R2, which is what we'll end up with in the Working Draft once this mistake has been fixed. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54485 llvm-svn: 348138
* First part of P0482 - Establish that char8_t is an integral type, and that ↵Marshall Clow2018-11-291-0/+3
| | | | | | numeric_limits<char8_t> is valid and sane. (second try) llvm-svn: 347930
* Revert commit r347904 because it broke older compilersMarshall Clow2018-11-291-3/+0
| | | | llvm-svn: 347908
* First part of P0482 - Establish that char8_t is an integral type, and that ↵Marshall Clow2018-11-291-0/+3
| | | | | | numeric_limits<char8_t> is valid and sane. llvm-svn: 347904
* Revert "Move internal usages of `alignof`/`__alignof` to use ↵Eric Fiselier2018-11-281-3/+6
| | | | | | | | | | | `_LIBCPP_ALIGNOF`. " This reverts commit 087f065cb0c7463f521a62599884493aaee2ea12. The tests were failing on 32 bit builds, and I don't have time to clean them up right now. I'll recommit tomorrow with fixed tests. llvm-svn: 347816
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2018-11-281-6/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: EricWF Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 347787
* [libcxx] Use clang-verify in the lit test suite even when availability is ↵Louis Dionne2018-11-283-0/+12
| | | | | | enabled llvm-svn: 347780
* [libcxx] Use a type that is always an aggregate in variant's testsLouis Dionne2018-11-263-25/+28
| | | | | | | | | | | | | | | | | | | | | Summary: In PR39232, we noticed that some variant tests started failing in C++2a mode with recent Clangs, because the rules for literal types changed in C++2a. As a result, a temporary fix was checked in (enabling the test only in C++17). This commit is what I believe should be the long term fix: I removed the tests that checked constexpr default-constructibility with a weird type from the tests for index() and valueless_by_exception(), and instead I added tests for those using an obviously literal type in the test for the default constructor. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, arphaman, libcxx-commits, rsmith Differential Revision: https://reviews.llvm.org/D54767 llvm-svn: 347568
* Mark P0771 as complete; we already did this - I just added tests to be sureMarshall Clow2018-11-201-1/+13
| | | | llvm-svn: 347343
OpenPOWER on IntegriCloud