Commit Graph

149 Commits

Author SHA1 Message Date
Roger Ferrer Ibanez
aa138aa2a4 Remove spurious token from #endif
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 08:36:43 +00:00
Roger Ferrer Ibanez
a405f45fcd Protect tests for new/delete under libcpp-no-exceptions
Skip the tests that expect an exception be thrown and protect unreachable catch blocks.

Differential Revision: https://reviews.llvm.org/D26197



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 08:14:57 +00:00
Roger Ferrer Ibanez
efc9f170c9 Change from "XFAIL: libcpp-no-exceptions" to "UNSUPPORTED: 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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-31 08:47:53 +00:00
Eric Fiselier
e577a4c660 Fix nullptr tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:45:17 +00:00
Eric Fiselier
6d36efa497 Attempt to workaround XPASS for aligned allocation tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 03:31:07 +00:00
Eric Fiselier
9ffd1d56b4 Prevent new/delete replacement tests from being optimized away.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284289 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 22:47:08 +00:00
Eric Fiselier
e630058e90 Clarify XFAIL comments
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 21:30:35 +00:00
Eric Fiselier
f172df1f43 XFAIL aligned allocation tests for older Clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 08:47:09 +00:00
Eric Fiselier
34c6b805cf XFAIL aligned allocation test failures with UBSAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284210 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 07:49:15 +00:00
Eric Fiselier
9acbffa370 Implement P0035R4 -- Add C++17 aligned allocation functions
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 06:46:30 +00:00
Eric Fiselier
4775578c61 Remove usages of _ALIGNAS_TYPE
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 10:19:48 +00:00
Eric Fiselier
3a60979362 Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:21:52 +00:00
Eric Fiselier
7d4a984cea Placate MSVC's unchecked malloc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 04:23:54 +00:00
Eric Fiselier
2aa1c4af39 UBSan doesn't globally replace new/delete but it still makes some tests fail. Investigation needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273372 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 04:00:45 +00:00
Eric Fiselier
b065399890 Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:55:59 +00:00
Eric Fiselier
571d549ddd Guard use of non-standard macros in denorm_min() tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:50:09 +00:00
Eric Fiselier
868af68aeb Allow placement new array test to consume extra bytes as specified by the standard.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:32:28 +00:00
Eric Fiselier
d24c465bea 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!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:31:42 +00:00
Eric Fiselier
bfdae2062a Fix warnings in tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 03:21:49 +00:00
Eric Fiselier
5e3bf9c69a Avoid name shadowing in test. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 02:47:46 +00:00
Eric Fiselier
84acb1ec3f Remove trailing whitespace in test suite. Approved by Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:35:39 +00:00
Eric Fiselier
68db6cdf1b Cleanup non-standard tests as reported by STL@microsoft.com. NFC.
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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:05:53 +00:00
Asiri Rathnayake
a3eac518e6 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 08:57:35 +00:00
Eric Fiselier
a9ea11398d Void cast runtime-unused variables. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:15:48 +00:00
Eric Fiselier
c8b24c6d54 Mark some test XFAIL for GCC 4.9 due to missing is_trivial* traits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 04:59:57 +00:00
Dan Gohman
2afbf71fdd [WebAssembly] Set std::numeric_limits's traps field for WebAssembly.
WebAssembly's integer division instruction traps on division by zero; set the
traps field of integral std::numeric_limits to true.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 16:32:00 +00:00
Marshall Clow
b6621c5259 Fix a corner case that involved calling rethrow_if_nested with a type that had a deleted operator&. Added a test to catch this as well. Thanks to Ville for the heads-up.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255517 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 18:01:56 +00:00
Asiri Rathnayake
cc2e93cff0 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 11:41:22 +00:00
Eric Fiselier
9698ac5a68 Manually suppress -Wnonnull when it occurs in an unevaluated context
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 07:41:07 +00:00
Marshall Clow
41a04d69c4 Suppress some warnings in the tests that snuck in. That 'tmpnam' is deprecated doesn't change the fact that we have to test it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@247704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15 17:12:49 +00:00
Eric Fiselier
408369b7c9 Suppress clang warnings in some tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@246399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-30 22:04:20 +00:00
Eric Fiselier
b47a434d60 Fix a handful of tests that fail in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243392 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 07:31:50 +00:00
Eric Fiselier
7b86ce5cc4 Fix warnings in test/std/language.support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:17:16 +00:00
Eric Fiselier
3f339e65df Cleanup tests that fail in C++1z and with Clang 3.8
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 22:27:43 +00:00
Marshall Clow
73f131f210 Mark two tests as failing on clang 3.8 (they failed on 3.7, too)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 02:44:33 +00:00
Ed Schouten
323ade3e70 Make support for thread-unsafe C functions optional.
One of the aspects of CloudABI is that it aims to help you write code
that is thread-safe out of the box. This is very important if you want
to write libraries that are easy to reuse. For CloudABI we decided to
not provide the thread-unsafe functions. So far this is working out
pretty well, as thread-unsafety issues are detected really early on.

The following patch adds a knob to libc++,
_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable
thread-unsafe functions that can easily be avoided in practice. The
following functions are not thread-safe:

- <clocale>: locale handles should be preferred over setlocale().
- <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over
  their non-restartable counterparts.
- <ctime>: asctime(), ctime(), gmtime() and localtime() are not
  thread-safe. The first two are also deprecated by POSIX.

Differential Revision:	http://reviews.llvm.org/D8703
Reviewed by:	marshall


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 08:44:38 +00:00
Marshall Clow
8731c5da46 Implement uncaught_exceptions() using the newly added hooks in libc++abi, when available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238846 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:33:38 +00:00
Eric Fiselier
c4324b2b94 Add TODO items and remove use of 'noexcept' in C++03 test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:25:34 +00:00
Eric Fiselier
5d663441e7 Address @danalberts comments on r237700
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:10:32 +00:00
Eric Fiselier
a985b8cc79 Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 15:15:53 +00:00
Eric Fiselier
02be74588a mark new/delete tests as XFAIL more carefully
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 03:41:22 +00:00
Eric Fiselier
f4c97290fc [libcxx] Rework sized delete.
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 02:03:22 +00:00
Marshall Clow
c42668278d Fix for LWG Issue 2458: N3778 and new library deallocation signatures.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 17:48:45 +00:00
Eric Fiselier
2cea80b137 Remove statement with no effect inside tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@233816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01 15:49:02 +00:00
Marshall Clow
aa8a52c934 Fix a problem when calling throw_with_nested with a class marked 'final'. Thanks to STL @ Microsoft for the bug report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232384 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 15:10:28 +00:00
Eric Fiselier
07a4bec1dd Use generic feature name for sanitizers that replace new and delete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231841 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 20:46:04 +00:00
Larisse Voufo
74f95a01cd More on adding sized deallocation functions in libc++: Continuing from r229281, this adds version guards and test cases.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 06:13:05 +00:00
Marshall Clow
6b913d7c52 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-09 20:25:52 +00:00
Eric Fiselier
a90c6dd460 Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 01:40:03 +00:00