summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/time
Commit message (Collapse)AuthorAgeFilesLines
* Fix _LIBCPP_HAS_ definitions for Android.Dan Albert2019-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Android added quick_exit()/at_quick_exit() in API level 21, aligned_alloc() in API level 28, and timespec_get() in API level 29, but has the other C11 features at all API levels (since they're basically just coming from clang directly). _LIBCPP_HAS_QUICK_EXIT and _LIBCPP_HAS_TIMESPEC_GET already existed, so we can reuse them. (And use _LIBCPP_HAS_TIMESPEC_GET in a few more places where _LIBCPP_HAS_C11_FEATURES has been used as a proxy. This isn't correct for Android.) _LIBCPP_HAS_ALIGNED_ALLOC is added, to cover aligned_alloc() (obviously). Add a missing std:: before aligned_alloc in a cstdlib test, and remove a couple of !defined(_WIN32)s now that we're explicitly testing TEST_HAS_ALIGNED_ALLOC rather than TEST_HAS_C11_FEATURES. Reviewers: danalbert, EricWF, mclow.lists Reviewed By: danalbert Subscribers: srhines, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D69929
* [libc++] [chrono] Fix year_month_weekday::ok() implementation.Marek Kurdej2019-11-151-3/+23
| | | | | | | | | | | | Reviewers: ldionne, EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D70282
* [libcxx][NFC] Strip trailing whitespace, fix typo.Stephan T. Lavavej2019-10-234-5/+5
|
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-2323-53/+53
|
* [libc++][NFC] Remove excess trailing newlines from most filesCasey Carter2019-10-231-1/+0
| | | | Testing git commit access.
* [libcxx][test][NFC] Fix comment typos.Stephan T. Lavavej2019-10-221-1/+1
| | | | (Testing git commit access.)
* [libc++] Disable <chrono> ""d and ""y literal tests on AppleClang 10.0.0Louis Dionne2019-08-202-0/+2
| | | | | | | | In r368882, I enabled those tests for all AppleClang's above version 9. However, it turns out that the feature is only supported starting with AppleClang 10.0.1, not AppleClang 10.0.0. This commit fixes that hole. llvm-svn: 369409
* [libc++] Mark <chrono> test as unsupported on AppleClang 9Louis Dionne2019-08-141-0/+1
| | | | llvm-svn: 368914
* [libc++] Enable <chrono> ""d and ""y literals for AppleClang 10 and upLouis Dionne2019-08-142-2/+2
| | | | | | AppleClang supports those literals starting in version 10.0.1. llvm-svn: 368882
* [libc++] Mark two <chrono> tests as unsupported on AppleClang 11Louis Dionne2019-08-132-2/+2
| | | | | | | The operator""y and operator""d will eventually be supported by AppleClang, but no released version supports them at the moment. llvm-svn: 368749
* Implement hh_mm_ss from P1466R3. Reviewed as https://reviews.llvm.org/D65365.Marshall Clow2019-08-0815-0/+782
| | | | llvm-svn: 368299
* Fix a bug in std::chrono::abs where it would fail when the duration's period ↵Marshall Clow2019-07-261-0/+6
| | | | | | had not been reduced.s llvm-svn: 367120
* Implement change #4 of P1466: Change weekday to accept both 0 and 7 as ↵Marshall Clow2019-07-2519-60/+155
| | | | | | Sunday. Add accessors 'c_encoding' and 'iso_encoding' to provide different interpretations of the weekday. Remove 'operator unsigned' llvm-svn: 366981
* Add tests for LWG 3206. NFCMarshall Clow2019-06-171-0/+23
| | | | llvm-svn: 363589
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-3136-0/+72
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks ↵Marshall Clow2019-04-018-2/+127
| | | | | | to Zulan for the report, and Howard for the direction of the fix. llvm-svn: 357410
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-286-15/+4
| | | | | | | Some tests #include <iostream> but they don't use anything from the header. Those are probably artifacts of when the tests were developped. llvm-svn: 357181
* [libc++] Remove too-stringent XFAILs for file_clock testsLouis Dionne2019-03-213-4/+0
| | | | | | | Those tests actually pass because we don't use anything that's marked as unavailable. llvm-svn: 356719
* [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
* [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
* Support tests in freestandingJF Bastien2019-02-04299-299/+893
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-19302-1208/+906
| | | | | | | | | | | | | | | | | | 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
* 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
* 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
* 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] 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
* Get tests compiling with -Wunused-local-typedefEric Fiselier2018-11-1527-34/+0
| | | | llvm-svn: 346914
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-11-14117-375/+374
| | | | llvm-svn: 346826
* Implement P0972R0: <chrono> zero(), min(), and max() should be noexcept. ↵Marshall Clow2018-11-138-8/+57
| | | | | | Reviewed as https://reviews.llvm.org/D53828 llvm-svn: 346766
* Adjust unsupported C++ versions in some testsMikhail Maltsev2018-10-24174-174/+174
| | | | | | | | | | | | | | | | | | | | Summary: Some tests (mainly the new C++20 calendar library) fail when libc++ is tested with '--param=std=c++98'. The failures happen because the tests actually don't support C++98, but don't mention C++98 in the 'UNSUPPORTED:' line. This change fixes the issue. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: arphaman, michaelplatings, libcxx-commits Differential Revision: https://reviews.llvm.org/D53640 llvm-svn: 345148
* [libcxx] Mark chrono literal unit tests as being unsupported on AppleClang 10Louis Dionne2018-10-174-4/+4
| | | | llvm-svn: 344661
* Recommit <chrono> changes with a couple xtra tests marked to fail on apple's ↵Marshall Clow2018-10-16178-1/+9864
| | | | | | clang. Reviewed as D51762 llvm-svn: 344627
* Revert r344529 "Implement the first part of the calendar support for C++20"Artem Dergachev2018-10-16179-9921/+0
| | | | | | | | | | Revert r344535 "Wrap up the new chrono literals in an #ifdef..." Revert r344546 "Mark a couple of test cases as 'C++17-only'..." Some of the buildbot failures were masked by another error, and this one was probably missed. llvm-svn: 344580
* Wrap up the new chrono literals in an #ifdef so that old versions of clang ↵Marshall Clow2018-10-152-0/+4
| | | | | | don't complain. I'm looking at you, clang 5.0.1 llvm-svn: 344535
* Implement the first part of the calendar support for C++20. This is still ↵Marshall Clow2018-10-15179-0/+9917
| | | | | | incomplete; there will be more patches coming. Reviewed as D51762 llvm-svn: 344529
* Last week, someone noted that a couple of the time_point member functions ↵Marshall Clow2018-08-292-0/+40
| | | | | | were not constexpr. I looked, and they were right. They were made constexpr in p0505, so I looked at all the other bits in that paper to make sure that I didn't miss anything else. There were a couple methods in the synopsis that should have been marked constexpr, but the code was correct. llvm-svn: 340992
* Selectively import timespec_get into namespace std, since some C libraries ↵Marshall Clow2018-08-151-1/+1
| | | | | | don't have it. Reviewed as https://reviews.llvm.org/D50799 llvm-svn: 339816
* import timespec and timespec_get into namespace std if we're under c++17 or ↵Marshall Clow2018-07-311-0/+16
| | | | | | later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet. llvm-svn: 338419
* [libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej2017-08-113-6/+6
| | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
* [libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-293-3/+3
| | | | | | | | This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-043-14/+15
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
OpenPOWER on IntegriCloud