Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/libc++/dist/libcxx Rerun the import of r245547.
details: https://anonhg.NetBSD.org/src/rev/67bac4f293dc
branches: trunk
changeset: 340016:67bac4f293dc
user: joerg <joerg%NetBSD.org@localhost>
date: Thu Aug 20 09:49:32 2015 +0000
description:
Rerun the import of r245547.
diffstat:
external/bsd/libc++/dist/libcxx/src/new.cpp | 2 +-
external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp | 43 +-
external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp | 33 +
external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp | 41 +-
external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp | 45 +-
external/bsd/libc++/dist/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp | 2 +-
external/bsd/libc++/dist/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp | 2 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/deleter.h | 1 -
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp | 25 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp | 27 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp | 43 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp | 48 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp | 89 ++++
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp | 41 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp | 44 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp | 47 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp | 40 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp | 2 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp | 16 +-
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp | 192 ++++-----
external/bsd/libc++/dist/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp | 43 +-
21 files changed, 406 insertions(+), 420 deletions(-)
diffs (truncated from 1243 to 300 lines):
diff -r 10d0963b5044 -r 67bac4f293dc external/bsd/libc++/dist/libcxx/src/new.cpp
--- a/external/bsd/libc++/dist/libcxx/src/new.cpp Thu Aug 20 09:46:03 2015 +0000
+++ b/external/bsd/libc++/dist/libcxx/src/new.cpp Thu Aug 20 09:49:32 2015 +0000
@@ -38,7 +38,7 @@
#ifndef __GLIBCXX__
// Implement all new and delete operators as weak definitions
-// in this shared library, so that they can be overriden by programs
+// in this shared library, so that they can be overridden by programs
// that define non-weak copies of the functions.
_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
diff -r 10d0963b5044 -r 67bac4f293dc external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
--- a/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp Thu Aug 20 09:46:03 2015 +0000
+++ b/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp Thu Aug 20 09:49:32 2015 +0000
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.cons
// explicit dynarray(size_type c);
@@ -16,22 +18,21 @@
// ~dynarray();
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
#include <algorithm>
#include <complex>
+#include <limits>
+#include <new>
#include <string>
+
using std::experimental::dynarray;
template <class T>
-void test ( const std::initializer_list<T> &vals ) {
+void testInitList( const std::initializer_list<T> &vals ) {
typedef dynarray<T> dynA;
dynA d1 ( vals );
@@ -41,12 +42,14 @@
template <class T>
-void test ( const T &val ) {
+void test ( const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
dynA d1 ( 4 );
assert ( d1.size () == 4 );
- assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } ));
+ if (!DefaultValueIsIndeterminate) {
+ assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } ));
+ }
dynA d2 ( 7, val );
assert ( d2.size () == 7 );
@@ -60,27 +63,23 @@
void test_bad_length () {
try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) + 1 ); }
catch ( std::bad_array_length & ) { return ; }
+ catch (...) { assert(false); }
assert ( false );
- }
+}
-void test_bad_alloc () {
- try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) - 1 ); }
- catch ( std::bad_alloc & ) { return ; }
- assert ( false );
- }
int main()
{
-// test<int> ( 14 ); // ints don't get default initialized
- test<long> ( 0 );
- test<double> ( 14.0 );
+ test<int> ( 14, /* DefaultValueIsIndeterminate */ true ); // ints don't get default initialized
+ test<long> ( 0, true);
+ test<double> ( 14.0, true );
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
- test ( { 1, 1, 2, 3, 5, 8 } );
- test ( { 1., 1., 2., 3., 5., 8. } );
- test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"),
- std::string("5"), std::string("8")} );
+ testInitList( { 1, 1, 2, 3, 5, 8 } );
+ testInitList( { 1., 1., 2., 3., 5., 8. } );
+ testInitList( { std::string("1"), std::string("1"), std::string("2"), std::string("3"),
+ std::string("5"), std::string("8")} );
// Make sure we don't pick up the Allocator version here
dynarray<long> d1 ( 20, 3 );
@@ -88,8 +87,4 @@
assert ( std::all_of ( d1.begin (), d1.end (), []( long item ){ return item == 3L; } ));
test_bad_length ();
- test_bad_alloc ();
}
-#else
-int main() {}
-#endif
diff -r 10d0963b5044 -r 67bac4f293dc external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp Thu Aug 20 09:49:32 2015 +0000
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// dynarray.cons
+
+// explicit dynarray(size_type c);
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// The sanitizers replace new/delete with versions that do not throw bad_alloc.
+// UNSUPPORTED: sanitizer-new-delete, ubsan
+
+
+#include <experimental/dynarray>
+#include <limits>
+#include <new>
+#include <cassert>
+
+
+using std::experimental::dynarray;
+
+int main() {
+ try { dynarray<int>((std::numeric_limits<size_t>::max() / sizeof(int)) - 1); }
+ catch (std::bad_alloc &) { return 0; }
+ catch (...) { assert(false); }
+ assert(false);
+}
diff -r 10d0963b5044 -r 67bac4f293dc external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
--- a/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp Thu Aug 20 09:46:03 2015 +0000
+++ b/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp Thu Aug 20 09:49:32 2015 +0000
@@ -7,15 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.data
// T* data() noexcept;
// const T* data() const noexcept;
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -27,41 +25,44 @@
using std::experimental::dynarray;
template <class T>
-void dyn_test_const ( const dynarray<T> &dyn ) {
+void dyn_test_const(const dynarray<T> &dyn, bool CheckEquals = true) {
const T *data = dyn.data ();
assert ( data != NULL );
- assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ if (CheckEquals) {
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
}
+}
template <class T>
-void dyn_test ( dynarray<T> &dyn ) {
+void dyn_test( dynarray<T> &dyn, bool CheckEquals = true) {
T *data = dyn.data ();
assert ( data != NULL );
- assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ if (CheckEquals) {
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
}
+}
template <class T>
-void test ( const T &val ) {
+void test(const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
+
+ const bool CheckDefaultValues = !DefaultValueIsIndeterminate;
+
+ dynA d1(4);
+ dyn_test(d1, CheckDefaultValues);
+ dyn_test_const(d1, CheckDefaultValues);
- dynA d1 ( 4 );
- dyn_test ( d1 );
- dyn_test_const ( d1 );
-
- dynA d2 ( 7, val );
+ dynA d2 (7, val);
dyn_test ( d2 );
dyn_test_const ( d2 );
- }
+}
int main()
{
- test<int> ( 14 );
- test<double> ( 14.0 );
+ test<int>(14, /* DefaultValueIsIndeterminate */ true);
+ test<double>(14.0, true);
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
}
-#else
-int main() {}
-#endif
diff -r 10d0963b5044 -r 67bac4f293dc external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
--- a/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp Thu Aug 20 09:46:03 2015 +0000
+++ b/external/bsd/libc++/dist/libcxx/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp Thu Aug 20 09:49:32 2015 +0000
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.overview
// reference front();
@@ -14,10 +16,6 @@
// reference back();
// const_reference back() const;
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -29,40 +27,47 @@
using std::experimental::dynarray;
template <class T>
-void dyn_test_const ( const dynarray<T> &dyn ) {
+void dyn_test_const ( const dynarray<T> &dyn, bool CheckValues = true ) {
const T *data = dyn.data ();
- assert ( *data == dyn.front ());
- assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ assert(data == &dyn.front());
+ assert((data + dyn.size() - 1) == &dyn.back());
+ if (CheckValues) {
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
}
+}
template <class T>
-void dyn_test ( dynarray<T> &dyn ) {
+void dyn_test ( dynarray<T> &dyn, bool CheckValues = true ) {
T *data = dyn.data ();
- assert ( *data == dyn.front ());
- assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ assert(data == &dyn.front());
+ assert((data + dyn.size() - 1) == &dyn.back());
+ if (CheckValues) {
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
}
+}
template <class T>
-void test ( const T &val ) {
+void test ( const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
-
+
+ const bool CheckDefaultValues = ! DefaultValueIsIndeterminate;
+
dynA d1 ( 4 );
- dyn_test ( d1 );
- dyn_test_const ( d1 );
+ dyn_test ( d1, CheckDefaultValues );
Home |
Main Index |
Thread Index |
Old Index