summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Selectively import timespec_get into namespace std, since some C libraries ↵Marshall Clow2018-08-153-2/+9
| | | | | | don't have it. Reviewed as https://reviews.llvm.org/D50799 llvm-svn: 339816
* Mark the at_exit and at_quick_exit tests as unsupported under C++98 an 03, ↵Marshall Clow2018-08-153-2/+3
| | | | | | since those calls were introduced in C++11. They're already guarded by an ifdef in the code, so this is a 'belt-and-suspenders' change. llvm-svn: 339804
* For FreeBSD, don't define _M in nasty_macros.hppDimitry Andric2018-08-151-0/+4
| | | | | | | | | | Because FreeBSD uses _M in its <sys/types.h>, and it is hard to avoid including that header, only define _M to NASTY_MACRO for other operating systems. This fixes almost 2000 unexpected test failures. Discussed with Eric Fiselier. llvm-svn: 339794
* [libcxx] Fix XFAILs for aligned allocation tests on older OSX versionsLouis Dionne2018-08-1516-102/+193
| | | | | | | | | | | | | | | | | Summary: Since r338934, Clang emits an error when aligned allocation functions are used in conjunction with a system libc++ dylib that does not support those functions. This causes some tests to fail when testing against older libc++ dylibs. This commit marks those tests as UNSUPPORTED, and also documents the various reasons for the tests being unsupported. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF Differential Revision: https://reviews.llvm.org/D50341 llvm-svn: 339743
* [libc++] Disable failing C11 feature tests for <cfloat> and <float.h>Louis Dionne2018-08-152-6/+6
| | | | | | | | | | | | | | Summary: Those tests are breaking the test bots. A Bugzilla has been filed to make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572 Reviewers: mclow.lists, EricWF Subscribers: krytarowski, christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50748 llvm-svn: 339742
* [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURESLouis Dionne2018-08-141-1/+1
| | | | | | | | | | | | | | Summary: The macro was not defined in C++11 mode when it should have been, at least according to how _LIBCPP_HAS_C11_FEATURES is defined. Reviewers: mclow.lists, EricWF, jfb, dexonsmith Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50719 llvm-svn: 339702
* [libc++] Add missing #include in C11 features testsLouis Dionne2018-08-143-0/+7
| | | | | | | | | | | | | | | | | | Summary: These #includes are quite important, since otherwise any #if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) checks are always false, and so we don't actually test for C11 support in the standard library. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50674 llvm-svn: 339675
* [libcxx] Mark charconv tests as failing for previous libcxx versions.Volodymyr Sapsai2018-08-102-0/+18
| | | | | | | | | | | | | | | <charconv> was added in r338479. Previous libcxx versions don't have this functionality and corresponding tests should be failing. Reviewers: mclow.lists, ldionne, EricWF Reviewed By: ldionne Subscribers: christof, dexonsmith, lichray, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D50543 llvm-svn: 339451
* [libc++] Enable aligned allocation based on feature test macro, irrespective ↵Louis Dionne2018-08-101-0/+25
| | | | | | | | | | | | | | | | | | | | | of standard Summary: The current code enables aligned allocation functions when compiling in C++17 and later. This is a problem because aligned allocation functions might not be supported on the target platform, which leads to an error at link time. Since r338934, Clang knows not to define __cpp_aligned_new when it's not available on the target platform -- this commit takes advantage of that to only use aligned allocation functions when they are available. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, EricWF, mclow.lists Differential Revision: https://reviews.llvm.org/D50344 llvm-svn: 339431
* [libcxx] [test] Avoid -Wunused-local-typedef in node_handle.pass.cpp.Billy Robert O'Neal III2018-08-081-1/+3
| | | | llvm-svn: 339218
* [libcxx] [test] Allow a standard library that implements LWG 1203 in ↵Billy Robert O'Neal III2018-08-081-1/+1
| | | | | | | | istream.rvalue/rvalue.pass.cpp (Still pending review at https://reviews.llvm.org/D47400 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339214
* [libcxx] [test] Remove nonportable locale assumption in ↵Billy Robert O'Neal III2018-08-081-3/+3
| | | | | | | | | | basic.ios.members/narrow.pass.cpp I'm not sure if libcxx is asserting UTF-8 here; but on Windows the full char value is always passed through in its entirety, since the default codepage is something like Windows-1252. The replacement character is only used for non-chars there; and that should be a more portable test everywhere. (Still pending review at https://reviews.llvm.org/D47395 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339213
* [libcxx] [test] Remove asserts that <cstddef> and <stdexcept> are included ↵Billy Robert O'Neal III2018-08-081-10/+1
| | | | | | | | by <bitset> Reviewed as https://reviews.llvm.org/D50421 llvm-svn: 339212
* [libcxx] [test] Add missing <stdexcept> in several tests.Billy Robert O'Neal III2018-08-0817-0/+17
| | | | | | Reviewed as https://reviews.llvm.org/D50420 llvm-svn: 339209
* Mark LWG#2260 as complete. We already did the right thing, so I just added ↵Marshall Clow2018-08-032-0/+2
| | | | | | tests to ensure that we continue to DTRT. llvm-svn: 338936
* Make my new test harness work w/c++03Marshall Clow2018-08-031-2/+2
| | | | llvm-svn: 338803
* Update the changes to the array tests (that I committed yesterday) to use ↵Marshall Clow2018-08-031-55/+8
| | | | | | the test_comparison routines that I committed last week. NFC. llvm-svn: 338797
* Implement P1023: constexpr comparison operators for std::arrayMarshall Clow2018-08-021-0/+46
| | | | llvm-svn: 338668
* Implement P0887: The identity metafunctionMarshall Clow2018-08-021-0/+40
| | | | llvm-svn: 338666
* [libc++] Fix build failures after merging <charconv>Zhihao Yuan2018-08-012-1/+2
| | | | | | | | | | | | | | Summary: - fix a stupid unit test typo - add <charconv> symbols to Linux abilist Reviewers: EricWF Subscribers: christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D50130 llvm-svn: 338486
* [libc++][C++17] Elementary string conversions for integral typesZhihao Yuan2018-08-016-0/+554
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Major QoI considerations: - The facility is backported to C++14, same as libstdc++. - Efforts have been made to minimize the header dependencies. - The design is friendly to the uses of MSVC intrinsics (`__emulu`, `_umul128`, `_BitScanForward`, `_BitScanForward64`) but not implemented; future contributions are welcome. Thanks to Milo Yip for contributing the implementation of `__u64toa` and `__u32toa`. References: https://wg21.link/p0067r5 https://wg21.link/p0682r1 Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: ldionne, Quuxplusone, christof, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41458 llvm-svn: 338479
* First half of C++17's splicing maps and setsErik Pilkington2018-08-0134-2/+2382
| | | | | | | | | | | | | This commit adds a node handle type, (located in __node_handle), and adds extract() and insert() members to all map and set types, as well as their implementations in __tree and __hash_table. The second half of this feature is adding merge() members, which splice nodes in bulk from one container into another. This will be committed in a follow-up. Differential revision: https://reviews.llvm.org/D46845 llvm-svn: 338472
* Final bit of P0063 - make sure that aligned_alloc is available when the ↵Marshall Clow2018-07-312-0/+20
| | | | | | underlying C library supports it llvm-svn: 338457
* Test for the presence of a bunch of new macros for c++17. These macros come ↵Marshall Clow2018-07-312-0/+84
| | | | | | from C11. Part of P0063 llvm-svn: 338454
* import timespec and timespec_get into namespace std if we're under c++17 or ↵Marshall Clow2018-07-312-0/+30
| | | | | | later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet. llvm-svn: 338419
* Introduce a new test macro TEST_HAS_C11_FEATURES which is set when the ↵Marshall Clow2018-07-312-10/+66
| | | | | | underlying C library has C11 features. In C++17, we use those features. <__config> defines a similar macro, _LIBCPP_HAS_C11_FEATURES, but we don't want to use that in the library-independent parts of the tests, so define the new one. Also add a libc++-specific test to make sure the two stay in sync. llvm-svn: 338411
* [libcxx] fix `>> 42` UB in <experimental/simd>Tim Shen2018-07-301-1/+1
| | | | llvm-svn: 338325
* Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, ↵Tim Shen2018-07-3015-397/+1137
| | | | | | | | constructors, copy_from and copy_to." ...with proper guarding #ifdefs for unsupported C++11. llvm-svn: 338318
* Revert "[libcxx] implement <simd> ABI for Clang/GCC vector extension, ↵Tim Shen2018-07-3015-1137/+397
| | | | | | | | constructors, copy_from and copy_to." This reverts commit r338309. llvm-svn: 338316
* [libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, ↵Tim Shen2018-07-3015-397/+1137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | copy_from and copy_to. Summary: This patch adds a new macro _LIBCPP_HAS_NO_VECTOR_EXTENSION for detecting whether a vector extension (\_\_attribute\_\_((vector_size(num_bytes)))) is available. On the top of that, this patch implements the following API: * all constructors * operator[] * copy_from * copy_to It also defines simd_abi::native to use vector extension, if available. In GCC and Clang, certain values with vector extension are passed by registers, instead of memory. Based on D41148. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits, MaskRay, lichray, sanjoy Differential Revision: https://reviews.llvm.org/D41376 llvm-svn: 338309
* Add libc++fs to the test deps, and not to the target 'cxx'.Eric Fiselier2018-07-271-1/+4
| | | | llvm-svn: 338096
* Attempt to unbreak *all the bots*Eric Fiselier2018-07-271-1/+1
| | | | | | | | The bots were failing to build the cxx_filesystem target, so the tests were failing. Though this does lead me to wonder how it was ever working with c++experimental. llvm-svn: 338095
* Implement <filesystem>Eric Fiselier2018-07-27162-156/+637
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 338093
* Correct comment about stat truncating st_mtimespec to secondsEric Fiselier2018-07-261-19/+6
| | | | llvm-svn: 338000
* Workaround OS X 10.11 behavior where stat truncates st_mtimespec to seconds.Eric Fiselier2018-07-261-11/+38
| | | | llvm-svn: 337998
* Add print statements to help debuggingEric Fiselier2018-07-261-11/+21
| | | | llvm-svn: 337991
* Work around GCC bug in constexpr functionEric Fiselier2018-07-251-3/+4
| | | | llvm-svn: 337976
* Remove test which shouldn't have been committedEric Fiselier2018-07-251-19/+0
| | | | llvm-svn: 337971
* [libc++] Use __int128_t to represent file_time_type.Eric Fiselier2018-07-254-218/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ``file_time_type`` time point is used to represent the write times for files. Its job is to act as part of a C++ wrapper for less ideal system interfaces. The underlying filesystem uses the ``timespec`` struct for the same purpose. However, the initial implementation of ``file_time_type`` could not represent either the range or resolution of ``timespec``, making it unsuitable. Fixing this requires an implementation which uses more than 64 bits to store the time point. I primarily considered two solutions: Using ``__int128_t`` and using a arithmetic emulation of ``timespec``. Each has its pros and cons, and both come with more than one complication. However, after a lot of consideration, I decided on using `__int128_t`. This patch implements that change. Please see the [FileTimeType Design Document](http://libcxx.llvm.org/docs/DesignDocs/FileTimeType.html) for more information. Reviewers: mclow.lists, ldionne, joerg, arthur.j.odwyer, EricWF Reviewed By: EricWF Subscribers: christof, K-ballo, cfe-commits, BillyONeal Differential Revision: https://reviews.llvm.org/D49774 llvm-svn: 337960
* Fix diagnostic test to tolerate Clang diagnosing it as well.Eric Fiselier2018-07-251-0/+5
| | | | | | | | | | | | | | Tuple has tests that ensure we diagnose non-lifetime extended reference bindings inside tuples constructors. As of yesterday, Clang now does this for us. Adjust the test to tolerate the new diagnostics, while still testing that we emit diagnostics of our own. Maybe after this version of Clang has been adopted by most users we should remove our diagnostics; but for now more error detection is better! llvm-svn: 337905
* Fix bugs in create_directory implementation.Eric Fiselier2018-07-253-6/+67
| | | | | | | | | | | | | | Libc++ was incorrectly reporting an error when the target of create_directory already exists, but was not a directory. This behavior is not specified in the most recent standard, which says no error should be reported. Additionally, libc++ failed to report an error when the attribute directory path didn't exist or didn't name a directory. This has been fixed as well. Although it's not clear if we should call status or symlink_status on the attribute directory. This patch chooses to still call status. llvm-svn: 337888
* Fix missing includes in format_string.hpp helperEric Fiselier2018-07-251-4/+5
| | | | llvm-svn: 337886
* New test support for comparisons. Reviewed as https://reviews.llvm.org/D49773Marshall Clow2018-07-251-0/+175
| | | | llvm-svn: 337885
* Make <experimental/filesystem> explicitly require C++11.Eric Fiselier2018-07-251-3/+8
| | | | | | | | | | | | | | Previously the <experimental/filesystem> didn't guard its contents in any dialect. However, the implementation implicitly requires at least C++11, and the tests have always been marked unsupported in C++03. This patch puts a header guard around the contents to avoid exposing them before C++11. Additionally, it replaces all of the usages of _NOEXCEPT or _LIBCPP_CONSTEXPR with the keyword directly, since we can expect the compiler to implement those by now. llvm-svn: 337884
* Stop wrapping __has_include in another macroAlexander Richardson2018-07-241-5/+3
| | | | | | | | | | | | | | Summary: This is not guaranteed to work since the characters after '__has_include(' have special lexing rules that can't possibly be applied when __has_include is generated by a macro. It also breaks the crash reproducers generated by -frewrite-includes (see https://llvm.org/pr37990). Reviewers: EricWF, rsmith, mclow.lists Reviewed By: mclow.lists Differential Revision: https://reviews.llvm.org/D49067 llvm-svn: 337824
* Disable 'suggest braces' warnings for std::array in testsMarshall Clow2018-07-242-0/+7
| | | | llvm-svn: 337808
* Implement <span>. Reviewed as https://reviews.llvm.org/D49338Marshall Clow2018-07-2439-0/+4409
| | | | llvm-svn: 337804
* Fix accidentally removed test.Eric Fiselier2018-07-231-2/+15
| | | | | | | | | When adding the new tests for the filesystem_error::what method, I incorrectly removed a test case and replaced it with something else. This patch restores that test case llvm-svn: 337764
* Fix use of C++14 syntax in C++11 filesystem tests.Eric Fiselier2018-07-231-3/+5
| | | | llvm-svn: 337666
* Implement filesystem_error::what() and improve reporting.Eric Fiselier2018-07-2310-44/+184
| | | | | | | | | | | This patch implements the `what()` for filesystem errors. The message includes the 'what_arg', any paths that were specified, and the error code message. Additionally this patch refactors how errors are created, making it easier to report them correctly. llvm-svn: 337664
OpenPOWER on IntegriCloud