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
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
This patch fixes almost all currently failing tests when
using GCC ToT.
The specific changes are:
(A) Workaround gcc.gnu.org/PR83921 which rejects variables w/o initializers
in constexpr contexts -- even when the variable is an empty class. This
bug has been worked around at all callsites by adding an initializer.
Additionally a new test, constexpr_init.pass.cpp, has been added to
test that Clang doesn't suffer from these bugs.
(B) Fix streambuf.assign/swap.pass.cpp. This test was never actually
calling the swap method as intended. In fact, the swap function it
intended to call was ill-formed when instantiated. GCC diagnosed
this ill-formedness w/o needing an instantiation.
(C) size_delete11.pass.cpp was fixed by adding c++2a to the list of
unsupported dialects.
llvm-svn: 322810
Previously .fail.cpp tests for nodiscard were run with -Wunused-result
being a warning, not an error, when the compiler didn't support -verify.
When -verify isn't enabled this change judiciously adds -Werror=unused-result
when to only the failure tests containing the // expected-error string for nodiscard.
As a drive-by change, this patch also adds a missing // UNSUPPORTED: c++2a to
a test which was only supposed to run in C++ <= 11.
llvm-svn: 322776
This patch changes the test suite to attempt and prefer -std=c++17 over
-std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers
to refer to c++17 over c++1z.
llvm-svn: 317610
The vcruntime headers are hairy and clash with both libc++ headers
themselves and other libraries. libc++ normally deals with the clashes
by deferring to the vcruntime headers and silencing its own definitions,
but for clients which don't want to depend on vcruntime headers, it's
desirable to support the opposite, i.e. have libc++ provide its own
definitions.
Certain operator new/delete replacement scenarios are not currently
supported in this mode, which requires some tests to be marked XFAIL.
The added documentation has more details.
Differential Revision: https://reviews.llvm.org/D38522
llvm-svn: 315234
This makes them consistent (many comments already used uppercase).
The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change.
llvm-svn: 309468
This reverts commit r306310.
r306310 causes clang to reject a call to an aligned allocation or
deallocation function if it is not implemented in the standard library
of the deployment target. This is not the desired behavior when users
have defined their own aligned functions.
rdar://problem/32664169
llvm-svn: 306859
attribute.
This is needed because older versions of libc++ do not have these
operators. If users target an older deployment target and try to compile
programs in which these operators are explicitly called, the compiler
will complain.
The following is the list of minimum deployment targets for the four
OSes:
macosx: 10.13
ios: 11.0
tvos: 11.0
watchos: 4.0
rdar://problem/32664169
Differential Revision: https://reviews.llvm.org/D34556
llvm-svn: 306310
This patch fixes the test failures and unexpected passes that occur
when testing against GCC 7. Specifically:
* don't mark __gcd as always inline because it's a recursive function. GCC diagnoses this.
* don't XFAIL the aligned allocation tests. GCC 7 supports them but not the -faligned-allocation option.
* Work around gcc.gnu.org/PR78489 in variants constructors.
llvm-svn: 302488
Libc++ doesn't provide its own definitions of new/delete on Windows,
instead using the versions provided by VCRuntime. However VCRuntime
does not yet implement aligned new/delete so these tests fail.
It might be possible for libc++ to provide its own definitions only
for aligned new/delete as long as MSVC doesn't provide it. However
before this can be done libc++ needs to figure out how to implement
std::get_new_handler.
llvm-svn: 302384
Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.
See docs/DesignDocs/AvailabilityMarkup.rst for more information.
Differential Revision: https://reviews.llvm.org/D31739
llvm-svn: 302172
Skip the tests that expect an exception be thrown and protect unreachable catch blocks.
Differential Revision: https://reviews.llvm.org/D26197
llvm-svn: 285791
Summary:
This patch implements the library side of P0035R4. The implementation is thanks to @rsmith.
In addition to the C++17 implementation, the library implementation can be explicitly turned on using `-faligned-allocation` in all dialects.
Reviewers: mclow.lists, rsmith
Subscribers: rsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D25591
llvm-svn: 284206
This patch addresses the following issues in the test suite:
1. Move "std::bad_array_length" test from std/ to libcxx/ test directory
since the feature is not a part of the standard.
2. Rename "futures.tas" test directory to "futures.task" since that is the
correct stable name.
3. Move tests for "packaged_task<T>::result_type" from std/ to libcxx/
test directory since the typedef is a libc++ extension.
llvm-svn: 271430
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
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
Summary:
This patch does 2 main things:
1. Enable sized delete if the feature test macro `__cpp_sized_deallocation` is enabled.
2. Rework and cleanup all of the sized delete tests.
Test Plan:
The sized delete replacement tests are now split into 4 files:
1. sized_delete11.pass.cpp: Ensure overriding sized delete in C++11 has no effect.
2. sized_delete14.pass.cpp: Test overriding sized delete in C++14 and ensure it is called. This test fails on clang and GCC < 5.1.
3. size_delete_calls_unsized_delete_.pass.cpp: Test that the default sized delete calls unsized delete.
4. sized_delete_fsizeddeallocation.pass.cpp: Test overriding sized delete when -fsized-deallocation is passed. This test should pass on clang and GCC >= 5.1
I have also removed a lot of cruft from the old tests. They no longer replace the new handler and tests that it is called for bad allocations.
Reviewers: mclow.lists
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D9831
llvm-svn: 237662