summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory/default.allocator
Commit message (Collapse)AuthorAgeFilesLines
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-315-0/+10
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-281-1/+0
| | | | | | | 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++] 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
* [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdefLouis Dionne2019-02-051-6/+2
| | | | | | | | | | | 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
* Support tests in freestandingJF Bastien2019-02-0411-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1911-44/+33
| | | | | | | | | | | | | | | | | | 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
* [libcxx] Add missing <cstddef> includes in testsLouis Dionne2018-11-191-0/+1
| | | | | | | | | | | Some tests use type std::max_align_t, but don't include <cstddef> header directly. As a result, these tests won't compile against some conformant libraries. Reviewed as https://reviews.llvm.org/D54645. Thanks to Andrey Maksimov for the patch. llvm-svn: 347232
* avoid new/delete ellision in construct.pass.cppEric Fiselier2018-03-251-0/+4
| | | | llvm-svn: 328445
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-03-221-1/+1
| | | | llvm-svn: 328264
* Use DoNotOptimize to prevent new/delete elision.Eric Fiselier2018-03-221-1/+5
| | | | | | | | | | | The new/delete tests, in particular those which test replacement functions, often fail when the optimizer is enabled because the calls to new/delete may be optimized away, regardless of their side-effects. This patch converts the tests to use DoNotOptimize in order to prevent the elision. llvm-svn: 328245
* Fix PR22634 - std::allocator doesn't respect over-aligned types.Eric Fiselier2018-03-221-22/+76
| | | | | | | | | | | | | | | | | | | | This patch fixes std::allocator, and more specifically, all users of __libcpp_allocate and __libcpp_deallocate, to support over-aligned types. __libcpp_allocate/deallocate now take an alignment parameter, and when the specified alignment is greater than that supported by malloc/new, the aligned version of operator new is called (assuming it's available). When aligned new isn't available, the old behavior has been kept, and the alignment parameter is ignored. This patch depends on recent changes to __builtin_operator_new/delete which allow them to be used to call any regular new/delete operator. By using __builtin_operator_new/delete when possible, the new/delete erasure optimization is maintained. llvm-svn: 328180
* Implement LWG3035: std::allocator's constructors should be constexpr.Marshall Clow2018-03-201-0/+50
| | | | llvm-svn: 328059
* More of P0600; marking allocation routines as [[nodiscard]]Marshall Clow2017-11-261-0/+28
| | | | llvm-svn: 318992
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-211-1/+1
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-151-1/+1
| | | | | | https://reviews.llvm.org/D39080 llvm-svn: 318277
* Fix test failure to to new/delete ellisionsEric Fiselier2017-07-091-2/+3
| | | | llvm-svn: 307510
* [libcxx] [test] D26813: allocator<const T> is non-Standard.Stephan T. Lavavej2016-11-182-18/+18
| | | | | | | | | | N4582 17.6.3.5 [allocator.requirements] says that allocators are given cv-unqualified object types, and N4582 20.9.9 [default.allocator] implies that allocator<const T> is ill-formed (due to colliding address() overloads). Therefore, tests for allocator<const T> should be marked as libcxx-specific (if not removed outright). llvm-svn: 287381
* Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: ↵Roger Ferrer Ibanez2016-10-311-1/+1
| | | | | | | | | | | | | libcpp-no-exceptions" tests that only check exceptions and nothing else This is a follow up of D24562. These tests do not check anything but exceptions, so it makes sense to mark them as UNSUPPORTED under a library built without exceptions. Differential Revision: https://reviews.llvm.org/D26075 llvm-svn: 285550
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-141-1/+3
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-011-3/+3
| | | | llvm-svn: 271435
* Change allocator<T>::allocate to throw length_error, not bad_allocEric Fiselier2016-05-071-3/+5
| | | | llvm-svn: 268842
* Void cast runtime-unused variables. Patch from STL@microsoft.comEric Fiselier2016-05-021-2/+8
| | | | llvm-svn: 268284
* Mark exception-throwing test as XFAIL when exceptions are disabledMarshall Clow2016-03-141-0/+1
| | | | llvm-svn: 263405
* Fix for PR26812: possible overflow issue in std::allocator::allocateMarshall Clow2016-03-031-0/+46
| | | | llvm-svn: 262610
* Fixed a possible overflow in a test of allocator::max_size().Marshall Clow2015-10-051-2/+2
| | | | llvm-svn: 249349
* Suppress clang warnings in some testsEric Fiselier2015-08-301-2/+4
| | | | llvm-svn: 246399
* Fix a handful of tests that fail in C++03Eric Fiselier2015-07-281-13/+8
| | | | llvm-svn: 243392
* Noticed that std::allocator<const T> was missing the definition for ↵Marshall Clow2015-07-011-0/+5
| | | | | | is_always_equal. Fixed this, and added a test for it. llvm-svn: 241190
* Get tests running with warnings. Fix warnings in headers and testsEric Fiselier2015-02-051-0/+1
| | | | llvm-svn: 228344
* [libcxx] Consolidate new/delete replacement in tests and disable it when ↵Eric Fiselier2014-12-222-59/+33
| | | | | | | | | | | | | | | | | | | | using sanitizers. Summary: MSAN and ASAN also replace new/delete which leads to a link error in these tests. Currently they are unsupported but I think it would be useful if these tests could run with sanitizers. This patch creates a support header that consolidates the new/delete replacement functionality and checking. When we are using sanitizers new and delete are no longer replaced and the checks always return true. Reviewers: mclow.lists, danalbert, jroelofs, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6562 llvm-svn: 224741
* Move test into test/std subdirectory.Eric Fiselier2014-12-208-0/+518
llvm-svn: 224658
OpenPOWER on IntegriCloud