Commit Graph

931 Commits

Author SHA1 Message Date
Marshall Clow
e3e7054f48 Implement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224292 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 23:57:56 +00:00
Eric Fiselier
ae9fec0bdf Add support for building libc++ as a 32 bit library
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 03:12:18 +00:00
Eric Fiselier
01f6a1410c Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI are turned off.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224095 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 02:36:23 +00:00
Jonathan Roelofs
08e3a7887f Add 'REQUIRES: long_tests' to one more long test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 22:27:49 +00:00
Jonathan Roelofs
5030eaf65d Add 'REQUIERS: long_tests' to a few more long tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224064 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 22:05:18 +00:00
Jonathan Roelofs
2f2daa1436 Fix platform_support.h's get_temp_file_name() on Newlib under __STRICT_ANSI__
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224057 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 20:56:40 +00:00
Jonathan Roelofs
cddec8a9dd Add an XFAIL for Newlib's missing uchar.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224037 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 19:11:39 +00:00
Jonathan Roelofs
d9144e8d17 Mark a bunch of long running tests as 'REQUIRES: long_tests'
This lets us skip them as UNSUPPORTED on slow systems like QEMU


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 18:35:36 +00:00
Jonathan Roelofs
952438bf70 Mark some more fenv tests as UNSUPPORTED by newlib
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 16:17:26 +00:00
Jonathan Roelofs
f2bd5a0fe1 Add an XFAIL for Newlib's missing fenv.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 15:37:22 +00:00
Marshall Clow
8283709e91 Move the optional tests into test/experimental. They were put into test/utilities because optional was going to be part of C++14, and then was pulled and put into the Library Fundamentals TS instead. No funcitonality change here; just moving files around.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223778 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 15:07:42 +00:00
Marshall Clow
4ad67e08cb Add all the relational operators to std::experimental::optional. Also update bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223775 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 14:49:17 +00:00
Eric Fiselier
2764d046a1 Give lit.cfg's threading options default values when not defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223601 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 08:52:19 +00:00
Eric Fiselier
427f1a3014 Mark a couple of tests as XFAIL with older compilers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223600 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 05:31:17 +00:00
Eric Fiselier
cd83c78703 Consolidate error reporting in lit.cfg
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 04:28:50 +00:00
Eric Fiselier
2050be27a4 Revert parts of r223594. Use DYLD_LIBRARY_PATH on OSX when running tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223598 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 00:34:23 +00:00
Eric Fiselier
74e7af0d75 Fix apple clang detection in lit.cfg
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223597 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 22:49:38 +00:00
Eric Fiselier
83313c7ee8 Unify and cleanup rpath handling in tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223594 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 22:08:51 +00:00
Eric Fiselier
c934ca7237 [libcxx] Add logic to probe compiler in tests.
Summary:
This patch probes the cxx compiler used during testing by getting it to dump its predefined macros. Based on the value of these macros the compiler name and compiler name + version are added to the available features.

There are three compiler names:
- `clang`
- `apple-clang`
- `gcc`.

The available features added are equivalent to:
- `'%s' % compiler_name`
- `'%s-%s.%s' % compiler_name, major_version, minor_version`

This information can be used to XFAIL tests on different compilers / versions.



Reviewers: mclow.lists, danalbert, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 21:13:15 +00:00
Eric Fiselier
7330ed3228 Add support for building and testing libc++ without threads to CMake.
Currently hacks must be used in to configure and build libc++ without threads
when using CMake. This patch adds CMake options to enable/disable building with
threads and a monotonic clock.

This patch also propagates the configuration information to lit so the tests
are properly configured as well.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223591 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 21:02:58 +00:00
JF Bastien
2bd5ffd330 libc++: add NaCl and PNaCl support for std::random_device
Summary:
The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.

This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).

Test Plan: ninja check-libcxx

Reviewers: dschuff, mclow.lists, danalbert

Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223068 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 19:19:55 +00:00
JF Bastien
6317e9b85a libc++: integral types trap on PNaCl
Reviewers: dschuff, danalbert

    Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222842 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26 17:51:58 +00:00
Eric Fiselier
bd0000808d Use lit.util.executeCommand instead of our own version
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 03:03:32 +00:00
Eric Fiselier
e6e69df598 Print lit configuration information after all configuration is done.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222711 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 23:46:42 +00:00
Dan Albert
877409a1c7 Add better support for custom test runners.
Summary:
I finally got around to merging the many, many changes to lit.cfg into
Android's libc++. This patch makes it simpler to actually use a custom
configuration and test format.

First, I've factored out _build, _run, and _clean methods from
_execute_test, since these are the likely parts that will need to be
overridden. This is likely a first step in the work jroelofs has been
doing with improving cross-compiling test execution.

Second, I've added a `configuration_variant` to the config. This
entry, if present, is a string that forms the prefix of the class that
is to be used to configure the test runner. For example, Android sets
`config.configuration_variant = 'Android'`, and this causes an object
of type `AndroidConfiguration` to be constructed.

As an example of how this will be used, see:
https://android-review.googlesource.com/#/c/116022/

