Commit Graph

1711 Commits

Author SHA1 Message Date
Marshall Clow
9a4997ba29 Update status of LWG issues 2340, 2396 and 2401. In all three cases, these are things that we already do.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 17:35:16 +00:00
Marshall Clow
e52b63237a Since Eric poisoned the comma operator on all our test iterators, we no longer need 'comma_iterator'. Remove it from the test suite.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222238 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 16:15:00 +00:00
Marshall Clow
48b428d540 Fix the tests I broke with the last commit. Sorry for the noise
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222165 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 19:16:57 +00:00
Marshall Clow
4b3ca8c249 Implement LWG2400 - 'shared_ptr's get_deleter() should use addressof()', and add tests. Mark LWG2400 and LWG2404 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222161 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 19:05:50 +00:00
Marshall Clow
36628eb77a Reworked mismatch tests to count the number of comparisons, and make sure we are conforming with LWG2404. We are
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222159 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 18:52:25 +00:00
Marshall Clow
cfeac66f8c Fix a warning in the test; no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222143 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 16:34:44 +00:00
Marshall Clow
88aae920ef Implement void_t from N3911. Add a private version for use in the library before C++1z. Update the 1z status page, marking a bunch of issues that don't require library changes as complete (2129, 2212, 2230, 2233, 2325, 2365, 2376)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222138 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 15:50:08 +00:00
Marshall Clow
275b6bbe1c Add tests to ensure that reference_wrapper<T> is trivially copyable. This was added to C++1z with the adoption of N4277, but libc++ already implemented it as a conforming extension. No code changes were needed, just more tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222132 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-17 15:04:46 +00:00
Eric Fiselier
9a1468f79e Fix build regression caused by not defining ABI library macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-15 17:25:23 +00:00
Eric Fiselier
8e2855ce0b [libcxx] Refactor CMakeLists.txt handling of compile and link flags to suppress warnings.
Summary:
Currently we have 5 variables that are used to specify options for building libcxx
1. `LIBCXX_CXX_FEATURE_FLAGS`
2. `LIBCXX_CXX_WARNING_FLAGS`
3. `LIBCXX_CXX_REQUIRED_FLAGS`
4. `compile_flags` (in libcxx/lib)
5. `link_flags` (in libcxx/lib)

The first three all get put into `CMAKE_CXX_FLAGS`. 
This changes the way flags are handled by only using 3 different options:

1. `LIBCXX_CXX_FLAGS` - general compile and link flags.
2. `LIBCXX_COMPILE_FLAGS` - compile only flags.
3. `LIBCXX_LINK_FLAGS` - link only flags.

This patch also removes the warning about `-nostdinc++` being unused during linking.



Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6277

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-15 06:26:30 +00:00
Eric Fiselier
0364baca04 Split thread test into two parts. Mark one as XFAIL with ASAN.
The second part of the test checks that std::terminate is called when a running
thread is move assigned to. Calling std::terminate prevents some of the destructors
to be called and ASAN fires on this.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-15 01:58:45 +00:00
Eric Fiselier
017e1aab88 Initialize pointer in string conversion helpers to prevent MSAN diagnostic.
Since the initialization of the pointer happens across the libc library boundry
MSAN will not know the pointer was initialized. This fixes MSAN failures in
test/strings/string.conversions.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222052 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 22:23:57 +00:00
Eric Fiselier
1383dc5bd0 add debug info when compiling sanitizer tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222051 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 22:18:03 +00:00
Eric Fiselier
fd2848735a Add -gline-tables-only when compiling w/ sanitizers in RELEASE
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222035 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 20:38:07 +00:00
Eric Fiselier
50ada3a8f7 [libcxx] Fix memory leak in strstream tests.
Summary: The strstream function `str()` sets `freeze(true)`. When `freeze` is true the destructor is not allowed to free any dynamically allocated memory. The memory leak causes ASAN to fail on these tests. To ensure memory is deallocated `strstream.freeze(false)` is called at the end of the tests.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6261

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 19:10:43 +00:00
Eric Fiselier
d759095887 [libcxx] Fix vector annotator size increase in vector::insert(pos, count, value)
Summary:
The size of the vector is being increased by `__n` during the call to `__move_range` and not by 1.
This fixes a test failure in `containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp` when using ASAN.

