Marshall Clow
ab3c50593c
Add test to ensure that iterator_traits<NotAnIterator> doesn't have a value type
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224295 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:30:07 +00:00
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
9acbcee2c6
Add option to turn off installation of headers.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224162 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 22:52:58 +00:00
Sergey Dmitrouk
984f8f6e43
Include newlib-specific locales in __locale
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 08:36:16 +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
Eric Fiselier
453a50040b
Update information on where to find buildbots. Remove dead buildbot links.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223848 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 22:53:21 +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
Sergey Dmitrouk
fff544efbd
Explicitly include <sched.h> for sched_yield()
...
It might be implicitly included by <pthread.h> (and that's why it worked
so far), but it's not guaranteed (for example, this is not the case with
newlib).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:50:21 +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
Eric Fiselier
a245f9b263
Improve error message when _LIBCPP_HAS_NO_MONOTONIC_CLOCK is used improperly
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 20:09:11 +00:00
JF Bastien
93cfd7fc4e
libc++: support NaCl when building thread.cpp
...
Summary: NaCl shouldn't include sysctl.h when trying to determine std:🧵 :hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std:🧵 :hardware_concurrency > 0.
Test Plan: make check-libcxx
Reviewers: dschuff, danalbert
Subscribers: jfb, cfe-commits
Differential Revision: http://reviews.llvm.org/D6470
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223128 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 17:30:19 +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
6cb69ffa0a
Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222794 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 21:57:41 +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
Marshall Clow
ab5bd89de1
Added entries for bugs 2118 and 2306, which were closed in Urbana
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222361 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 15:59:16 +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
b1d7c713b4
Marked LWG 2399 as complete. I committed a test for this earlier today.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222251 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18 20:37:47 +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