Reviewers: jroelofs, mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222698 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 22:24:06 +00:00
Eric Fiselier
1567ac850c Handle extra whitespace in linux distribution name.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222514 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 08:54:35 +00:00
Eric Fiselier
aeff14fc74 Mark some locale tests as XFAIL on debian and opensuse.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222513 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 08:02:38 +00:00
Dan Albert
5980ce383f Add more REQUIRES: LOCALE.* to tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222492 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 01:23:04 +00:00
Eric Fiselier
2c7a32ff0f Remove xfail tag for darwin from quick_exit test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20 03:40:32 +00:00
Eric Fiselier
c5e361d024 Remove tests that va_copy is not defined when C++ < 11.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222405 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20 03:39:25 +00:00
Eric Fiselier
19fdbe53b7 Change contradictory wording in va_copy test error message.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 20:01:26 +00:00
Marshall Clow
03c6791dc6 Implement N4280 - 'Non-member size() and more'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 19:43:23 +00:00
Eric Fiselier
c2f0e465ca Overhaul and separate nullptr_t tests to pass with C++03.
The standard requires that nullptr_t can be reinterpret_cast to an integral type
at least the size of nullptr_t. There is no way to emulate this conversion in
the C++03 nullptr_t implementation. The test for this conversion has been moved
to a new test and marked XFAIL with c++03.

This recommits what was originally r222296.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 05:49:03 +00:00
Eric Fiselier
33c5db58e7 Revert r222296 to fix bad commit message
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 05:41:29 +00:00
Eric Fiselier
221907d782 Cleanup quick_exit tests and get them passing in C++03.
Wrap the original test in _LIBCPP_HAS_QUICK_EXIT so it only runs when we have
quick_exit and add two new tests that check that when _LIBCPP_HAS_QUICK_EXIT
is not defined then no definition of std::at_quick_exit or std::quick_exit are
available.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222298 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 01:45:12 +00:00
Eric Fiselier
0bb95849ec diff --git a/test/language.support/support.types/nullptr_t.pass.cpp b/test/language.support/support.types/nullptr_t.pass.cpp
index 6c15fef..4d7c8b0 100644
--- a/test/language.support/support.types/nullptr_t.pass.cpp
+++ b/test/language.support/support.types/nullptr_t.pass.cpp
@@ -18,42 +18,62 @@ struct A
     A(std::nullptr_t) {}
 };
 
+template <class T>
+void test_conversions()
+{
+    {
+        T p = 0;
+        assert(p == nullptr);
+    }
+    {
+        T p = nullptr;
+        assert(p == nullptr);
+        assert(nullptr == p);
+        assert(!(p != nullptr));
+        assert(!(nullptr != p));
+    }
+}
+
+template <class T>
+void test_comparisons()
+{
+    T p = nullptr;
+    assert(p == nullptr);
+    assert(p <= nullptr);
+    assert(p >= nullptr);
+    assert(!(p != nullptr));
+    assert(!(p < nullptr));
+    assert(!(p > nullptr));
+    assert(nullptr == p);
+    assert(nullptr <= p);
+    assert(nullptr >= p);
+    assert(!(nullptr != p));
+    assert(!(nullptr < p));
+    assert(!(nullptr > p));
+}
+
+
 int main()
 {
     static_assert(sizeof(std::nullptr_t) == sizeof(void*),
                   "sizeof(std::nullptr_t) == sizeof(void*)");
-    A* p = 0;
-    assert(p == nullptr);
-    void (A::*pmf)() = 0;
-#ifdef __clang__
-    // GCC 4.2 can't handle this
-    assert(pmf == nullptr);
-#endif
-    int A::*pmd = 0;
-    assert(pmd == nullptr);
-    A a1(nullptr);
-    A a2(0);
-    bool b = nullptr;
-    assert(!b);
-    assert(nullptr == nullptr);
-    assert(nullptr <= nullptr);
-    assert(nullptr >= nullptr);
-    assert(!(nullptr != nullptr));
-    assert(!(nullptr < nullptr));
-    assert(!(nullptr > nullptr));
-    A* a = nullptr;
-    assert(a == nullptr);
-    assert(a <= nullptr);
-    assert(a >= nullptr);
-    assert(!(a != nullptr));
-    assert(!(a < nullptr));
-    assert(!(a > nullptr));
-    assert(nullptr == a);
-    assert(nullptr <= a);
-    assert(nullptr >= a);
-    assert(!(nullptr != a));
-    assert(!(nullptr < a));
-    assert(!(nullptr > a));
-    std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
-    assert(i == 0);
+
+    {
+        test_conversions<std::nullptr_t>();
+        test_conversions<void*>();
+        test_conversions<A*>();
+        test_conversions<void(*)()>();
+        test_conversions<void(A::*)()>();
+        test_conversions<int A::*>();
+    }
+    {
+        test_comparisons<std::nullptr_t>();
+        test_comparisons<void*>();
+        test_comparisons<A*>();
+        test_comparisons<void(*)()>();
+    }
+    {
+        bool b = nullptr;
+        assert(!b);
+    }
 }