Reviewers: danalbert, kcc, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6264

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222014 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 18:28:36 +00:00
Eric Fiselier
1c3b15d339 Split string capacity test into two parts and mark one part as UNSUPPORTED when using sanitizers.
The test is split such that:
- max_size.pass.cpp tests that string::resize() fails to allocator for max_size
  and max_size -1
- over_max_size.pass.cpp tests that string::resize() throws a length error for
  max_size + 1

The test was split into two because max_size.pass.cpp cannot pass with 
sanitizers but over_max_size.pass.cpp can.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221969 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 03:16:12 +00:00
Eric Fiselier
71915c132a Mark more tests as UNSUPPORTED with ASAN and MSAN.
These tests fail for 2 reasons when using ASAN and MSAN.
1. If allocator_may_return_null=0 they will fail because null is returned
   or an exception is thrown.
2. When allocator_may_return_null=1 the new_handler is still not called. This
   results in an assertion failures.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 02:55:16 +00:00
Eric Fiselier
44678f4058 Setup llvm-symbolizer when running the tests with sanitizers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221966 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 02:47:08 +00:00
Eric Fiselier
05123a8d9f Add -O3 when testing with UBSAN. This triggers far undefined behaviour
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221964 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 02:07:52 +00:00
Eric Fiselier
2138b18080 Mark more locale tests as unsupported with ASAN and MSAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221937 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13 22:45:23 +00:00
Marshall Clow
1cf810b81b Replaced checking in string_view::remove_suffix/remove_prefix by _LIBCPP_ASSERT, since this is technically undefined behavior. Fixes PR#21496
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 22:07:10 +00:00
Marshall Clow
3f5579f0b2 Fix typo in allocator_traits::construct. This fixes PR14175, which shows up if an allocator has a no-args construct method
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 19:22:33 +00:00
Marshall Clow
c7b233d1de Fixed a typo in a paper name: 4190 --> N4190
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221690 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 16:45:50 +00:00
Marshall Clow
ac23805464 Added vector<T>::insert tests suggested by code coverage results
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221689 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 16:44:05 +00:00
Marshall Clow
3f305aefa0 EricQWF's code coverage work showed that none of the libc++ tests were exercising some code in vector<bool>. Add more tests in an attempt to get better coverage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221644 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 00:16:30 +00:00
Marshall Clow
1e895c1fd7 Update status pages for C++1z
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221601 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10 15:43:20 +00:00
Eric Fiselier
b6e0ef2deb Fix rvalue bug in __has_operator_addressof
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221398 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 21:20:10 +00:00
Eric Fiselier
341b59021c Fix operator & detection trait to check for free function overloads as well
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221395 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 20:59:18 +00:00
Eric Fiselier
69697c8506 Mark another test as UNSUPPORTED with ASAN and MSAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221275 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 17:03:47 +00:00
Eric Fiselier
829a84308e Actually mark the tests an unsupported with MSAN (not just ASAN)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 05:36:15 +00:00
Eric Fiselier
72aab5f478 Mark tests that replace operator new/delete as UNSUPPORTED with ASAN and MSAN.
tests that replace operator new/delete won't link when using ASAN and MSAN 
because these sanitizers also replace new/delete.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221236 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 05:11:41 +00:00
Eric Fiselier
1de15f518f Add test for type properties of std::reference_wrapper
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 01:54:44 +00:00
Marshall Clow
26aa8c9254 Mark string_view::to_string as const. Fixes PR21428
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221101 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-02 15:35:32 +00:00
Eric Fiselier
3be7f19317 Partial fix for building w/ libcxxrt on OSX. Patch from C Bergstrom.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221029 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:41:42 +00:00
Eric Fiselier
f53135f39b libcxxrt defines bad_array_new_length::what() so move that into a conditional compilation block
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:11:25 +00:00
Eric Fiselier
3fdac97f2a libcxxrt now implements bad_array_new_length and need to gaurd against multiple defines. Patch from Baptiste Daroussin.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220882 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 23:14:53 +00:00
Eric Fiselier
a01a62391c Fix example in documentation of target triple sanitization.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220804 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 18:03:38 +00:00
Eric Fiselier
522aaf67ea [libcxx] Delay evaluation of __make_tuple_types to prevent blowing the max template instantiation depth. Fixes Bug #18345
Summary:
http://llvm.org/bugs/show_bug.cgi?id=18345

