summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/language.support/support.runtime/ctime.pass.cpp
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
* Support tests in freestandingJF Bastien2019-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-4/+3
| | | | | | | | | | | | | | | | | | 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
* 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/+14
| | | | | | later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet. llvm-svn: 338419
* Fix warnings in tests.Eric Fiselier2016-06-141-1/+1
| | | | llvm-svn: 272629
* Void cast runtime-unused variables. Patch from STL@microsoft.comEric Fiselier2016-05-021-1/+6
| | | | llvm-svn: 268284
* Fix warnings in test/std/language.supportEric Fiselier2015-07-181-0/+1
| | | | llvm-svn: 242624
* Make support for thread-unsafe C functions optional.Ed Schouten2015-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | One of the aspects of CloudABI is that it aims to help you write code that is thread-safe out of the box. This is very important if you want to write libraries that are easy to reuse. For CloudABI we decided to not provide the thread-unsafe functions. So far this is working out pretty well, as thread-unsafety issues are detected really early on. The following patch adds a knob to libc++, _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable thread-unsafe functions that can easily be avoided in practice. The following functions are not thread-safe: - <clocale>: locale handles should be preferred over setlocale(). - <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over their non-restartable counterparts. - <ctime>: asctime(), ctime(), gmtime() and localtime() are not thread-safe. The first two are also deprecated by POSIX. Differential Revision: http://reviews.llvm.org/D8703 Reviewed by: marshall llvm-svn: 240527
* Move test into test/std subdirectory.Eric Fiselier2014-12-201-0/+40
llvm-svn: 224658
OpenPOWER on IntegriCloud