summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [CMake] Support compiler-rt builtins library in testsPetr Hosek2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | We're building tests with -nostdlib which means that we need to explicitly include the builtins library. When using libgcc (default) we can simply include -lgcc_s on the link line, but when using compiler-rt builtins we need a complete path to the builtins library. This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY, so we just need to pass that path to lit and if config.compiler_rt is true, link it to the test. Prior to this patch, running tests when compiler-rt is being used as the builtins library was broken as all tests would fail to link, but with this change running tests when compiler-rt bultins library is being used should be supported. Differential Revision: https://reviews.llvm.org/D56701 llvm-svn: 353208
* [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdefLouis Dionne2019-02-055-37/+11
| | | | | | | | | | | 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
* [CMake] Update lit test configurationPetr Hosek2019-02-051-14/+14
| | | | | | | | | There are several changes: - Don't stringify Pythonized bools (that's why we're Pythonizing them) - Support specifying target and sysroot via CMake variables - Use consistent spelling for --target, --sysroot, --gcc-toolchain llvm-svn: 353137
* Support tests in freestandingJF Bastien2019-02-046119-6223/+18203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Support CMake variables for setting target, sysroot and toolchainPetr Hosek2019-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | CMake has a standard way of setting target triple, sysroot and external toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into corresponding --target=, --sysroot= and --gcc-toolchain= variables add included appended to CMAKE_<LANG>_FLAGS. libunwind, libc++abi, libc++ provides their own mechanism through <PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN variables. These are also passed to lit via lit.site.cfg, and lit config uses these to set the corresponding compiler flags when building tessts. This means that there are two different ways of setting target, sysroot and toolchain, but only one is properly supported in lit. This change extends CMake build for libunwind, libc++abi and libc++ to also support the CMake variables in addition to project specific ones in lit. Differential Revision: https://reviews.llvm.org/D57670 llvm-svn: 353084
* Move the feature test macros script to the utils directory.Eric Fiselier2019-02-021-975/+0
| | | | | | | It doesn't make a lot of sense to keep it with the tests, deep into the test suite directonies. llvm-svn: 352970
* add a test and a couple minor bug fixes for the ↵Marshall Clow2019-02-011-0/+5
| | | | | | implicit-signed-integer-truncation sanitizer. This is PR#40566 llvm-svn: 352926
* Fix a bit of libc++-specific behavior in the regex tests; add a missing ↵Marshall Clow2019-01-313-4/+46
| | | | | | test. Reviewed as https://reviews.llvm.org/D57391 Thanks to Andrey Maksimov for the patch llvm-svn: 352781
* [libc++] Fix Windows build error in <functional>Thomas Anderson2019-01-291-0/+1
| | | | | | | | | | | | On my Windows system, __allocator is defined to nothing. This change fixes build errors of the below form: In file included from algorithm:644: functional(1492,31): error: expected member name or ';' after declaration specifiers const _Alloc& __allocator() const { return __f_.second(); } Differential Revision: https://reviews.llvm.org/D57355 llvm-svn: 352561
* 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
* Mark some of the behavior in the move w/allocator constructors of ↵Marshall Clow2019-01-295-36/+41
| | | | | | deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out. llvm-svn: 352512
* [libc++] Use runtime rather then compile-time glibc version checkPetr Hosek2019-01-281-10/+24
| | | | | | | | | | | | | | | glibc supports versioning, so it's possible to build against older version and run against newer version. This is sometimes relied on in practice, e.g. in Fuchsia build we build against older sysroot (equivalent to Ubuntu Trusty) to cover the broadest possible range of host systems, but that doesn't necessarily match the system that binary is going to run on which may have newer version, in which case the compile test used in curr_symbol is going to fail. Using runtime check is more reliable. Differential Revision: https://reviews.llvm.org/D56702 llvm-svn: 352425
* Mark awk.pass.cpp as XFAIL for NetBSDKamil Rytarowski2019-01-241-1/+2
| | | | | | Reported on the NetBSD 8 build bot. llvm-svn: 352097
* D14686: 'Protect against overloaded comma in random_shuffle and improve ↵Marshall Clow2019-01-242-2/+45
| | | | | | tests' I had to cut back on the tests with this, because they were not C++03 friendly. Thanks to gribozavr for the patch llvm-svn: 352087
* [libcxx] Portability fix: unordered_set and unordered_multiset iterators are ↵Louis Dionne2019-01-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | not required to be the same The unordered_set and unordered_multiset iterators are specified in the standard as follows: using iterator = implementation-defined; // see [container.requirements] using const_iterator = implementation-defined; // see [container.requirements] using local_iterator = implementation-defined; // see [container.requirements] using const_local_iterator = implementation-defined; // see [container.requirements] The pairs iterator/const_iterator and local_iterator/const_local_iterator are not required to be the same. The reasonable requirement would be that iterator can convert to const_iterator and local_iterator can convert to const_local_iterator. This patch weakens the check and makes the test more portable. Reviewed as https://reviews.llvm.org/D56493. Thanks to Andrey Maksimov for the patch. llvm-svn: 352083
* Mark another test as flakyKamil Rytarowski2019-01-241-0/+2
| | | | | | Reported on the NetBSD 8 buildbot. llvm-svn: 352064
* Uncomment the entire test, but mark as XFAIL on linux-gnu because it uses ↵Marshall Clow2019-01-241-2/+3
| | | | | | locales that aren't generally available there, similar to the other regex tests llvm-svn: 352006
* Mark another test as flakyKamil Rytarowski2019-01-231-0/+2
| | | | | | Reported on the NetBSD 8 buildbot. llvm-svn: 351995
* Apply D28248: 'Work around GCC PR37804'. Thanks to mdaniels for the patchMarshall Clow2019-01-232-0/+42
| | | | llvm-svn: 351993
* [test] Define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST in ↵Casey Carter2019-01-231-3/+7
| | | | | | | | | | | msvc_stdlib_force_include.hpp ...so the tests under test/std/utilities/any continue to compile with MSVC's standard library. While we're here, let's test >C++17 features when _HAS_CXX20. llvm-svn: 351991
* Mark another test as flakyKamil Rytarowski2019-01-231-0/+2
| | | | | | Reported on the NetBSD 8 buildbot. llvm-svn: 351988
* Correct mark for flaky testsKamil Rytarowski2019-01-237-7/+7
| | | | | | Add missing trailing dot. llvm-svn: 351983
* Mark more tests flakyKamil Rytarowski2019-01-232-0/+4
| | | | | | Reported on the NetBSD 8 buildbot llvm-svn: 351944
* Mark thread.condition.condvarany/wait_for.pass.cpp as flakyKamil Rytarowski2019-01-231-0/+2
| | | | | | Reported on the NetBSD 8 buildbot. llvm-svn: 351937
* While reviewing D57058, Louis had some questions about the existing span ↵Marshall Clow2019-01-222-36/+69
| | | | | | constructor tests. They were not testing the stuff that they said they were. Updated the tests to test what they should have been doing llvm-svn: 351887
* [libcxx] Include <cstring> in tests that use strcmpLouis Dionne2019-01-224-5/+8
| | | | | | | Reviewed as https://reviews.llvm.org/D56503. Thanks to Andrey Maksimov for the patch. llvm-svn: 351847
* Fix aligned allocation availability XFAILs after D56445.Eric Fiselier2019-01-208-24/+40
| | | | | | | | | | D56445 bumped the minimum Mac OS X version required for aligned allocation from 10.13 to 10.14. This caused libc++ tests depending on the old value to break. This patch updates the XFAILs for those tests to include 10.13. llvm-svn: 351670
* Revert "Fix aligned allocation availability XFAILs after D56445."Eric Fiselier2019-01-208-24/+16
| | | | | | | | | This reverts commit r351625. That fix was incomplete. I'm reverting so I can commit a complete fix in a single revision. llvm-svn: 351669
* Update generator script to use the new license file header.Chandler Carruth2019-01-191-4/+3
| | | | llvm-svn: 351650
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-196251-25004/+18753
| | | | | | | | | | | | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. 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: 351636
* Fix aligned allocation availability XFAILs after D56445.Eric Fiselier2019-01-198-16/+24
| | | | | | | | | | D56445 bumped the minimum Mac OS X version required for aligned allocation from 10.13 to 10.14. This caused libc++ tests depending on the old value to break. This patch updates the XFAILs for those tests to include 10.13. llvm-svn: 351625
* correct script name in generated testsEric Fiselier2019-01-1643-89/+91
| | | | llvm-svn: 351299
* Attempt to make test_macros.h even more minimalEric Fiselier2019-01-161-1/+12
| | | | llvm-svn: 351292
* Fix feature test macros for atomics/mutexes without threadingEric Fiselier2019-01-164-73/+177
| | | | llvm-svn: 351291
* Fix PR40230 - std::pair may have padding on FreeBSD.Eric Fiselier2019-01-162-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: FreeBSD ships a very old and deprecated ABI for std::pair where the copy and move constructors are not allowed to be trivial. D25389 change how this was implemented by introducing a non-trivial base class. This patch, introduced in October 2016, introduced an ABI bug that caused nested `std::pair` instantiations to have padding. For example: ``` using PairT = std::pair< std::pair<char, char>, char >; static_assert(offsetof(PairT, first) == 0, "First member should exist at offset zero"); // Fails on FreeBSD! ``` The bug occurs because the base class for the first element (the nested pair) cannot be put at offset zero because the top-level pair already has the same base class laid out there. This patch fixes that ABI bug by templating the dummy base class on the same parameters as the pair. Technically this fix is an ABI break for users who depend on the "broken" ABI introduced in 2016. I'm putting this up for review so that the FreeBSD maintainers can sign off on fixing the ABI by breaking the ABI. Another option, since we have to "break" the ABI to fix it, would be to move FreeBSD off the deprecated non-trivial pair ABI instead. Also see: * https://llvm.org/PR40230 * https://reviews.llvm.org/D21329 Reviewers: rsmith, dim, emaste Reviewed By: rsmith Subscribers: mclow.lists, krytarowski, christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D56357 llvm-svn: 351290
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2019-01-165-10/+52
| | | | | | | | | | | | | | | | | | | | | 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
* Implement feature test macros using a script.Eric Fiselier2019-01-1644-1054/+7080
| | | | | | | | | | | | | | | | | | | | Summary: This patch implements all the feature test macros libc++ currently supports, as specified by the standard or cppreference prior to C++2a. The tests and `<version>` header are generated using a script. The script contains a table of each feature test macro, the headers it should be accessible from, and its values of each dialect of C++. When a new feature test macro is added or needed, the table should be updated and the script re-run. Reviewers: mclow.lists, jfb, serge-sans-paille Reviewed By: mclow.lists Subscribers: arphaman, jfb, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D56750 llvm-svn: 351286
* Add large file support to create_file for 32-bit.Dan Albert2019-01-151-5/+41
| | | | | | | | | | | | | | | | | | Summary: The tests need to create files larger than 2GB, but size_t is 32-bit on a 32-bit system. Make use of explicit off64_t APIs so we can still use a default off_t for the tests while enabling 64-bit file offsets for create_file. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D56619 llvm-svn: 351225
* [libc++] Support different libc++ namespaces in the iterator testPetr Hosek2019-01-151-30/+30
| | | | | | | | | libc++ allows changing the namespace, don't assume __1 in the test to avoid the test failure if different namespace is being used. Differential Revision: https://reviews.llvm.org/D56698 llvm-svn: 351220
* [test] Fix logic error in <compare> tests; enable for MSVC Dev16Casey Carter2019-01-154-4/+5
| | | | | | Submitted upstream as https://reviews.llvm.org/D53763. llvm-svn: 351148
* Generalize the comparison test structure to support cross-type comparisons. ↵Marshall Clow2019-01-151-36/+36
| | | | | | NFC to the library llvm-svn: 351140
* 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-105/+287
| | | | | | | | | | | | | | | | | 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
* Filesystem tests: fix fs.op.relativeJF Bastien2019-01-101-43/+83
| | | | | | | | | | | | Summary: The test wasn't using the testing infrastructure properly. Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D56519 llvm-svn: 350872
OpenPOWER on IntegriCloud