diff --git a/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp b/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp
new file mode 100644
index 0000000..92bd879
--- /dev/null
+++ b/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp
@@ -0,0 +1,17 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// typedef decltype(nullptr) nullptr_t;
+
+#include <cstddef>
+
+int main()
+{
+    std::ptrdiff_t i = static_cast<std::ptrdiff_t>(nullptr);
+}
diff --git a/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp
new file mode 100644
index 0000000..34c7a93
--- /dev/null
+++ b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// NOTE: nullptr_t emulation cannot handle a reinterpret_cast to an
+// integral type
+// XFAIL: c++98, c++03
+
+// typedef decltype(nullptr) nullptr_t;
+
+
+#include <cstddef>
+#include <cassert>
+
+int main()
+{
+    std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
+    assert(i == 0);
+}


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222296 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 01:31:56 +00:00
Eric Fiselier
1f8e21c6a3 Modify tests to check that va_copy is only defined in C++11 and beyond.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222282 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 23:46:18 +00:00
Eric Fiselier
f2215ae626 Flush out test cases for tuples constructor SFINAE
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222278 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 23:01:57 +00:00
Eric Fiselier
af2976deb3 Add support for LLVM_USE_SANITIZER=Thread
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222259 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 21:26:45 +00:00
Marshall Clow
7683fe2b7a Add a test for LWG issue #2399. We already implement this, but now we have a test as well.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222242 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 18:14:53 +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
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
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
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
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
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
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
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
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
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
Eric Fiselier
29151f64e4 Only link tests against -ldl on linux
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 20:45:37 +00:00
Eric Fiselier
4d2413ca4b Add support for "fancy" pointers to promise and packaged_task.
Summary:
This patch is very closely related to D4859. Please see http://reviews.llvm.org/D4859 for more information.

This patch adds support for "fancy" pointers and allocators to promise and packaged_task. The changes made to support this are exactly the same as in D4859.



Test Plan: "fancy" pointer tests were added to each constructor affected by the change.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 06:24:45 +00:00
Eric Fiselier
4e7d53664d Add support for "fancy" pointers to shared_ptr. Fixes PR20616
Summary:
This patch add support for "fancy pointers/allocators" as well as fixing support for shared_pointer and "minimal" allocators.

Fancy pointers are class types that meet the NullablePointer requirements. In our case they are created by fancy allocators. `support/min_allocator.h` is an archetype for these types.

There are three types of changes made in this patch:
1. `_Alloc::template rebind<T>::other` -> `__allocator_traits_rebind<_Alloc, T>::type`. This change was made because allocators don't need a rebind template. `__allocator_traits_rebind` is used instead of `allocator_traits::rebind` because use of `allocator_traits::rebind` requires a workaround for when template aliases are unavailable.
2. `a.deallocate(this, 1)` -> `a.deallocate(pointer_traits<self>::pointer_to(*this), 1)`. This change change is made because fancy pointers aren't always constructible from raw pointers. 
3. `p.get()` -> `addressof(*p.get())`. Fancy pointers aren't actually a pointer. When we need a "real" pointer we take the address of dereferencing the fancy pointer. This should give us the actual raw pointer.

Test Plan: Tests were added using `support/min_allocator.h` to each affected shared_ptr overload and creation function. These tests can only be executed in C++11 or greater since min_allocator is only available then. A extra test was added for the non-variadic versions of allocate_shared. 

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 04:12:28 +00:00
Marshall Clow
9b82e151fe Fix a couple of failing tests for C++03 by checking for rvalue reference support first.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220465 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 03:57:52 +00:00
Eric Fiselier
3de9baafba Add -ldl to libc++ tests when sanitizers are used.
Clang 3.6 no longer links the sanitizer runtime library dependancies when
-nodefaultlibs is used. This patch manually links in a missing dependancy.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220463 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 02:54:15 +00:00
Marshall Clow
4a655fdde5 Some tests used __typeof__ instead of decltype. Replace these usages.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220296 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 15:07:09 +00:00
Marshall Clow
8148fdb5d2 LWG #2212 (not yet adopted) mandates that tuple_size/tuple_element are available if <array> or <utility> are included (not just <tuple>). We already do this. Add some tests to make sure that this remains true.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220295 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 15:05:31 +00:00
Eric Fiselier
cb7e32c290 [libcxx] Redo adding support for building and testing with an ABI library not along linker paths
Summary:
This is the second attempt at allowing for the use of libraries that the linker cannot find. The first attempt used `CMAKE_LIBRARY_PATH` and `find_library` to select which ABI library should be used. There were a number of problems with this approach:

- `find_library` didn't work with cmake targets (ie in-tree libcxxabi build)
- It wasn't always possible to determine where `find_library` actually found your library.
- `target_link_libraries` inserted the path of the ABI library into libc++'s RPATH when `find_library` was used.
- Linking libc++ and it's ABI library is a special case. It's a lot easier to keep it simple. 

