Eric Fiselier
f2f2a6395f
Replace __cplusplus comparisons and dialect __has_feature checks with 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
2016-06-14 21:31:42 +00:00
Eric Fiselier
7cf29e3468
Fix leak in __enable_weak_this(). Thanks to Arthur O'Dwyer for finding it.
...
llvm-svn: 271487
2016-06-02 04:57:00 +00:00
Eric Fiselier
39a724ea36
Remove enable_shared_from_this test since it leaks the control block and fails with ASAN
...
llvm-svn: 271459
2016-06-02 01:09:12 +00:00
Eric Fiselier
88f5bfdc5b
Implement P0033R1 - Re-enabling shared_from_this
...
Summary: See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html
Reviewers: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19254
llvm-svn: 271449
2016-06-02 00:15:35 +00:00
Eric Fiselier
d04c685168
Remove trailing whitespace in test suite. Approved by Marshall Clow.
...
llvm-svn: 271435
2016-06-01 21:35:39 +00:00
Eric Fiselier
7939ae5e08
Mark LWG issue 2520 as complete
...
llvm-svn: 271249
2016-05-31 04:27:57 +00:00
Asiri Rathnayake
6edc12c886
[libcxx] Improve tests to use the UNSUPPORTED lit directive
...
Quite a few libcxx tests seem to follow the format:
#if _LIBCPP_STD_VER > X
// Do test.
#else
// Empty test.
#endif
We should instead use the UNSUPPORTED lit directive to exclude the test on
earlier C++ standards. This gives us a more accurate number of test passes
for those standards and avoids unnecessary conflicts with other lit
directives on the same tests.
Reviewers: bcraig, ericwf, mclow.lists
Differential revision: http://reviews.llvm.org/D20730
llvm-svn: 271108
2016-05-28 08:57:35 +00:00
Marshall Clow
779ddd134d
Add a test for uniqueptr having either NULL and nullptr
...
llvm-svn: 269665
2016-05-16 16:57:15 +00:00
Marshall Clow
1168ca925c
Apply D20014 - fix a missing return in a test. Fixes PR#27720
...
llvm-svn: 269298
2016-05-12 14:31:35 +00:00
Eric Fiselier
4524d6e739
Change allocator<T>::allocate to throw length_error, not bad_alloc
...
llvm-svn: 268842
2016-05-07 03:12:24 +00:00
Eric Fiselier
fb42f4c44a
Void cast runtime-unused variables. Patch from STL@microsoft.com
...
llvm-svn: 268284
2016-05-02 19:15:48 +00:00
Eric Fiselier
0d62791983
Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com
...
llvm-svn: 267844
2016-04-28 02:45:11 +00:00
Marshall Clow
a64a8fc969
Rename a few tests that had typos in their names. No functional change. Thanks to STL for the catch
...
llvm-svn: 267287
2016-04-23 14:31:00 +00:00
Eric Fiselier
f07dd8d0a9
Add is_swappable/is_nothrow_swappable traits
...
llvm-svn: 267079
2016-04-21 23:38:59 +00:00
Eric Fiselier
840fa745ca
Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.
...
The primary purpose of this patch is to add the 'is_callable' traits.
Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept
I also took this oppertunity to implement a constexpr version of INVOKE.
This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'.
This patch will be followed up with some cleanup. Primarly removing most
of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least).
llvm-svn: 266836
2016-04-20 00:14:32 +00:00
Eric Fiselier
40fde4d33e
Add tests for LWG issue 2361
...
llvm-svn: 266586
2016-04-18 02:31:05 +00:00
Eric Fiselier
a58d430cac
Make std::addressof constexpr in C++17 (Clang only).
...
llvm-svn: 263688
2016-03-17 03:30:56 +00:00
Marshall Clow
4251d3779f
Mark exception-throwing test as XFAIL when exceptions are disabled
...
llvm-svn: 263405
2016-03-14 02:51:50 +00:00
Marshall Clow
4cec709ed6
Fix for PR26812: possible overflow issue in std::allocator::allocate
...
llvm-svn: 262610
2016-03-03 12:04:39 +00:00
Marshall Clow
71abfc1392
No, really - test the constructor
...
llvm-svn: 261875
2016-02-25 15:27:13 +00:00
Marshall Clow
6433044dc9
Add test to ensure that the converting constructor in N4089 is present and working
...
llvm-svn: 261874
2016-02-25 15:25:29 +00:00
Marshall Clow
183c010c9a
Implement P0074: Making owner_less more flexible
...
llvm-svn: 252905
2015-11-12 15:56:44 +00:00
Asiri Rathnayake
f520c1445f
Make it possible to build a no-exceptions variant of libcxx.
...
Fixes a small omission in libcxx that prevents libcxx being built when
-DLIBCXX_ENABLE_EXCEPTIONS=0 is specified.
This patch adds XFAILS to all those tests that are currently failing
on the new -fno-exceptions library variant. Follow-up patches will
update the tests (progressively) to cope with the new library variant.
Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a
llvm-svn: 252598
2015-11-10 11:41:22 +00:00
Marshall Clow
79dfd99d30
Remove undefined behavior from some tests. Same pattern as the unitialized_copy tests
...
llvm-svn: 251804
2015-11-02 15:29:13 +00:00
Marshall Clow
8eb1d544f8
Remove undefined behavior from some tests. Thanks to Walter Brown for the heads-up.
...
llvm-svn: 251802
2015-11-02 15:25:53 +00:00
Marshall Clow
b631c24359
Add a test for LWG#2466: allocator_traits::max_size() default behavior is incorrect
...
llvm-svn: 251252
2015-10-25 19:34:04 +00:00
Marshall Clow
2603b0758d
Fix LWG#2127: Move-construction with raw_storage_iterator.
...
llvm-svn: 251247
2015-10-25 18:58:07 +00:00
Marshall Clow
e652e4dae1
Fixed a possible overflow in a test of allocator::max_size().
...
llvm-svn: 249349
2015-10-05 20:50:25 +00:00
Eric Fiselier
d49455ef93
Suppress clang warnings in some tests
...
llvm-svn: 246399
2015-08-30 22:04:20 +00:00
Eric Fiselier
4f42dcd59b
Cleanup unique_ptr failure tests and convert them to Clang verify
...
llvm-svn: 245529
2015-08-20 01:08:03 +00:00
Eric Fiselier
10ac1f98fa
Add files that got missed in r245512.
...
llvm-svn: 245513
2015-08-19 22:35:56 +00:00
Eric Fiselier
2228a8a3f2
More unique_ptr test cleanup. Fixes in <memory> to come later.
...
llvm-svn: 245512
2015-08-19 22:35:07 +00:00
Eric Fiselier
32ad52170c
Fix failing unique_ptr tests.
...
When I was refactoring the unique_ptr.single.ctor tests I added a test
deleter, 'NCDeleter', to deleter.h. Other tests that include deleter.h
redefine the NCDeleter type causing test failures.
llvm-svn: 243733
2015-07-31 04:34:25 +00:00
Eric Fiselier
a0832b5743
Start cleanup of unique_ptr tests.
...
One of the last sections of tests that still fail in C++03 are the unique_ptr
tests. This patch begins cleaning up the tests and fixing C++03 failures.
The main changes of this patch:
- The "Deleter" type in "deleter.h" tried to be "move-only" in C++03. However
the move simulation no longer works (see "__rv"). "Deleter" is now copy
constructible in C++03. However copying "Deleter" will "move" the test value
instead of copying it.
- Reduce the unique.ptr.single.ctor tests files from ~25 to 4. There is no
reason the tests were split through so many files.
llvm-svn: 243730
2015-07-31 02:43:52 +00:00
Eric Fiselier
abd52cad84
Fix a handful of tests that fail in C++03
...
llvm-svn: 243392
2015-07-28 07:31:50 +00:00
Marshall Clow
05fc0f25d6
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
...
llvm-svn: 242377
2015-07-16 03:05:06 +00:00
Eric Fiselier
4cd59b3f49
Automatically detect and use clang verify in failure tests.
...
Automatically enable clang verify whenever the '-verify-ignore-unexpected' flag
is supported.
Failure tests are run using verify if they contain one or more "expected-*"
diagnostics tags. Otherwise they are run normally.
llvm-svn: 241492
2015-07-06 19:56:45 +00:00
Marshall Clow
f43a42d53e
Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.
...
llvm-svn: 241190
2015-07-01 21:23:40 +00:00
Marshall Clow
55112defb0
Fix PR#18843. Thanks to Howard for the fix
...
llvm-svn: 240136
2015-06-19 15:54:13 +00:00
Marshall Clow
31a4731370
Implement the first part of N4258 - allocator_traits<X>::is_always_equal. Also fixes PR#23723
...
llvm-svn: 238848
2015-06-02 16:34:03 +00:00
Marshall Clow
a7fb9a041d
Fix PR#23647 - make_shared<volatile bool> - second try
...
llvm-svn: 238370
2015-05-27 22:44:47 +00:00
Marshall Clow
188b98b505
Revert 238354 while I figure out what broke in weak_ptr
...
llvm-svn: 238355
2015-05-27 20:36:14 +00:00
Marshall Clow
263a0f7681
Fix PR#23647 - make_shared<volatile bool>
...
llvm-svn: 238354
2015-05-27 20:15:33 +00:00
Marshall Clow
a00932bddb
Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded operator&
...
llvm-svn: 237699
2015-05-19 15:01:48 +00:00
Marshall Clow
c34f847b80
Fix for LWG Issue 2415: Inconsistency between unique_ptr and shared_ptr
...
llvm-svn: 236953
2015-05-10 13:59:45 +00:00
Marshall Clow
783b372a58
Fix for LWG2454: Add raw_storage_iterator::base() member
...
llvm-svn: 236948
2015-05-10 13:14:08 +00:00
Eric Fiselier
4b7533a1dd
Use generic feature name for sanitizers that replace new and delete
...
llvm-svn: 231841
2015-03-10 20:46:04 +00:00
Eric Fiselier
c281a7a19f
Get tests running with warnings. Fix warnings in headers and tests
...
llvm-svn: 228344
2015-02-05 20:28:37 +00:00
Jonathan Roelofs
eb7b5e74d4
Rename system_lib -> system_cxx_lib. NFC
...
llvm-svn: 226061
2015-01-14 23:38:12 +00:00
Marshall Clow
e21582e742
Walter Brown sent a list of tests which needed 'additional includes' to match what was in the standard. Added these includes to the tests. No changes to the library or test results.
...
llvm-svn: 225541
2015-01-09 20:25:52 +00:00