Tuple's constructor and assignment operators for "tuple-like" types evaluates __make_tuple_types unnecessarily. In the case of a large array this can blow the template instantiation depth.

Ex:
```
#include <array>
#include <tuple>
#include <memory>
 
typedef std::array<int, 1256> array_t;
typedef std::tuple<array_t> tuple_t;

int main() {
  array_t a;
  tuple_t t(a); // broken
  t = a; // broken

  // make_shared uses tuple behind the scenes. This bug breaks this code.
  std::make_shared<array_t>(a);
}
```

To prevent this from happening we delay the instantiation of `__make_tuple_types` until after we perform the length check. Currently `__make_tuple_types` is instantiated at the same time that the length check .


Test Plan: Two tests have been added. One for the "tuple-like" constructors and another for the "tuple-like" assignment operator. 

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: K-ballo, cfe-commits

Differential Revision: http://reviews.llvm.org/D4467

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 06:31:22 +00:00
Jonathan Roelofs
cf85245c08 Test that the single-threaded lit feature is available iff the corresponding guard is #defined
http://reviews.llvm.org/D6006


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220729 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 22:39:19 +00:00
Eric Fiselier
2b0f03a2a7 Add special case handling of linux target triples that do not contain -gnu.
For targets that end it `redhat-linux` and `suse-linux` manually add the `-gnu`
section of the target since `linux-gnu` is needed in the testsuite.

This patch also moves the removal of minor and patchlevel numbers from OSX
triples to be handled when deducing the triple instead of when adding available
features.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220724 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 22:14:25 +00:00
Eric Fiselier
4889a16c9f Add test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220722 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 21:38:23 +00:00
Eric Fiselier
bff83f9aab [libcxx] use clang's __char16_t and __char32_t definitions on Linux in C++03 mode.
Summary: This fixes ODR violations in C++03 mode in test/localization/locale.stdcvt. The special case for linux was introduced in 2010 before clang always defined __char16_t and __char32_t.

Reviewers: mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5930

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220716 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 20:29:05 +00:00
Eric Fiselier
62a0e01343 Fix use of operator comma in is_permutation and delete comma operator for test iterators.
The comma operators in the test iterators give better error messages when they
are deleted as opposed to not defined. Delete these functions when possible.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220715 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 20:26:25 +00:00
Eric Fiselier
e4e883e6c8 [libcxx] Remove use of uniform initialization from regex tests so that they compile in C++03.
Reviewers: danalbert, jroelofs, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5957

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220707 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 19:29:32 +00:00
Eric Fiselier
b991975439 [libcxx] Fix use of operator comma where the types can be user defined
Summary:
An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected.
Modify all the test iterators to define operator comma. 

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5929

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220706 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 19:28:20 +00:00
Marshall Clow
1d306de1a7 PR #21321 talked about implementation-defined behavior of realloc. I poo-poohed it, and was wrong. Fix the call in <locale>. Review the others, refactored some duplicated code, and found overflow bugs (and __event_cap_ was never getting updated, either).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220702 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 19:08:10 +00:00
Marshall Clow
129e07fe99 Change the comment on the closing #endif to match the condition on the corresponding #ifdef. Thanks to K-ballo for the catch. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220647 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-26 20:29:38 +00:00
Eric Fiselier
5636e63563 Change uses of sys.platform == 'linux2' to sys.platform.startswith('linux')
Although the current method is valid up till python 3.3 (which is not supported)
this seems to be a clearer way of checking for linux and moves the tests towards
python 3 compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220534 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:57:56 +00:00
Eric Fiselier
79578cd14f [libcxx] XFAIL all currently failing libc++ tests for linux.
Summary:
Pretty please? We now have a significant number of builders that test libc++. I really want those builders to be green.
Most of these failures are due to differences in locale data, including those in regex. I will continue working on fixing the locale and regex tests but there is no consensus on what the correct direction to go. 

Since the builders display a list of XFAIL tests they are by no means hidden. It just means they are expected failures. Now unexpected failures won't get mixed in with well known and expected failures.

Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5941

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220512 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 21:17:36 +00:00