After discussion with @cbergstrum a new approach was decided upon.
This patch achieve the same ends by simply using `LIBCXX_CXX_ABI_LIBRARY_PATH` to specify where to find the library (if the linker won't find it). When this variable is defined it is simply added as a library search path when linking libc++. It is a lot easier to duplicate this behavior in LIT. It also prevents libc++ from being linked with an RPATH.






Reviewers: mclow.lists, cbergstrom, chandlerc, danalbert

Reviewed By: chandlerc, danalbert

Subscribers: chandlerc, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220157 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-19 00:42:41 +00:00
Eric Fiselier
f4c53dacaf Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-19 00:10:15 +00:00
Marshall Clow
38d9005902 Whitespace maintenance. Remove a bunch of tabs that snuck in. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220142 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-18 11:03:33 +00:00
Eric Fiselier
9071bc098b [libcxx] Add support for building and testing with an ABI library not along linker paths
Summary:
This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find.

- `CMAKE_LIBRARY_PATH` is used to specify the list of search directories.
- The ABI library is now found using `find_library` instead of assuming its along the linker's search path.
- `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`.
- For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>`

Some changes in existing behavior were also added:
- `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`.
- `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`.




Reviewers: mclow.lists, danalbert, EricWF

Reviewed By: EricWF

Subscribers: emaste, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220118 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-18 01:15:17 +00:00
Eric Fiselier
950ee77d24 [libcxx] Fix SFINAE in <cmath>. Patch from K-Ballo.
Delay instantiation of `__numeric_type` within <cmath>, 
don't instantiate it when the `is_arithmetic` conditions do not hold as it causes
errors with user-defined types with ambiguous conversions. Fixes PR21083.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@219998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 00:31:47 +00:00
Eric Fiselier
66d529f0ad [libcxx] Add support for LLVM_USE_SANITIZER=Undefined
LLVM_USE_SANITIZER=Undefined support was added to the LLVM CMake configuration.
Update libc++'s handling of LLVM_USE_SANITIZER to support this as well.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@219987 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16 23:21:59 +00:00
Marshall Clow
bbc7c74fbb Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks to Louis Dionne for the bug report and the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@219785 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 10:33:02 +00:00
Marshall Clow
df9722ecf1 Fix for PR 19616: 'tuple_cat of nested tuples fails in noexcept specification'. Thanks to Louis Dionne for the fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@219243 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 21:42:12 +00:00
Marshall Clow
d132bf4ef1 Fix some type-traits (is_assignable, etc) dealing with classes that take non-const references as 'right hand side'. Add tests. Fixes PR# 20836
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@218286 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-22 23:58:00 +00:00
Marshall Clow
5ffb8d0fbe Fix PR#20843: binomial_distribution<unsigned> is broken. Add test to ensure that signed and unsigned verstions produce the same sequence.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217976 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 18:33:58 +00:00
Marshall Clow
01c6bbd947 Add include of <cassert> for the operator comma
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217938 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 04:09:35 +00:00
Marshall Clow
270f8e01e8 Create a 'comma_iterator' class that overloads operator, and asserts when it's called. Add tests to mismatch to make sure it can't be blindsided by such an evil iterator. More tests for other algorithms forthcoming. Thanks to STL for pointing this out at CppCon and Yakov Galka for opening LWG issue #2133
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217902 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 20:38:11 +00:00
Marshall Clow
4413ab09d5 Fix a bug in the move-assigment operator for basic_stringbuf. Thanks to Johnathan Wakeley for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217894 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 18:57:52 +00:00
Dan Albert
7ba3c57565 PR20546: Fix tests for compare_exchange_weak.
These calls are allowed to fail spuriously.

29.6.5.25:

    Remark: A weak compare-and-exchange operation may fail spuriously.
    That is, even when the contents of memory referred to by expected
    and object are equal, it may return false and store back to expected
    the same memory contents that were originally there. [ Note: This
    spurious failure enables implementation of compare and-exchange on a
    broader class of machines, e.g., load-locked store-conditional
    machines. A consequence of spurious failure is that nearly all uses
    of weak compare-and-exchange will be in a loop.

To fix this, we replace any assert() that expects
std::atomic::compare_exchange_weak() to return true with a loop. If the
call does not return true within N runs (with N currently equal to 10),
then the test fails.

http://llvm.org/bugs/show_bug.cgi?id=20546


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-06 20:38:25 +00:00
Jonathan Roelofs
8d86b2e686 Allow libc++ to be built on systems without POSIX threads
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.

http://reviews.llvm.org/D3969


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217271 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 19:45:05 +00:00
Jonathan Roelofs
d634a2c404 Bugfix: allow additional_features to be empty
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217268 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 19:03:46 +00:00
Jonathan Roelofs
217bdc189a Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on available_features
http://reviews.llvm.org/D5214


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 17:21:57 +00:00
Justin Bogner
464da3b76c test: Make it possible to opt in to use_clang_verify per test
This modifies the use_clang_verify parameter I added in r217009 to
only apply to tests that specifically ask for it via // USE_VERIFY.
This allows us to incrementally convert tests, but start enjoying the
benefits right away.

Suggested by Eric Fiselier in code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 06:01:52 +00:00
Eric Fiselier
438d2cb25d Fix buffer overflow issue in valarray test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 05:47:35 +00:00
Justin Bogner
837cfe50fe test: Allow using clang -verify for failures rather than exit 1
Currently, failure tests work by checking that compilation exits 1.
This can lead to tests that fail for the wrong reason, so it'd be
preferable to convert them to check for specific errors.

This adds use_clang_verify parameter that runs failure tests using
clang's -verify flag. I'll convert some tests in subsequent commits,
and once all of the tests are converted we should key this on whether
cxx_under_test is clang.

I've also converted one of the unique.ptr tests, since it's the one
that motivated the idea of using clang -verify when possible in the
review of r216317.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 04:32:08 +00:00
Kostya Serebryany
497f912ab2 [asan] Make vector asan annotations exception-friendly
Fix vector asan annotations with RAII.
Add a test.
Also, remove one dead function.
Review: http://reviews.llvm.org/D4170



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 23:43:38 +00:00
Jonathan Roelofs
c5780651c3 Partially address a FIXME in steady_clock::now()
http://reviews.llvm.org/D4045


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216949 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 21:14:38 +00:00
Marshall Clow
e33e03e558 Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216909 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 16:19:38 +00:00
Eric Fiselier
b26c966174 Mark test types for <atomic> nothrow default constructible. Patch from Steve MacKenzie.
The way the standard currently specifies the default constructor for atomic<T>
requires T to be nothrow default constructible. This patch makes our test types
meet this requirement.

Note: The nothrow default constructible requirment is subject to the outcome of
LWG issue 1265.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 17:00:11 +00:00
Marshall Clow
4de32048f5 Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for count(). Thanks to Jim Porter for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216353 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 23:54:16 +00:00
Eric Fiselier
a564dc53dd Fix assignments that should be comparisons x3
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 07:55:29 +00:00
Eric Fiselier
69e7c05783 Add return statement to a test class's assignment operator. Defect found by Coverity Scan.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 06:36:11 +00:00
Eric Fiselier
1070916643 [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args.
Summary:
In order to gather more information about testsuite results these flags should be added to LIT's default args.
These new switches were recently added to LIT. It been more than two weeks since both switches were added.
I think its time we add these to our LIT flags.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216315 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:33:20 +00:00
Eric Fiselier
ae6e58c561 Fix handling of format strings to work with python 2.6
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:02:21 +00:00
Dan Albert
2c26213103 Refactor lit.cfg.
The purely imperative format of the configuration performed in lit.cfg
was making merge conflicts with changes I have for Android an
unbelievable pain in the ass. I've moved all of the configuration into a
Configuration class, with each piece of configuration happening in a
different method. This way I can avoid merge conflicts, and any new
features that get added (as have been done with the sanitizers, the -std
flag, etc.) can be easily applied to Android as well.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 17:30:44 +00:00
Eric Fiselier
501561910a Mark some localization time tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:38:21 +00:00
Eric Fiselier
51642a4e81 Mark some localization monetary tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:22:54 +00:00
Eric Fiselier
f523693f3f Mark localization ctype tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:03:01 +00:00
Eric Fiselier
682132b4cc fix missing include for ::close in platform_support.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 17:52:40 +00:00
Eric Fiselier
bc4bcf051b Add extra test case for PR20345. Should have been commited with r215984
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215985 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:33:05 +00:00
Eric Fiselier
63648cffc0 Fix is_member_function_pointer does not account for ellipsis. PR20345. Patch from Agustin Berge.
I reviewed the patch and added the test cases.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215984 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:31:47 +00:00
Jonathan Roelofs
6f10d47bbc Give libcxx tests temporary filenames that are actually unique.
This fixes a race condition on temp file name creation.

http://reviews.llvm.org/D4962


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215977 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 13:56:56 +00:00
Eric Fiselier
6661ad10f2 Add standard version to lit.cfg's available features
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 07:05:40 +00:00
Eric Fiselier
da98ce033e [libcxx] Add UNSUPPORTED tag to lit. It mirrors REQUIRES.
Summary:
This patch adds support for // UNSUPPORTED: feature. If an excluded feature is found in the list of available features then the test is marked unsupported.

I hope to use this to mark test unsupported if the fail with msan on asan. As well as tests that fail in particular standard modes.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215883 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 06:43:06 +00:00
Eric Fiselier
781448f48a Mark cuchar tests as always xfail since we don't provide the header'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215873 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:09:51 +00:00
Eric Fiselier
25a1516832 [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree
Summary:
This patch adds support for LLVM_USE_SANITIZER when being built in-tree and standalone. 

This patch does the following things:
1. define the LLVM_USE_SANITIZER option to "" when being built standalone. This also helps show we support it.
2. Translate LLVM_USE_SANITIZER when standalone in a very similar way done in llvm/cmake/HandleLLVMOptions.cmake.
3. Add config.llvm_use_sanitizer to lit.site.cfg.in
4. Add code to translate config.llvm_use_sanitizer's value into the needed compile flags in lit.cfg.

Currently lit.cfg assumes that that the compiler supports '-fno-omit-frame-pointer' while CMakeLists.txt actually checks to see if its supported. We could pass this information to lit but I'm not sure its needed. 

Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215872 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:03:46 +00:00
Eric Fiselier
dfe5e72ed3 [libcxx] Update the way the -std= flag is chosen by CMake and LibcxxTestFormat
Summary:
This patch does two things:
CMake Update:
  - Add compiler flag checks for -std=c++11 and -std=c++1y and remove check for -std=c++0x.
  - Add configuration option LIBCXX_ENABLE_CXX1Y to prevent/allow -std=c++1y from being chosen as the std version. LIBCXX_ENABLE_CXX1Y is set to OFF by default.
  - if LIBCXX_ENABLE_CXX1Y is enabled then set LIBCXX_STD_VERSION to c++1y and fail if the compiler does not support -std=c++1y
  - If c++1y is not enabled then use c++11 and fail if the compiler does not support c++11.

Lit Update:
  - Update lit.site.cfg.in to capture LIBCXX_STD_VERSION information as config.std.
  - Remove mentions of has_cxx0X configuration option.
  - Check for `--param std=X' passed to lit on the command line.
  - Choose the std for the tests either from command line parameter or (if it doesn't exist) the lit.site.cfg.



Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: emaste, rnk, ajwong, danalbert, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215802 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-16 01:35:36 +00:00
Eric Fiselier
b4b32a02fa Readding FreeBSD support to lit.cfg. Patch from Pawel Worach.
Pawel has been using this patch on his buildbots for a while. This should
allow the testsuite to run on FreeBSD with libcxxrt.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 23:24:00 +00:00
Jonathan Roelofs
09d8c46f30 Tame a few enum size tests when using -fshort-enums on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 21:34:52 +00:00
Eric Fiselier
efefe8ba34 Revert get testsuite running on FreeBSD.
There is a similar patch up for review. I'll submit my changes via that.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215750 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:49:28 +00:00
Eric Fiselier
101e2f3e06 Get testsuite running on FreeBSD.
Add initial support for using LIT to run the tests on FreeBSD. 
More work may need to be done to add support for FreeBSD but this is a
good initial step.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:00:47 +00:00
Eric Fiselier
c808961618 Fix incorrect locale requirements in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 05:02:05 +00:00
Eric Fiselier
31b9c44aa7 Add bare_allocator archetype that implements the minimal possible allocator interface.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215691 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 04:15:41 +00:00
Eric Fiselier
5b34a5f584 Change two tests to be less dependant on locales.
This patch removes the use of the "%c" specifier for getting/setting times.
The semantics of this specifier differ between linux and Mac. I don't believe
the use of this specifier was important to the test.

The following tests now pass on linux.
test/input.output/iostream.format/ext.manip/get_time.pass.cpp
test/input.output/iostream.format/ext.manip/put_time.pass.cpp

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215417 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:48:56 +00:00
Eric Fiselier
f4124610c2 Add return statement to slice_array and mask_array assignment. Closes PR20614.
This patch just adds the required return statements to slice_array::operator=
and mask_array::operator=.

Tests were added to check that the return value is the same as the object assigned
to.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:06:58 +00:00
Eric Fiselier
e48b0c40ad fix stdio.h test to reflect removal of ::gets in c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215329 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-10 22:39:11 +00:00
David Blaikie
ddcbcd6b5e Revert "Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state."
Premature commit due to misreading CR feedback.

This reverts commit r215301.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:42:19 +00:00
David Blaikie
5eb396a8e6 Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state.
Some tests were constructing it with 0, so use -1 as the invalid state
instead.

Reviewers: Marshall Clow

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215301 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:35:47 +00:00
Eric Fiselier
ae39e4f795 fix copy and pasted comment in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:43:16 +00:00
Eric Fiselier
2af66e9851 Mark math.h and cmath tests as xfail on linux.
These tests were marked as failing because the libc implementation does not
use the proper return type on certain math functions. There is other weirdness
that prevents us from defining our own version of these functions.

The failing tests in cmake were separated into their own files so that the rest
failures in the rest of the cmath tests were not hidden.

This was not done for the math.h test since we don't actually supply math.h


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215275 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:39:03 +00:00
Marshall Clow
095c3dd23e Apply a similar fix to <forward_list> as I did for <list> in r215210. Again, thanks to Ion Gaztañaga for noticing this problem w.r.t LWG#526
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215213 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:58:00 +00:00
Marshall Clow
fca038e133 While reading LWG#526, Ion Gaztañaga noticed that libc++ didn't correctly handle list::remove(const value_type &x), if x was an element of the list. Added a test for this, and a fix. Thanks to Ion for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:35:52 +00:00
Viktor Kutuzov
f2e8c04540 Fix re-building in-tree libc++ against in-tree libc++abi
Differential Revision: http://reviews.llvm.org/D4805


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 06:53:30 +00:00
Dan Albert
c09c2865b9 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214768 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 20:27:45 +00:00
Marshall Clow
529d303340 Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214760 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 19:20:17 +00:00
Dan Albert
b4ed5ca01e Add locales to available_features for tests.
Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.

This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.

One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 18:44:48 +00:00
Marshall Clow
f0f1bca861 Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 17:32:25 +00:00
Eric Fiselier
d3d01eac01 Change lit.cfg to allow whitespace before comments
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 22:56:52 +00:00
Marshall Clow
c5eb69601b Add test cases for creating atomic types for trivially copyable types.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 15:20:48 +00:00
Marshall Clow
15269a8796 Fix numeric_limits<XXX>::is_modulo for signed arithmetic types. We were reporting true, for all arithmetic types, which is incorrect. Fix the tests which were wrong, too. This fixes PR#20158.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214371 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 01:18:05 +00:00
Dan Albert
1757386944 Base regex code on char_class_type.
__get_classname() and __bracket_expression were assuming that
char_class_type was ctype_base::mask rather than using
regex_traits<_CharT>::char_class_type.

This change allows char_class_type to be defined to something other than
ctype_base::mask so that the implementation will still work for
platforms with an 8-bit ctype mask (such as Android and OpenBSD).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214201 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 19:23:39 +00:00
Eric Fiselier
3ee7233c80 [libcxx] expose experimental::erased_type for all standard versions.
Summary: The polymorphic allocator implementation would greatly benefit by defining virtual functions in the dynlib instead of inline. In order to do that some types are going to have to be available outside of c++1y. This is the first step.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213889 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 19:17:38 +00:00
Eric Fiselier
9020c08989 D4451: Fix copy/move issues casude by __tuple_leafs's converting constructor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213888 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 18:48:34 +00:00
Eric Fiselier
08b8506930 test commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213887 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 18:41:56 +00:00
David Majnemer
cb8757aca7 Fix std::make_heap's worst case time complexity
std::make_heap is currently implemented by iteratively applying a
siftup-type algorithm.  Since sift-up is O(ln n), this gives
std::make_heap a worst case time complexity of O(n ln n).

The C++ standard mandates that std::make_heap make no more than O(3n)
comparisons, this makes our std::make_heap out of spec.

Fix this by introducing an implementation of __sift_down and switch
std::make_heap to create the heap using it.
This gives std::make_heap linear time complexity in the worst case.

This fixes PR20161.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213615 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 06:07:09 +00:00
Marshall Clow
d5549ccac1 Fix bug #20335 - memory leak when move-constructing a string with unequal allocator. Thanks to Thomas Koeppe for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213269 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 15:32:20 +00:00
Eric Fiselier
b1a40264dc [libcxx] Add <experimental/utility> header for LFTS.
Summary:
This patch adds the `<experimental/utility>` header as specified in the latest draft of the library fundamentals TS.

`<experimental/utility>` only contains `class erased_type`. 

This patch also updates the documentation to list the `erased_type` class as "initial implementation complete".

Test Plan:
Three test cases where added:

1. Test that `_LIBCPP_VERSION` is defined.
2. Test that `<utility>` has been included.
3. Test that `erased_type` is in the correct namespace and is constexpr default constructible.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:31:31 +00:00
Eric Fiselier
9b2b60cab8 Test commit: Reverting whitespace changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:10:03 +00:00
Eric Fiselier
ad250c17df Test commit: whitespace change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213222 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:06:09 +00:00
Marshall Clow
2b44e3dd49 Correctly implement LWG 2049; std::is_destructible.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213163 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 15:51:50 +00:00
Marshall Clow
7778249d2d Fix warning in test - missing exception specifier for overload of operator new
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:19:50 +00:00
Marshall Clow
bbeca21f26 Add a reset method to the counting predicates in the test suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212651 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09 21:04:22 +00:00
Marshall Clow
484728789e string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 22:38:11 +00:00
Marshall Clow
51349536aa Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 15:19:40 +00:00
Marshall Clow
3a61b30f3a Minor cleanup for string_view; mostly from suggestions by Richard Smith. Also, make the tests pass under c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-02 15:45:57 +00:00
Marshall Clow
2f9e714071 Fix libc++ bug #20039: 'Constructing std::function from empty compatible std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 21:27:51 +00:00
Marshall Clow
c8c7abae66 Add checking for the complexity guarantees in the standard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 05:04:20 +00:00
Marshall Clow
164b297099 Implement string_view from the library fundamentals TS (n4023). Also works in C++11 and 03, with reduced functionality (mostly in the area of constexpr)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11 16:44:55 +00:00
Marshall Clow
675dd5cc4f Mark assign to be constepr only in c++14; can't have constexpr fns that return void in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210562 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:52:57 +00:00
Marshall Clow
c1345e3262 A bunch of the char.traits tests were using unicode literals. #ifdef those bits out on c++03, since it doesn't support u"" and U "" style strings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210560 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:46:59 +00:00
Marshall Clow
281918b6aa Testing infastructure: A template for char_traits where all the functions are constexpr, and a comparison predicate which counts how many times it's been called.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 22:33:40 +00:00
David Majnemer
0707b67ac3 Handle partial nanosleeps in this_thread::sleep_for
Signals may result in nanosleep returning with only some of the
requested sleeping performed.

Utilize nanosleep's "time-remaining" out parameter to continue sleeping
when this occurs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:43:20 +00:00
Nico Weber
981b01d9d0 Make meta.trans.other/aligned_storage.pass.cpp pass on arm.
The maximum alignment on arm is 8, not 16 like on x86. Use alignof(max_align_t)
to make the test work in both cases.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 16:25:58 +00:00
David Majnemer
4d9f97b40b [libc++] Don't return uninitialized data from random_device::operator()
Make sure we appropriately retry calls to read if the return result is
less than what we asked for.

Additionally, check and handle IO errors: EINTR results in the read
operation getting restarted; other errors turn into exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210061 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:40:39 +00:00
David Majnemer
8db32cc2ac [libc++] random_device fails if open returns zero
random_device::random_device(const string&) wrongly assumes that open
can only validly return a file descriptor greater than zero.

This results in random_device believing that it didn't successfully open
the device causing it to throw in it's constructor, this ends up leaking
a file descriptor.

The fix is simple, don't error on file descriptors which are zero.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:21:37 +00:00
Nico Weber
4074d6ea30 Remove unused code in a libc++ test.
Other tests in this directory use this type, so it's probably copypasta from
there.

(test_buf only forwards to the superclass in all tests where it's used though,
so I wonder if it can be replaced with just using filebuf / wfilebuf
everywhere?)


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 12:00:08 +00:00
Justin Bogner
e39915bdc5 Fix XFAIL condition from r208840
The XFAILs in r208840 were too general. They were meant to only apply
to testing when use_system_lib was set.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209972 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-31 07:59:03 +00:00
Nico Weber
d32add4a48 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209819 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 14:58:38 +00:00
David Majnemer
fcafd80ace Linux: Correctly identify valid error codes
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.

Linux reserves up to and including 4095 for errno values, use this as a
bound.

This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209795 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 05:02:22 +00:00
Marshall Clow
4f3368e269 Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209785 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 01:10:28 +00:00
Marshall Clow
52a708fbca Fix bug 19840, where some tests were not testing what we wanted. Thanks to Eric for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 15:30:23 +00:00
Marshall Clow
6b7e6921e2 Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:29:50 +00:00
Marshall Clow
117563c516 Fix bug 19740; round-tripping a pointer through a stream doesn't work
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:02:20 +00:00
Alp Toker
08f8ac6951 Fix typo 'fourty' in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208870 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:33:29 +00:00
Alp Toker
ec34c48976 Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208869 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:27:39 +00:00
Justin Bogner
5fda8338b2 Work around ABI differences due to LWG 2056 in tests
When testing against the system library, there is a relatively minor
ABI breakage that the std::future_errc values have been changed to
avoid using zero. Update the tests that rely on the values being
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 01:57:42 +00:00
Justin Bogner
bdfc0ad2ea Remove XFAIL from a number of tests that aren't expected to fail
These tests haven't been failing on darwin11 or 12 since r189610 when
pr17027 was fixed, but they've been keeping the libc++ bot red by
XPASSing since then.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208831 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 00:55:44 +00:00
Marshall Clow
1f50f2d64b Add Address Sanitizer support to std::vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08 14:14:06 +00:00
Marshall Clow
6b5be703db Fix PR 19663. Some calls to find(vector<bool>) were returning iterators that were subtly invalid (didn't compare equal). Thanks to Erik Verbruggen for the report (and diagnosis)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-06 15:33:23 +00:00
Marshall Clow
5f64a2b3c3 Fix bug #18350. Add tests for tuples of all the smart pointers (except auto_ptr)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 05:19:48 +00:00
Marshall Clow
34b571bd88 Added some tests for equal elements in min_element and max_element. Bug #19547 was invalid, but we weren't testing that case
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207232 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 15:50:54 +00:00
Marshall Clow
398c9d882b Default the copy and move constructors for __tuple_leaf. This fixes bugs 18853 and 19118. Add a test case for that.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 23:48:09 +00:00
Marshall Clow
88dd258984 Add more tests for std::ws as pointed out by bug #19497
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206770 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 18:12:09 +00:00
Marshall Clow
a178c13419 Bug #19473. If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206623 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 17:23:36 +00:00
Marshall Clow
f1d10875d7 Fixed a test that was attempting to use rvalue-references w/o checking to see if they were supported in the language. This resulted in a warning when testing using C++03.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 18:11:38 +00:00
Marshall Clow
f1264e7c9e Fix PR19819
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 13:32:26 +00:00
Stephan Tolksdorf
8a71d23633 [libc++] Teach is_integral, is_[un]signed and make_[un]signed about __[u]int128_t
This commit also adds tests for std::numeric_limits<__[u]int128_t>.

Reviewed in http://llvm-reviews.chandlerc.com/D2917

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204849 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 19:45:52 +00:00
Marshall Clow
f4c0c708a3 Add tests that should fail when lock() throws. THis is part of LWG issue #2135. No library changes here.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204777 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 02:11:47 +00:00
Marshall Clow
bce096d34d Add a test to make sure we're doing the right thing for throwing exceptions from deferred functions. This is LWG issue #2186. No change to the library needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204678 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24 22:25:24 +00:00
David Majnemer
f9f95be930 Implement N3891: A proposal to rename shared_mutex to shared_timed_mutex
This is as straightforward as it sounds, a renamed from shared_mutex to
shared_timed_mutex.

Note that libcxx .dylib and .so files built with c++14 support need to
be rebuilt.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 20:19:44 +00:00
Marshall Clow
b1ead689be Implement LWG 2360: 'reverse_iterator::operator*() is unimplementable'. Note that this is a (small) behavior change in the library. Reverse iterators whose base iterators' operator* return references to 'within themselves' have been sacrificed to the greater goal of avoiding data races.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 17:16:17 +00:00
Marshall Clow
d3849253ce Patch from Steve MacKenzie to make the libc++ tests play nicely with MSVC's STL. Add '#include <functional>' to four of the priority queue tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 16:22:53 +00:00
Marshall Clow
3ebf26f90d Final bit for LWG #2263; test different allocator pointer types. Note that libc++ already does the right thing here; I've just added tests to ensure that it stays this way.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203539 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 04:32:12 +00:00