summaryrefslogtreecommitdiff
path: root/test/libcxx/experimental
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
commit61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch)
treeec41ed70ffca97240e76f9a78bb2dedba28f310c /test/libcxx/experimental
parentf857581820d15e410e9945d2fcd5f7163be25a96 (diff)
Notes
Diffstat (limited to 'test/libcxx/experimental')
-rw-r--r--test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp20
-rw-r--r--test/libcxx/experimental/algorithms/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp86
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp95
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp67
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp48
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp94
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp108
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp57
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp68
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp71
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp31
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp50
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/nothing_to_do.pass.cpp12
-rw-r--r--test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp24
-rw-r--r--test/libcxx/experimental/utilities/ratio/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp22
-rw-r--r--test/libcxx/experimental/utilities/syserror/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp22
-rw-r--r--test/libcxx/experimental/utilities/time/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp21
-rw-r--r--test/libcxx/experimental/utilities/tuple/version.pass.cpp20
22 files changed, 996 insertions, 0 deletions
diff --git a/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp b/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp
new file mode 100644
index 0000000000000..accdd699c4f96
--- /dev/null
+++ b/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/algorithm>
+
+#include <experimental/algorithm>
+
+#ifndef _LIBCPP_ALGORITHM
+# error "<experimental/algorithm> must include <algorithm>"
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/algorithms/version.pass.cpp b/test/libcxx/experimental/algorithms/version.pass.cpp
new file mode 100644
index 0000000000000..6d9d0c6b2f385
--- /dev/null
+++ b/test/libcxx/experimental/algorithms/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/algorithm>
+
+#include <experimental/algorithm>
+
+#ifndef _LIBCPP_VERSION
+# error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp
new file mode 100644
index 0000000000000..d274bc030881e
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/alloc.pass.cpp
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// template <class Alloc>
+// dynarray(size_type c, const Alloc& alloc);
+// template <class Alloc>
+// dynarray(size_type c, const T& v, const Alloc& alloc);
+// template <class Alloc>
+// dynarray(const dynarray& d, const Alloc& alloc);
+// template <class Alloc>
+// dynarray(initializer_list<T>, const Alloc& alloc);
+
+// ~dynarray();
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+#include "test_allocator.h"
+
+using std::experimental::dynarray;
+
+template <class T, class Allocator>
+void check_allocator ( const dynarray<T> &dyn, const Allocator &alloc ) {
+ for ( int i = 0; i < dyn.size (); ++i )
+ assert ( dyn[i].get_allocator() == alloc );
+}
+
+template <class T, class Allocator>
+void test ( const std::initializer_list<T> &vals, const Allocator &alloc ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( vals, alloc );
+ assert ( d1.size () == vals.size() );
+ assert ( std::equal ( vals.begin (), vals.end (), d1.begin (), d1.end ()));
+ check_allocator ( d1, alloc );
+ }
+
+
+template <class T, class Allocator>
+void test ( const T &val, const Allocator &alloc1, const Allocator &alloc2 ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 4, alloc1 );
+ assert ( d1.size () == 4 );
+ assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } ));
+ check_allocator ( d1, alloc1 );
+
+ dynA d2 ( 7, val, alloc1 );
+ assert ( d2.size () == 7 );
+ assert ( std::all_of ( d2.begin (), d2.end (), [&val]( const T &item ){ return item == val; } ));
+ check_allocator ( d2, alloc1 );
+
+ dynA d3 ( d2, alloc2 );
+ assert ( d3.size () == 7 );
+ assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } ));
+ check_allocator ( d3, alloc2 );
+ }
+
+int main()
+{
+// This test is waiting on the resolution of LWG issue #2235
+// typedef test_allocator<char> Alloc;
+// typedef std::basic_string<char, std::char_traits<char>, Alloc> nstr;
+//
+// test ( nstr("fourteen"), Alloc(3), Alloc(4) );
+// test ( { nstr("1"), nstr("1"), nstr("2"), nstr("3"), nstr("5"), nstr("8")}, Alloc(6));
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
new file mode 100644
index 0000000000000..0effac2fc142a
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// 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);
+// dynarray(size_type c, const T& v);
+// dynarray(initializer_list<T>);
+// dynarray(const dynarray& d);
+
+// ~dynarray();
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void test ( const std::initializer_list<T> &vals ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( vals );
+ assert ( d1.size () == vals.size() );
+ assert ( std::equal ( vals.begin (), vals.end (), d1.begin (), d1.end ()));
+ }
+
+
+template <class T>
+void test ( const T &val ) {
+ 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(); } ));
+
+ dynA d2 ( 7, val );
+ assert ( d2.size () == 7 );
+ assert ( std::all_of ( d2.begin (), d2.end (), [&val]( const T &item ){ return item == val; } ));
+
+ dynA d3 ( d2 );
+ assert ( d3.size () == 7 );
+ assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } ));
+ }
+
+void test_bad_length () {
+ try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) + 1 ); }
+ catch ( std::bad_array_length & ) { return ; }
+ 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<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")} );
+
+// Make sure we don't pick up the Allocator version here
+ dynarray<long> d1 ( 20, 3 );
+ assert ( d1.size() == 20 );
+ assert ( std::all_of ( d1.begin (), d1.end (), []( long item ){ return item == 3L; } ));
+
+ test_bad_length ();
+ test_bad_alloc ();
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
new file mode 100644
index 0000000000000..b669f25948ed4
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.data
+
+// T* data() noexcept;
+// const T* data() const noexcept;
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_test_const ( const dynarray<T> &dyn ) {
+ const T *data = dyn.data ();
+ assert ( data != NULL );
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ }
+
+template <class T>
+void dyn_test ( dynarray<T> &dyn ) {
+ T *data = dyn.data ();
+ assert ( data != NULL );
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ }
+
+
+
+template <class T>
+void test ( const T &val ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 4 );
+ dyn_test ( d1 );
+ dyn_test_const ( d1 );
+
+ dynA d2 ( 7, val );
+ dyn_test ( d2 );
+ dyn_test_const ( d2 );
+ }
+
+int main()
+{
+ test<int> ( 14 );
+ test<double> ( 14.0 );
+ test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
+ test<std::string> ( "fourteen" );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
new file mode 100644
index 0000000000000..c57887ddaf94c
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.data
+
+// void fill(const T& v);
+// const T* data() const noexcept;
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void test ( const T &val ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 4 );
+ d1.fill ( val );
+ assert ( std::all_of ( d1.begin (), d1.end (),
+ [&val]( const T &item ){ return item == val; } ));
+ }
+
+int main()
+{
+ test<int> ( 14 );
+ test<double> ( 14.0 );
+ test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
+ test<std::string> ( "fourteen" );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
new file mode 100644
index 0000000000000..4d77cf732758c
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
@@ -0,0 +1,94 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.overview
+
+// const_reference at(size_type n) const;
+// reference at(size_type n);
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_at_fail ( dynarray<T> &dyn, size_t sz ) {
+ try { dyn.at (sz); }
+ catch (const std::out_of_range &) { return; }
+ assert ( false );
+ }
+
+template <class T>
+void dyn_at_fail_const ( const dynarray<T> &dyn, size_t sz ) {
+ try { dyn.at (sz); }
+ catch (const std::out_of_range &) { return; }
+ assert ( false );
+ }
+
+
+template <class T>
+void dyn_test_const ( const dynarray<T> &dyn, const std::initializer_list<T> &vals ) {
+ const T *data = dyn.data ();
+ auto it = vals.begin ();
+ for ( size_t i = 0; i < dyn.size(); ++i, ++it ) {
+ assert ( data + i == &dyn.at(i));
+ assert ( *it == dyn.at(i));
+ }
+
+ dyn_at_fail_const ( dyn, dyn.size ());
+ dyn_at_fail_const ( dyn, 2*dyn.size ());
+ dyn_at_fail_const ( dyn, size_t (-1));
+ }
+
+template <class T>
+void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) {
+ T *data = dyn.data ();
+ auto it = vals.begin ();
+ for ( size_t i = 0; i < dyn.size(); ++i, ++it ) {
+ assert ( data + i == &dyn.at(i));
+ assert ( *it == dyn.at(i));
+ }
+
+ dyn_at_fail ( dyn, dyn.size ());
+ dyn_at_fail ( dyn, 2*dyn.size ());
+ dyn_at_fail ( dyn, size_t (-1));
+ }
+
+
+template <class T>
+void test ( std::initializer_list<T> vals ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( vals );
+ dyn_test ( d1, vals );
+ dyn_test_const ( d1, vals );
+ }
+
+int main()
+{
+ 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")} );
+
+ test<int> ( {} );
+ test<std::complex<double>> ( {} );
+ test<std::string> ( {} );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
new file mode 100644
index 0000000000000..695e1aa9f14ae
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
@@ -0,0 +1,108 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.overview
+
+
+// iterator begin() noexcept;
+// const_iterator begin() const noexcept;
+// const_iterator cbegin() const noexcept;
+// iterator end() noexcept;
+// const_iterator end() const noexcept;
+// const_iterator cend() const noexcept;
+//
+// reverse_iterator rbegin() noexcept;
+// const_reverse_iterator rbegin() const noexcept;
+// const_reverse_iterator crbegin() const noexcept;
+// reverse_iterator rend() noexcept;
+// const_reverse_iterator rend() const noexcept;
+// const_reverse_iterator crend() const noexcept;
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_test_const ( const dynarray<T> &dyn ) {
+ const T *data = dyn.data ();
+ assert ( data == &*dyn.begin ());
+ assert ( data == &*dyn.cbegin ());
+
+ assert ( data + dyn.size() - 1 == &*dyn.rbegin ());
+ assert ( data + dyn.size() - 1 == &*dyn.crbegin ());
+
+ assert ( dyn.size () == std::distance ( dyn.begin(), dyn.end()));
+ assert ( dyn.size () == std::distance ( dyn.cbegin(), dyn.cend()));
+ assert ( dyn.size () == std::distance ( dyn.rbegin(), dyn.rend()));
+ assert ( dyn.size () == std::distance ( dyn.crbegin(), dyn.crend()));
+
+ assert ( dyn.begin () == dyn.cbegin ());
+ assert ( &*dyn.begin () == &*dyn.cbegin ());
+ assert ( dyn.rbegin () == dyn.crbegin ());
+ assert ( &*dyn.rbegin () == &*dyn.crbegin ());
+ assert ( dyn.end () == dyn.cend ());
+ assert ( dyn.rend () == dyn.crend ());
+ }
+
+template <class T>
+void dyn_test ( dynarray<T> &dyn ) {
+ T *data = dyn.data ();
+ assert ( data == &*dyn.begin ());
+ assert ( data == &*dyn.cbegin ());
+
+ assert ( data + dyn.size() - 1 == &*dyn.rbegin ());
+ assert ( data + dyn.size() - 1 == &*dyn.crbegin ());
+
+ assert ( dyn.size () == std::distance ( dyn.begin(), dyn.end()));
+ assert ( dyn.size () == std::distance ( dyn.cbegin(), dyn.cend()));
+ assert ( dyn.size () == std::distance ( dyn.rbegin(), dyn.rend()));
+ assert ( dyn.size () == std::distance ( dyn.crbegin(), dyn.crend()));
+
+ assert ( dyn.begin () == dyn.cbegin ());
+ assert ( &*dyn.begin () == &*dyn.cbegin ());
+ assert ( dyn.rbegin () == dyn.crbegin ());
+ assert ( &*dyn.rbegin () == &*dyn.crbegin ());
+ assert ( dyn.end () == dyn.cend ());
+ assert ( dyn.rend () == dyn.crend ());
+ }
+
+
+template <class T>
+void test ( const T &val ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 4 );
+ dyn_test ( d1 );
+ dyn_test_const ( d1 );
+
+ dynA d2 ( 7, val );
+ dyn_test ( d2 );
+ dyn_test_const ( d2 );
+ }
+
+int main()
+{
+ test<int> ( 14 );
+ test<double> ( 14.0 );
+ test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
+ test<std::string> ( "fourteen" );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
new file mode 100644
index 0000000000000..6d28eef1b0578
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.overview
+
+// size_type size() const noexcept;
+// size_type max_size() const noexcept;
+// bool empty() const noexcept;
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_test ( const dynarray<T> &dyn, size_t sz ) {
+ assert ( dyn.size () == sz );
+ assert ( dyn.max_size () == sz );
+ assert ( dyn.empty () == ( sz == 0 ));
+ }
+
+template <class T>
+void test ( std::initializer_list<T> vals ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( vals );
+ dyn_test ( d1, vals.size ());
+ }
+
+int main()
+{
+ 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")} );
+
+ test<int> ( {} );
+ test<std::complex<double>> ( {} );
+ test<std::string> ( {} );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
new file mode 100644
index 0000000000000..e82aa64b98b68
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.overview
+
+// reference front();
+// const_reference front() const;
+// reference back();
+// const_reference back() const;
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_test_const ( const dynarray<T> &dyn ) {
+ const T *data = dyn.data ();
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ }
+
+template <class T>
+void dyn_test ( dynarray<T> &dyn ) {
+ T *data = dyn.data ();
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ }
+
+
+template <class T>
+void test ( const T &val ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 4 );
+ dyn_test ( d1 );
+ dyn_test_const ( d1 );
+
+ dynA d2 ( 7, val );
+ dyn_test ( d2 );
+ dyn_test_const ( d2 );
+ }
+
+int main()
+{
+ test<int> ( 14 );
+ test<double> ( 14.0 );
+ test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
+ test<std::string> ( "fourteen" );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
new file mode 100644
index 0000000000000..7317a2023cb1e
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.overview
+
+// const_reference at(size_type n) const;
+// reference at(size_type n);
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void dyn_test_const ( const dynarray<T> &dyn, const std::initializer_list<T> &vals ) {
+ const T *data = dyn.data ();
+ auto it = vals.begin ();
+ for ( size_t i = 0; i < dyn.size(); ++i, ++it ) {
+ assert ( data + i == &dyn[i]);
+ assert ( *it == dyn[i]);
+ }
+ }
+
+template <class T>
+void dyn_test ( dynarray<T> &dyn, const std::initializer_list<T> &vals ) {
+ T *data = dyn.data ();
+ auto it = vals.begin ();
+ for ( size_t i = 0; i < dyn.size(); ++i, ++it ) {
+ assert ( data + i == &dyn[i]);
+ assert ( *it == dyn[i]);
+ }
+ }
+
+
+template <class T>
+void test ( std::initializer_list<T> vals ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( vals );
+ dyn_test ( d1, vals );
+ dyn_test_const ( d1, vals );
+ }
+
+int main()
+{
+ 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")} );
+
+ test<int> ( {} );
+ test<std::complex<double>> ( {} );
+ test<std::string> ( {} );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp
new file mode 100644
index 0000000000000..9b8240d4cd82f
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.traits/default.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.data
+
+// template <class Type, class Alloc>
+// struct uses_allocator<dynarray<Type>, Alloc> : true_type { };
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include "test_allocator.h"
+
+using std::experimental::dynarray;
+
+int main()
+{
+ static_assert ( std::uses_allocator<dynarray<int>, test_allocator<int>>::value, "" );
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
new file mode 100644
index 0000000000000..93f3b18f192f5
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.zero
+
+// dynarray shall provide support for the special case of construction with a size of zero.
+// In the case that the size is zero, begin() == end() == unique value.
+// The return value of data() is unspecified.
+// The effect of calling front() or back() for a zero-sized dynarray is undefined.
+
+
+
+#include <__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <experimental/dynarray>
+#include <cassert>
+
+#include <algorithm>
+#include <complex>
+#include <string>
+
+using std::experimental::dynarray;
+
+template <class T>
+void test ( ) {
+ typedef dynarray<T> dynA;
+
+ dynA d1 ( 0 );
+ assert ( d1.size() == 0 );
+ assert ( d1.begin() == d1.end ());
+ }
+
+int main()
+{
+ test<int> ();
+ test<double> ();
+ test<std::complex<double>> ();
+ test<std::string> ();
+}
+#else
+int main() {}
+#endif
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/nothing_to_do.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/nothing_to_do.pass.cpp
new file mode 100644
index 0000000000000..b58f5c55b643a
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
new file mode 100644
index 0000000000000..db9026aebd84f
--- /dev/null
+++ b/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/ratio>
+
+// Test that <ratio> is included.
+
+#include <experimental/ratio>
+
+#if _LIBCPP_STD_VER > 11
+# ifndef _LIBCPP_RATIO
+# error " <experimental/ratio> must include <ratio>"
+# endif
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/ratio/version.pass.cpp b/test/libcxx/experimental/utilities/ratio/version.pass.cpp
new file mode 100644
index 0000000000000..8bc583fb6d946
--- /dev/null
+++ b/test/libcxx/experimental/utilities/ratio/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/ratio>
+
+#include <experimental/ratio>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
new file mode 100644
index 0000000000000..88c7458395d4b
--- /dev/null
+++ b/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/system_error>
+
+#include <experimental/system_error>
+
+#if _LIBCPP_STD_VER > 11
+# ifndef _LIBCPP_SYSTEM_ERROR
+# error "<experimental/system_error> must include <system_error>"
+# endif
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/syserror/version.pass.cpp b/test/libcxx/experimental/utilities/syserror/version.pass.cpp
new file mode 100644
index 0000000000000..35f6a59c38760
--- /dev/null
+++ b/test/libcxx/experimental/utilities/syserror/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/system_error>
+
+#include <experimental/system_error>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
new file mode 100644
index 0000000000000..ad4a79105b0b8
--- /dev/null
+++ b/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/chrono>
+
+#include <experimental/chrono>
+
+#if _LIBCPP_STD_VER > 11
+# ifndef _LIBCPP_CHRONO
+# error "<experimental/chrono> must include <chrono>"
+# endif
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/time/version.pass.cpp b/test/libcxx/experimental/utilities/time/version.pass.cpp
new file mode 100644
index 0000000000000..be97466f37c09
--- /dev/null
+++ b/test/libcxx/experimental/utilities/time/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/chrono>
+
+#include <experimental/chrono>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
new file mode 100644
index 0000000000000..544ddfb269f2c
--- /dev/null
+++ b/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/tuple>
+
+#include <experimental/tuple>
+
+int main()
+{
+#if _LIBCPP_STD_VER > 11
+# ifndef _LIBCPP_TUPLE
+# error "<experimental/tuple> must include <tuple>"
+# endif
+#endif /* _LIBCPP_STD_VER > 11 */
+}
diff --git a/test/libcxx/experimental/utilities/tuple/version.pass.cpp b/test/libcxx/experimental/utilities/tuple/version.pass.cpp
new file mode 100644
index 0000000000000..5a3fd2e39647d
--- /dev/null
+++ b/test/libcxx/experimental/utilities/tuple/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/tuple>
+
+#include <experimental/tuple>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}