[libcxx] r224658 - Move test into test/std subdirectory.

Eric Fiselier eric at efcs.ca
Fri Dec 19 17:40:31 PST 2014


Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,179 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// iterator erase(const_iterator first, const_iterator last)
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        typedef std::pair<int, std::string> P;
+        P a[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i, 2);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+
+        k = c.erase(i, j);
+        assert(c.size() == 4);
+        eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                            min_allocator<std::pair<const int, std::string>>> C;
+        typedef std::pair<int, std::string> P;
+        P a[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i, 2);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+
+        k = c.erase(i, j);
+        assert(c.size() == 4);
+        eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// iterator insert(const value_type& x);
+
+#include <unordered_map>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
+                            min_allocator<std::pair<const double, int>>> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// iterator insert(const_iterator p, const value_type& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_map>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(c.end(), P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
+                            min_allocator<std::pair<const double, int>>> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(c.end(), P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        P v(3.5, 3);
+        R r = c.insert(e, v);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,156 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// template <class P,
+//           class = typename enable_if<is_convertible<P, value_type>::value>::type>
+//     iterator insert(const_iterator p, P&& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_map>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef std::pair<double, short> P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(r, P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
+        typedef C::iterator R;
+        typedef std::pair<MoveOnly, MoveOnly> P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3);
+        assert(r->second == 3);
+
+        r = c.insert(r, P(3, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5);
+        assert(r->second == 4);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
+                            min_allocator<std::pair<const double, int>>> C;
+        typedef C::iterator R;
+        typedef std::pair<double, short> P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(r, P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>,
+                            min_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
+        typedef C::iterator R;
+        typedef std::pair<MoveOnly, MoveOnly> P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3);
+        assert(r->second == 3);
+
+        r = c.insert(r, P(3, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(4, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4);
+        assert(r->second == 4);
+
+        r = c.insert(c.end(), P(5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5);
+        assert(r->second == 4);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        R r = c.insert(e, P(3.5, 3));
+        assert(false);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,122 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// void insert(initializer_list<value_type> il);
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        typedef std::pair<int, std::string> P;
+        C c;
+        c.insert(
+                    {
+                        P(1, "one"),
+                        P(2, "two"),
+                        P(3, "three"),
+                        P(4, "four"),
+                        P(1, "four"),
+                        P(2, "four"),
+                    }
+                );
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        C::iterator k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                            min_allocator<std::pair<const int, std::string>>> C;
+        typedef std::pair<int, std::string> P;
+        C c;
+        c.insert(
+                    {
+                        P(1, "one"),
+                        P(2, "two"),
+                        P(3, "three"),
+                        P(4, "four"),
+                        P(1, "four"),
+                        P(2, "four"),
+                    }
+                );
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        C::iterator k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,121 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// template <class InputIterator>
+//     void insert(InputIterator first, InputIterator last);
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        typedef std::pair<int, std::string> P;
+        P a[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        C::iterator k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                            min_allocator<std::pair<const int, std::string>>> C;
+        typedef std::pair<int, std::string> P;
+        P a[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 6);
+        typedef std::pair<C::iterator, C::iterator> Eq;
+        Eq eq = c.equal_range(1);
+        assert(std::distance(eq.first, eq.second) == 2);
+        C::iterator k = eq.first;
+        assert(k->first == 1);
+        assert(k->second == "one");
+        ++k;
+        assert(k->first == 1);
+        assert(k->second == "four");
+        eq = c.equal_range(2);
+        assert(std::distance(eq.first, eq.second) == 2);
+        k = eq.first;
+        assert(k->first == 2);
+        assert(k->second == "two");
+        ++k;
+        assert(k->first == 2);
+        assert(k->second == "four");
+        eq = c.equal_range(3);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 3);
+        assert(k->second == "three");
+        eq = c.equal_range(4);
+        assert(std::distance(eq.first, eq.second) == 1);
+        k = eq.first;
+        assert(k->first == 4);
+        assert(k->second == "four");
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,136 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// template <class P,
+//           class = typename enable_if<is_convertible<P, value_type>::value>::type>
+//     iterator insert(P&& x);
+
+#include <unordered_map>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multimap<double, int> C;
+        typedef C::iterator R;
+        typedef std::pair<double, short> P;
+        C c;
+        R r = c.insert(P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
+        typedef C::iterator R;
+        typedef std::pair<MoveOnly, MoveOnly> P;
+        C c;
+        R r = c.insert(P(3, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3);
+        assert(r->second == 3);
+
+        r = c.insert(P(3, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3);
+        assert(r->second == 4);
+
+        r = c.insert(P(4, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4);
+        assert(r->second == 4);
+
+        r = c.insert(P(5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5);
+        assert(r->second == 4);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>,
+                            min_allocator<std::pair<const double, int>>> C;
+        typedef C::iterator R;
+        typedef std::pair<double, short> P;
+        C c;
+        R r = c.insert(P(3.5, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3.5);
+        assert(r->second == 3);
+
+        r = c.insert(P(3.5, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(4.5, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4.5);
+        assert(r->second == 4);
+
+        r = c.insert(P(5.5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5.5);
+        assert(r->second == 4);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>,
+                            min_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
+        typedef C::iterator R;
+        typedef std::pair<MoveOnly, MoveOnly> P;
+        C c;
+        R r = c.insert(P(3, 3));
+        assert(c.size() == 1);
+        assert(r->first == 3);
+        assert(r->second == 3);
+
+        r = c.insert(P(3, 4));
+        assert(c.size() == 2);
+        assert(r->first == 3);
+        assert(r->second == 4);
+
+        r = c.insert(P(4, 4));
+        assert(c.size() == 3);
+        assert(r->first == 4);
+        assert(r->second == 4);
+
+        r = c.insert(P(5, 4));
+        assert(c.size() == 4);
+        assert(r->first == 5);
+        assert(r->second == 4);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/db_swap_1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/db_swap_1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/db_swap_1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/db_swap_1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class Value, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, Value>>>
+// class unordered_multimap
+
+// void swap(unordered_multimap& x, unordered_multimap& y);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_map>
+#include <cassert>
+
+int main()
+{
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
+        P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
+        std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+        std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+        std::unordered_multimap<int, int>::iterator i1 = c1.begin();
+        std::unordered_multimap<int, int>::iterator i2 = c2.begin();
+        swap(c1, c2);
+        c1.erase(i2);
+        c2.erase(i1);
+        std::unordered_multimap<int, int>::iterator j = i1;
+        c1.erase(i1);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// void swap(unordered_multimap& c)
+//     noexcept(!allocator_type::propagate_on_container_swap::value ||
+//              __is_nothrow_swappable<allocator_type>::value);
+
+// This tests a conforming extension
+
+#include <unordered_map>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    
+    some_comp() {}
+    some_comp(const some_comp&) {}
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash() {}
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,584 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// void swap(unordered_multimap& __u);
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<std::pair<const int, std::string> > Alloc;
+        typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
+        typedef std::pair<int, std::string> P;
+        P a1[] =
+        {
+            P(1, "one"),
+            P(2, "two"),
+            P(3, "three"),
+            P(4, "four"),
+            P(1, "four"),
+            P(2, "four"),
+        };
+        P a2[] =
+        {
+            P(10, "ten"),
+            P(20, "twenty"),
+            P(30, "thirty"),
+            P(40, "forty"),
+            P(50, "fifty"),
+            P(60, "sixty"),
+            P(70, "seventy"),
+            P(80, "eighty"),
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(c1.find(10)->second == "ten");
+        assert(c1.find(20)->second == "twenty");
+        assert(c1.find(30)->second == "thirty");
+        assert(c1.find(40)->second == "forty");
+        assert(c1.find(50)->second == "fifty");
+        assert(c1.find(60)->second == "sixty");
+        assert(c1.find(70)->second == "seventy");
+        assert(c1.find(80)->second == "eighty");
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.find(1)->second == "one");
+        assert(next(c2.find(1))->second == "four");
+        assert(c2.find(2)->second == "two");
+        assert(next(c2.find(2))->second == "four");
+        assert(c2.find(3)->second == "three");
+        assert(c2.find(4)->second == "four");
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/bucket.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/bucket.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/bucket.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/bucket.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket(const key_type& __k) const;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        size_t bc = c.bucket_count();
+        assert(bc >= 7);
+        for (size_t i = 0; i < 13; ++i)
+            assert(c.bucket(i) == i % bc);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        size_t bc = c.bucket_count();
+        assert(bc >= 7);
+        for (size_t i = 0; i < 13; ++i)
+            assert(c.bucket(i) == i % bc);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_multiset<int> C;
+        C c;
+        C::size_type i = c.bucket(3);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket_count() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        const C c;
+        assert(c.bucket_count() == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 11);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        const C c;
+        assert(c.bucket_count() == 0);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 11);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket_size(size_type n) const
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 7);
+        assert(c.bucket_size(0) == 0);
+        assert(c.bucket_size(1) == 2);
+        assert(c.bucket_size(2) == 2);
+        assert(c.bucket_size(3) == 1);
+        assert(c.bucket_size(4) == 1);
+        assert(c.bucket_size(5) == 0);
+        assert(c.bucket_size(6) == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 7);
+        assert(c.bucket_size(0) == 0);
+        assert(c.bucket_size(1) == 2);
+        assert(c.bucket_size(2) == 2);
+        assert(c.bucket_size(3) == 1);
+        assert(c.bucket_size(4) == 1);
+        assert(c.bucket_size(5) == 0);
+        assert(c.bucket_size(6) == 0);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_multiset<int> C;
+        C c;
+        C::size_type i = c.bucket_size(3);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/clear.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/clear.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/clear.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/clear.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void clear()
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        c.clear();
+        assert(c.size() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        c.clear();
+        assert(c.size() == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type count(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.count(30) == 1);
+        assert(c.count(50) == 3);
+        assert(c.count(5) == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.count(30) == 1);
+        assert(c.count(50) == 3);
+        assert(c.count(5) == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_7.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/db_iterators_8.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    T j = *i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.end();
+    T j = *i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+    }
+#endif
+
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    T j = *i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_multiset<T, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    T j = *i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/emplace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/emplace.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/emplace.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/emplace.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class... Args>
+//     iterator emplace(Args&&... args);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../Emplaceable.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<Emplaceable> C;
+        typedef C::iterator R;
+        C c;
+        R r = c.emplace();
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace(Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace(5, 6);
+        assert(c.size() == 3);
+        assert(*r == Emplaceable(5, 6));
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
+                      std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
+        typedef C::iterator R;
+        C c;
+        R r = c.emplace();
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace(Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace(5, 6);
+        assert(c.size() == 3);
+        assert(*r == Emplaceable(5, 6));
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class... Args>
+//     iterator emplace_hint(const_iterator p, Args&&... args);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../Emplaceable.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<Emplaceable> C;
+        typedef C::iterator R;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.emplace_hint(e);
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace_hint(c.end(), Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace_hint(r, 5, 6);
+        assert(c.size() == 3);
+        assert(*r == Emplaceable(5, 6));
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
+                      std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
+        typedef C::iterator R;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.emplace_hint(e);
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace_hint(c.end(), Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace_hint(r, 5, 6);
+        assert(c.size() == 3);
+        assert(*r == Emplaceable(5, 6));
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multiset<Emplaceable> C;
+        typedef C::iterator R;
+        C c1;
+        C c2;
+        R r = c1.emplace_hint(c2.begin(), 5, 6);
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/eq.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/eq.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/eq.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/eq.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,180 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Key, class Hash, class Pred, class Alloc>
+// bool
+// operator==(const unordered_multiset<Key, Hash, Pred, Alloc>& x,
+//            const unordered_multiset<Key, Hash, Pred, Alloc>& y);
+//
+// template <class Key, class Hash, class Pred, class Alloc>
+// bool
+// operator!=(const unordered_multiset<Key, Hash, Pred, Alloc>& x,
+//            const unordered_multiset<Key, Hash, Pred, Alloc>& y);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2;
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2 = c1;
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a), std::end(a));
+        C c2 = c1;
+        c2.rehash(30);
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+        c2.insert(P(90));
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+        c1.insert(P(90));
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2;
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2 = c1;
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a), std::end(a));
+        C c2 = c1;
+        c2.rehash(30);
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+        c2.insert(P(90));
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+        c1.insert(P(90));
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 3);
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 3);
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_non_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_non_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_non_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/equal_range_non_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// pair<iterator, iterator> equal_range(const key_type& k);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef C::iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 3);
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef C::iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 3);
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+        ++r.first;
+        assert(*r.first == 50);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator erase(const_iterator p)
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::iterator j = c.erase(i);
+        assert(c.size() == 5);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::iterator j = c.erase(i);
+        assert(c.size() == 5);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with end()
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int>::const_iterator i = l1.end();
+    l1.erase(i);
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db2.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db2.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_db2.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <cstdlib>
+#include <exception>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int> l2(a1, a1+3);
+    std::unordered_multiset<int>::const_iterator i = l2.begin();
+    l1.erase(i);
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with first iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int> l2(a1, a1+3);
+    std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with second iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int> l2(a1, a1+3);
+    std::unordered_multiset<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with both iterators from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int> l2(a1, a1+3);
+    std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with a bad range
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_multiset<int> l1(a1, a1+3);
+    std::unordered_multiset<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_key.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_key.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_key.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_key.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,176 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type erase(const key_type& k);
+
+#include <unordered_set>
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+#if __cplusplus >= 201103L
+template <typename Unordered>
+bool only_deletions ( const Unordered &whole, const Unordered &part ) {
+    typename Unordered::const_iterator w = whole.begin();
+    typename Unordered::const_iterator p = part.begin();
+    
+    while ( w != whole.end () && p != part.end()) {
+        if ( *w == *p )
+            p++;
+        w++;
+        }
+
+    return p == part.end();
+}
+#endif
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.erase(5) == 0);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 2);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 0);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(4) == 1);
+        assert(c.size() == 3);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(4) == 0);
+        assert(c.size() == 3);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 2);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 0);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(3) == 1);
+        assert(c.size() == 0);
+
+        assert(c.erase(3) == 0);
+        assert(c.size() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.erase(5) == 0);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 2);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 0);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(4) == 1);
+        assert(c.size() == 3);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(4) == 0);
+        assert(c.size() == 3);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 2);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 0);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(3) == 1);
+        assert(c.size() == 0);
+
+        assert(c.erase(3) == 0);
+        assert(c.size() == 0);
+    }
+    {
+    typedef std::unordered_multiset<int> C;
+    C m, m2;
+    for ( int i = 0; i < 10; ++i ) {
+        m.insert(i);  m.insert(i);
+        m2.insert(i); m2.insert(i);
+        }
+    
+    C::iterator i = m2.begin();
+    int ctr = 0;
+    while (i != m2.end()) {
+        if (ctr++ % 2 == 0)
+            m2.erase(i++);
+        else
+            ++i;
+        }
+
+    assert (only_deletions (m, m2));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/erase_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/erase_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/erase_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/erase_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator erase(const_iterator first, const_iterator last)
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i, 2);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(i, j);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i, 2);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(i, j);
+        assert(c.size() == 4);
+        assert(c.count(1) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/find_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/find_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/find_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/find_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// const_iterator find(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        C::const_iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        C::const_iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/find_non_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/find_non_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/find_non_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/find_non_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator find(const key_type& k);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        C::iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        C::iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator insert(const value_type& x);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator insert(const_iterator p, const value_type& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(c.end(), P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(c.end(), P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        P v(3.5);
+        R r = c.insert(e, v);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator insert(const_iterator p, value_type&& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(r, P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(c.end(), P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(r, P(3));
+        assert(c.size() == 2);
+        assert(*r == 3);
+
+        r = c.insert(c.end(), P(4));
+        assert(c.size() == 3);
+        assert(*r == 4);
+
+        r = c.insert(c.end(), P(5));
+        assert(c.size() == 4);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(r, P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(c.end(), P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(c.end(), P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                            std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(r, P(3));
+        assert(c.size() == 2);
+        assert(*r == 3);
+
+        r = c.insert(c.end(), P(4));
+        assert(c.size() == 3);
+        assert(*r == 4);
+
+        r = c.insert(c.end(), P(5));
+        assert(c.size() == 4);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        R r = c.insert(e, P(3.5));
+        assert(false);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void insert(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        C c;
+        c.insert(
+                    {
+                        P(1),
+                        P(2),
+                        P(3),
+                        P(4),
+                        P(1),
+                        P(2)
+                    }
+                );
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        C c;
+        c.insert(
+                    {
+                        P(1),
+                        P(2),
+                        P(3),
+                        P(4),
+                        P(1),
+                        P(2)
+                    }
+                );
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     void insert(InputIterator first, InputIterator last);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator insert(value_type&& x);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        R r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(P(3));
+        assert(c.size() == 2);
+        assert(*r == 3);
+
+        r = c.insert(P(4));
+        assert(c.size() == 3);
+        assert(*r == 4);
+
+        r = c.insert(P(5));
+        assert(c.size() == 4);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 2);
+        assert(*r == 3.5);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 3);
+        assert(*r == 4.5);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 4);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                            std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        R r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(P(3));
+        assert(c.size() == 2);
+        assert(*r == 3);
+
+        r = c.insert(P(4));
+        assert(c.size() == 3);
+        assert(*r == 4);
+
+        r = c.insert(P(5));
+        assert(c.size() == 4);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.fail.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator       begin()        {return __table_.begin();}
+// iterator       end()          {return __table_.end();}
+// const_iterator begin()  const {return __table_.begin();}
+// const_iterator end()    const {return __table_.end();}
+// const_iterator cbegin() const {return __table_.begin();}
+// const_iterator cend()   const {return __table_.end();}
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i = c.begin();
+        assert(*i == 1);
+        *i = 2;
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/iterators.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,127 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// iterator       begin();
+// iterator       end();
+// const_iterator begin()  const;
+// const_iterator end()    const;
+// const_iterator cbegin() const;
+// const_iterator cend()   const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i;
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::const_iterator i;
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i;
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::const_iterator i;
+    }
+#endif
+#if _LIBCPP_STD_VER > 11
+    { // N3644 testing
+        typedef std::unordered_multiset<int> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+
+        assert (!(ii1 != ii2 ));
+
+        assert ( (ii1 == cii ));
+        assert ( (cii == ii1 ));
+        assert (!(ii1 != cii ));
+        assert (!(cii != ii1 ));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/load_factor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/load_factor.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/load_factor.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/load_factor.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// float load_factor() const
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        const C c;
+        assert(c.load_factor() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        const C c;
+        assert(c.load_factor() == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,261 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// local_iterator       begin (size_type n);
+// local_iterator       end   (size_type n);
+// const_local_iterator begin (size_type n) const;
+// const_local_iterator end   (size_type n) const;
+// const_local_iterator cbegin(size_type n) const;
+// const_local_iterator cend  (size_type n) const;
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        *i = 2;
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() == 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/local_iterators.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,500 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// local_iterator       begin (size_type n);
+// local_iterator       end   (size_type n);
+// const_local_iterator begin (size_type n) const;
+// const_local_iterator end   (size_type n) const;
+// const_local_iterator cbegin(size_type n) const;
+// const_local_iterator cend  (size_type n) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 7);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/max_bucket_count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/max_bucket_count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/max_bucket_count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/max_bucket_count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type max_bucket_count() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        const C c;
+        assert(c.max_bucket_count() > 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        const C c;
+        assert(c.max_bucket_count() > 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        const C c;
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        C c;
+        assert(c.max_load_factor() == 1);
+        c.max_load_factor(2.5);
+        assert(c.max_load_factor() == 2.5);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        const C c;
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        C c;
+        assert(c.max_load_factor() == 1);
+        c.max_load_factor(2.5);
+        assert(c.max_load_factor() == 2.5);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_multiset<int> C;
+        C c;
+        c.max_load_factor(0);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/max_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/max_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/max_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/max_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type max_size() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        std::unordered_multiset<int> u;
+        assert(u.max_size() > 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> u;
+        assert(u.max_size() > 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/rehash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/rehash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/rehash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/rehash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void rehash(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class C>
+void test(const C& c)
+{
+    assert(c.size() == 6);
+    assert(c.count(1) == 2);
+    assert(c.count(2) == 2);
+    assert(c.count(3) == 1);
+    assert(c.count(4) == 1);
+}
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 7);
+        c.rehash(3);
+        assert(c.bucket_count() == 7);
+        test(c);
+        c.max_load_factor(2);
+        c.rehash(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.rehash(31);
+        assert(c.bucket_count() == 31);
+        test(c);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 7);
+        c.rehash(3);
+        assert(c.bucket_count() == 7);
+        test(c);
+        c.max_load_factor(2);
+        c.rehash(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.rehash(31);
+        assert(c.bucket_count() == 31);
+        test(c);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/reserve.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/reserve.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/reserve.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/reserve.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void reserve(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class C>
+void test(const C& c)
+{
+    assert(c.size() == 6);
+    assert(c.count(1) == 2);
+    assert(c.count(2) == 2);
+    assert(c.count(3) == 1);
+    assert(c.count(4) == 1);
+}
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 7);
+        c.reserve(3);
+        assert(c.bucket_count() == 7);
+        test(c);
+        c.max_load_factor(2);
+        c.reserve(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.reserve(31);
+        assert(c.bucket_count() >= 16);
+        test(c);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 7);
+        c.reserve(3);
+        assert(c.bucket_count() == 7);
+        test(c);
+        c.max_load_factor(2);
+        c.reserve(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.reserve(31);
+        assert(c.bucket_count() >= 16);
+        test(c);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/scary.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/scary.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/scary.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/scary.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// class unordered_set class unordered_multiset
+
+// Extension:  SCARY/N2913 iterator compatibility between unordered_set and unordered_multiset
+
+#include <unordered_set>
+
+int main()
+{
+    typedef std::unordered_set<int> M1;
+    typedef std::unordered_multiset<int> M2;
+    M2::iterator i;
+    M1::iterator j = i;
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/swap_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/swap_member.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/swap_member.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/swap_member.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,571 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void swap(unordered_multiset& __u);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../test_compare.h"
+#include "../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/types.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+// {
+// public:
+//     // types
+//     typedef Value                                                      value_type;
+//     typedef value_type                                                 key_type;
+//     typedef Hash                                                       hasher;
+//     typedef Pred                                                       key_equal;
+//     typedef Alloc                                                      allocator_type;
+//     typedef value_type&                                                reference;
+//     typedef const value_type&                                          const_reference;
+//     typedef typename allocator_traits<allocator_type>::pointer         pointer;
+//     typedef typename allocator_traits<allocator_type>::const_pointer   const_pointer;
+//     typedef typename allocator_traits<allocator_type>::size_type       size_type;
+//     typedef typename allocator_traits<allocator_type>::difference_type difference_type;
+
+#include <unordered_set>
+#include <type_traits>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<short> C;
+        static_assert((std::is_same<C::value_type, short>::value), "");
+        static_assert((std::is_same<C::key_type, short>::value), "");
+        static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
+        static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
+        static_assert((std::is_same<C::allocator_type, std::allocator<C::value_type> >::value), "");
+        static_assert((std::is_same<C::reference, C::value_type&>::value), "");
+        static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
+        static_assert((std::is_same<C::pointer, C::value_type*>::value), "");
+        static_assert((std::is_same<C::const_pointer, const C::value_type*>::value), "");
+        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+        static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<short, std::hash<short>,
+                                  std::equal_to<short>, min_allocator<short>> C;
+        static_assert((std::is_same<C::value_type, short>::value), "");
+        static_assert((std::is_same<C::key_type, short>::value), "");
+        static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
+        static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
+        static_assert((std::is_same<C::allocator_type, min_allocator<C::value_type> >::value), "");
+        static_assert((std::is_same<C::reference, C::value_type&>::value), "");
+        static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
+        static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
+        static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+        static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// explicit unordered_multiset(const allocator_type& __a);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(test_allocator<NotConstructible>(10));
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == test_allocator<NotConstructible>(10));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(min_allocator<NotConstructible>{});
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == min_allocator<NotConstructible>());
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef NotConstructible T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+
+        A a(43);
+        C c(3, a);
+        assert(c.bucket_count() == 3);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp ());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef NotConstructible T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+
+        HF hf(42);
+        A a(43);
+        C c(4, hf, a);
+        assert(c.bucket_count() == 4);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp ());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,209 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset& operator=(const unordered_multiset& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(4));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_multiset<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C *p = &c;
+        c = *p;
+
+        assert(c.size() == 6);
+        assert(std::is_permutation(c.begin(), c.end(), a));
+    }
+    {
+        typedef other_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = c0;
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A()
+           );
+        c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset& operator=(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        C c =   {
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        c =     {
+                    P(1),
+                    P(2),
+                    P(3),
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        C c =   {
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        c =     {
+                    P(1),
+                    P(2),
+                    P(3),
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,286 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset& operator=(unordered_multiset&& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(4));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(10)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef other_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A()
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 4);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A()
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_multiset<int> s1 = {1, 2, 3};
+        std::unordered_multiset<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_multiset<int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,171 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(const unordered_multiset& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   other_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            other_allocator<int>(10)
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == other_allocator<int>(-2));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(const unordered_multiset& u, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c(c0, test_allocator<int>(5));
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(5));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c(c0, min_allocator<int>());
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset();
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c;
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c;
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        std::unordered_multiset<int> c = {};
+        assert(c.bucket_count() == 0);
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_multiset()
+//    noexcept(
+//        is_nothrow_default_constructible<allocator_type>::value &&
+//        is_nothrow_default_constructible<key_compare>::value &&
+//        is_nothrow_copy_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+#include "../../../test_hash.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp();
+    some_comp(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// ~unordered_multiset() // implied noexcept;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+#if __has_feature(cxx_noexcept)
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    ~some_comp() noexcept(false);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+    ~some_hash() noexcept(false);
+};
+
+#endif
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,163 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c = {
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            };
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c = {
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            };
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+
+        A a(42);
+        C c({
+                T(1),
+                T(2),
+                T(3),
+                T(4),
+                T(1),
+                T(2)
+            }, 12, a);
+
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+
+        A a(42);
+        HF hf(43);
+        C c({
+                T(1),
+                T(2),
+                T(3),
+                T(4),
+                T(1),
+                T(2)
+            }, 12, hf, a);
+
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(initializer_list<value_type> il, size_type n);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(initializer_list<value_type> il, size_type n,
+//               const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,102 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(initializer_list<value_type> il, size_type n,
+//               const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(initializer_list<value_type> il, size_type n,
+//               const hasher& hf, const key_equal& eql, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,194 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(unordered_multiset&& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 0);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 0);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_multiset<int> s1 = {1, 2, 3};
+        std::unordered_multiset<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_multiset<int> s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,213 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(unordered_multiset&& u, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef int P;
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(std::move(c0), A(12));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 4);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(12));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef int P;
+        typedef test_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(std::move(c0), A(10));
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef int P;
+        typedef min_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(std::move(c0), A());
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        C::const_iterator i = c.cbegin();
+        assert(*i == 4);
+        ++i;
+        assert(*i == 3);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+        ++i;
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef int P;
+        typedef min_allocator<int> A;
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(std::move(c0), A());
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_multiset& operator=(unordered_multiset&& c)
+//     noexcept(
+//          allocator_type::propagate_on_container_move_assignment::value &&
+//          is_nothrow_move_assignable<allocator_type>::value &&
+//          is_nothrow_move_assignable<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp& operator=(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+    some_hash& operator=(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_multiset(unordered_multiset&&)
+//        noexcept(is_nothrow_move_constructible<allocator_type>::value &&
+//                 is_nothrow_move_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,167 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     unordered_multiset(InputIterator first, InputIterator last);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.bucket_count() >= 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+        T arr[] =
+        {
+            T(1),
+            T(2),
+            T(3),
+            T(4),
+            T(1),
+            T(2)
+        };
+        A a(42);
+        C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_multiset<T, HF, Comp, A> C;
+        T arr[] =
+        {
+            T(1),
+            T(2),
+            T(3),
+            T(4),
+            T(1),
+            T(2)
+        };
+        HF hf(43);
+        A a(42);
+        C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
+        assert(c.bucket_count() >= 16);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     unordered_multiset(InputIterator first, InputIterator last, size_type n);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     unordered_multiset(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     unordered_multiset(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// template <class InputIterator>
+//     unordered_multiset(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf, const key_equal& eql,
+//                   const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 6);
+        assert(c.count(1) == 2);
+        assert(c.count(2) == 2);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// explicit unordered_multiset(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c = 7;
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c = 7;
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// explicit unordered_multiset(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7);
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7);
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(size_type n, const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(size_type n, const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// unordered_multiset(size_type n, const hasher& hf, const key_equal& eql, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9),
+            test_allocator<std::pair<const NotConstructible, NotConstructible> >(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (test_allocator<NotConstructible>(10)));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_multiset<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9),
+            min_allocator<std::pair<const NotConstructible, NotConstructible> >()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/db_swap_1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/db_swap_1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/db_swap_1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/db_swap_1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void swap(unordered_multiset& x, unordered_multiset& y);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+#if _LIBCPP_DEBUG >= 1
+    {
+        int a1[] = {1, 3, 7, 9, 10};
+        int a2[] = {0, 2, 4, 5, 6, 8, 11};
+        std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+        std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+        std::unordered_multiset<int>::iterator i1 = c1.begin();
+        std::unordered_multiset<int>::iterator i2 = c2.begin();
+        swap(c1, c2);
+        c1.erase(i2);
+        c2.erase(i1);
+        std::unordered_multiset<int>::iterator j = i1;
+        c1.erase(i1);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// void swap(unordered_multiset& c)
+//     noexcept(!allocator_type::propagate_on_container_swap::value ||
+//              __is_nothrow_swappable<allocator_type>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    
+    some_comp() {}
+    some_comp(const some_comp&) {}
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash() {}
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_multiset<MoveOnly> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,571 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void swap(unordered_multiset& x, unordered_multiset& y);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 7);
+        assert(c2.size() == 6);
+        assert(c2.count(1) == 2);
+        assert(c2.count(2) == 2);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/bucket.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/bucket.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/bucket.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/bucket.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket(const key_type& __k) const;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        size_t bc = c.bucket_count();
+        assert(bc >= 5);
+        for (size_t i = 0; i < 13; ++i)
+            assert(c.bucket(i) == i % bc);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        size_t bc = c.bucket_count();
+        assert(bc >= 5);
+        for (size_t i = 0; i < 13; ++i)
+            assert(c.bucket(i) == i % bc);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_set<int> C;
+        C c;
+        C::size_type i = c.bucket(3);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/bucket_count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/bucket_count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/bucket_count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/bucket_count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket_count() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        const C c;
+        assert(c.bucket_count() == 0);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 11);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        const C c;
+        assert(c.bucket_count() == 0);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 11);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/bucket_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/bucket_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/bucket_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/bucket_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket_size(size_type n) const
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 5);
+        assert(c.bucket_size(0) == 0);
+        assert(c.bucket_size(1) == 1);
+        assert(c.bucket_size(2) == 1);
+        assert(c.bucket_size(3) == 1);
+        assert(c.bucket_size(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.bucket_count() >= 5);
+        assert(c.bucket_size(0) == 0);
+        assert(c.bucket_size(1) == 1);
+        assert(c.bucket_size(2) == 1);
+        assert(c.bucket_size(3) == 1);
+        assert(c.bucket_size(4) == 1);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_set<int> C;
+        C c;
+        C::size_type i = c.bucket_size(3);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/clear.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/clear.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/clear.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/clear.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void clear()
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        c.clear();
+        assert(c.size() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        c.clear();
+        assert(c.size() == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type count(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.count(30) == 1);
+        assert(c.count(50) == 1);
+        assert(c.count(5) == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(c.count(30) == 1);
+        assert(c.count(50) == 1);
+        assert(c.count(5) == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_7.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_7.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_7.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_set<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_set<T, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_8.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_8.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/db_iterators_8.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_set<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    T j = *i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_set<T, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.end();
+    T j = *i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_7.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_set<T> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_set<T, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+    }
+#endif
+
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/db_local_iterators_8.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+    typedef int T;
+    typedef std::unordered_set<T> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    T j = *i;
+    assert(false);
+    }
+#if __cplusplus >= 201103L
+    {
+    typedef int T;
+    typedef std::unordered_set<T, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    T j = *i;
+    assert(false);
+    }
+#endif
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/emplace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/emplace.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/emplace.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/emplace.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class... Args>
+//     pair<iterator, bool> emplace(Args&&... args);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../Emplaceable.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<Emplaceable> C;
+        typedef std::pair<C::iterator, bool> R;
+        C c;
+        R r = c.emplace();
+        assert(c.size() == 1);
+        assert(*r.first == Emplaceable());
+        assert(r.second);
+
+        r = c.emplace(Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r.first == Emplaceable(5, 6));
+        assert(r.second);
+
+        r = c.emplace(5, 6);
+        assert(c.size() == 2);
+        assert(*r.first == Emplaceable(5, 6));
+        assert(!r.second);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
+                      std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
+        typedef std::pair<C::iterator, bool> R;
+        C c;
+        R r = c.emplace();
+        assert(c.size() == 1);
+        assert(*r.first == Emplaceable());
+        assert(r.second);
+
+        r = c.emplace(Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r.first == Emplaceable(5, 6));
+        assert(r.second);
+
+        r = c.emplace(5, 6);
+        assert(c.size() == 2);
+        assert(*r.first == Emplaceable(5, 6));
+        assert(!r.second);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/emplace_hint.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/emplace_hint.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/emplace_hint.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/emplace_hint.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class... Args>
+//     iterator emplace_hint(const_iterator p, Args&&... args);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../Emplaceable.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<Emplaceable> C;
+        typedef C::iterator R;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.emplace_hint(e);
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace_hint(e, Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace_hint(r, 5, 6);
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
+                      std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
+        typedef C::iterator R;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.emplace_hint(e);
+        assert(c.size() == 1);
+        assert(*r == Emplaceable());
+
+        r = c.emplace_hint(e, Emplaceable(5, 6));
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+
+        r = c.emplace_hint(r, 5, 6);
+        assert(c.size() == 2);
+        assert(*r == Emplaceable(5, 6));
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_set<Emplaceable> C;
+        typedef C::iterator R;
+        C c1;
+        C c2;
+        R r = c1.emplace_hint(c2.begin(), 5, 6);
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/eq.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/eq.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/eq.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/eq.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,159 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Key, class Hash, class Pred, class Alloc>
+// bool
+// operator==(const unordered_set<Key, Hash, Pred, Alloc>& x,
+//            const unordered_set<Key, Hash, Pred, Alloc>& y);
+//
+// template <class Key, class Hash, class Pred, class Alloc>
+// bool
+// operator!=(const unordered_set<Key, Hash, Pred, Alloc>& x,
+//            const unordered_set<Key, Hash, Pred, Alloc>& y);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2;
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2 = c1;
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a), std::end(a));
+        C c2 = c1;
+        c2.rehash(30);
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+        c2.insert(P(90));
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+        c1.insert(P(90));
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2;
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c1(std::begin(a), std::end(a));
+        const C c2 = c1;
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a), std::end(a));
+        C c2 = c1;
+        c2.rehash(30);
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+        c2.insert(P(90));
+        assert(!(c1 == c2));
+        assert( (c1 != c2));
+        c1.insert(P(90));
+        assert( (c1 == c2));
+        assert(!(c1 != c2));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/equal_range_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/equal_range_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/equal_range_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/equal_range_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 50);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef C::const_iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 50);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/equal_range_non_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/equal_range_non_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/equal_range_non_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/equal_range_non_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// pair<iterator, iterator> equal_range(const key_type& k);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef C::iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 50);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef C::iterator I;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(50),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        std::pair<I, I> r = c.equal_range(30);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 30);
+        r = c.equal_range(5);
+        assert(std::distance(r.first, r.second) == 0);
+        r = c.equal_range(50);
+        assert(std::distance(r.first, r.second) == 1);
+        assert(*r.first == 50);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator erase(const_iterator p)
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::iterator j = c.erase(i);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::iterator j = c.erase(i);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with end()
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int>::const_iterator i = l1.end();
+    l1.erase(i);
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db2.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db2.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_db2.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <cstdlib>
+#include <exception>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int> l2(a1, a1+3);
+    std::unordered_set<int>::const_iterator i = l2.begin();
+    l1.erase(i);
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with first iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int> l2(a1, a1+3);
+    std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with second iterator from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int> l2(a1, a1+3);
+    std::unordered_set<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with both iterators from another container
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int> l2(a1, a1+3);
+    std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with a bad range
+
+#if _LIBCPP_DEBUG >= 1
+
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <exception>
+#include <cstdlib>
+
+int main()
+{
+    {
+    int a1[] = {1, 2, 3};
+    std::unordered_set<int> l1(a1, a1+3);
+    std::unordered_set<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
+    assert(false);
+    }
+}
+
+#else
+
+int main()
+{
+}
+
+#endif

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_key.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_key.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_key.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_key.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,175 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type erase(const key_type& k);
+
+#include <unordered_set>
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+#if __cplusplus >= 201103L
+template <typename Unordered>
+bool only_deletions ( const Unordered &whole, const Unordered &part ) {
+    typename Unordered::const_iterator w = whole.begin();
+    typename Unordered::const_iterator p = part.begin();
+    
+    while ( w != whole.end () && p != part.end()) {
+        if ( *w == *p )
+            p++;
+        w++;
+        }
+
+    return p == part.end();
+}
+#endif
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.erase(5) == 0);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 1);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 0);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(4) == 1);
+        assert(c.size() == 2);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(4) == 0);
+        assert(c.size() == 2);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 1);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 0);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(3) == 1);
+        assert(c.size() == 0);
+
+        assert(c.erase(3) == 0);
+        assert(c.size() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.erase(5) == 0);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 1);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(2) == 0);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        assert(c.erase(4) == 1);
+        assert(c.size() == 2);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(4) == 0);
+        assert(c.size() == 2);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 1);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(1) == 0);
+        assert(c.size() == 1);
+        assert(c.count(3) == 1);
+
+        assert(c.erase(3) == 1);
+        assert(c.size() == 0);
+
+        assert(c.erase(3) == 0);
+        assert(c.size() == 0);
+    }
+    {
+    typedef std::unordered_set<int> C;
+    C m, m2;
+    for ( int i = 0; i < 10; ++i ) {
+        m.insert(i);
+        m2.insert(i);
+        }
+    
+    C::iterator i = m2.begin();
+    int ctr = 0;
+    while (i != m2.end()) {
+        if (ctr++ % 2 == 0)
+            m2.erase(i++);
+        else
+            ++i;
+        }
+
+    assert (only_deletions (m, m2));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/erase_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/erase_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/erase_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/erase_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator erase(const_iterator first, const_iterator last)
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(i, j);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C::const_iterator i = c.find(2);
+        C::const_iterator j = next(i);
+        C::iterator k = c.erase(i, i);
+        assert(k == i);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(i, j);
+        assert(c.size() == 3);
+        assert(c.count(1) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+
+        k = c.erase(c.cbegin(), c.cend());
+        assert(c.size() == 0);
+        assert(k == c.end());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/find_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/find_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/find_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/find_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// const_iterator find(const key_type& k) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        C::const_iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        C::const_iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/find_non_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/find_non_const.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/find_non_const.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/find_non_const.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator find(const key_type& k);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        C::iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c(std::begin(a), std::end(a));
+        C::iterator i = c.find(30);
+        assert(*i == 30);
+        i = c.find(5);
+        assert(i == c.cend());
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// pair<iterator, bool> insert(const value_type& x);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<double> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(r.second);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(!r.second);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 2);
+        assert(*r.first == 4.5);
+        assert(r.second);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 3);
+        assert(*r.first == 5.5);
+        assert(r.second);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef C::value_type P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(r.second);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(!r.second);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 2);
+        assert(*r.first == 4.5);
+        assert(r.second);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 3);
+        assert(*r.first == 5.5);
+        assert(r.second);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator insert(const_iterator p, const value_type& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(4.5));
+        assert(c.size() == 2);
+        assert(*r == 4.5);
+
+        r = c.insert(e, P(5.5));
+        assert(c.size() == 3);
+        assert(*r == 5.5);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(4.5));
+        assert(c.size() == 2);
+        assert(*r == 4.5);
+
+        r = c.insert(e, P(5.5));
+        assert(c.size() == 3);
+        assert(*r == 5.5);
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_set<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        P v(3.5);
+        R r = c.insert(e, v);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator insert(const_iterator p, value_type&& x);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<double> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(r, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(4.5));
+        assert(c.size() == 2);
+        assert(*r == 4.5);
+
+        r = c.insert(e, P(5.5));
+        assert(c.size() == 3);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(r, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(e, P(4));
+        assert(c.size() == 2);
+        assert(*r == 4);
+
+        r = c.insert(e, P(5));
+        assert(c.size() == 3);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef C::iterator R;
+        typedef double P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(r, P(3.5));
+        assert(c.size() == 1);
+        assert(*r == 3.5);
+
+        r = c.insert(e, P(4.5));
+        assert(c.size() == 2);
+        assert(*r == 4.5);
+
+        r = c.insert(e, P(5.5));
+        assert(c.size() == 3);
+        assert(*r == 5.5);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                            std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
+        typedef C::iterator R;
+        typedef MoveOnly P;
+        C c;
+        C::const_iterator e = c.end();
+        R r = c.insert(e, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(r, P(3));
+        assert(c.size() == 1);
+        assert(*r == 3);
+
+        r = c.insert(e, P(4));
+        assert(c.size() == 2);
+        assert(*r == 4);
+
+        r = c.insert(e, P(5));
+        assert(c.size() == 3);
+        assert(*r == 5);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_set<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        R r = c.insert(e, P(3.5));
+        assert(false);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void insert(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        C c;
+        c.insert(
+                    {
+                        P(1),
+                        P(2),
+                        P(3),
+                        P(4),
+                        P(1),
+                        P(2)
+                    }
+                );
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        C c;
+        c.insert(
+                    {
+                        P(1),
+                        P(2),
+                        P(3),
+                        P(4),
+                        P(1),
+                        P(2)
+                    }
+                );
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     void insert(InputIterator first, InputIterator last);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_iterators.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c;
+        c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,134 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// pair<iterator, bool> insert(value_type&& x);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../MoveOnly.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<double> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef double P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(r.second);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(!r.second);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 2);
+        assert(*r.first == 4.5);
+        assert(r.second);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 3);
+        assert(*r.first == 5.5);
+        assert(r.second);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef MoveOnly P;
+        C c;
+        R r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r.first == 3);
+        assert(r.second);
+
+        r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r.first == 3);
+        assert(!r.second);
+
+        r = c.insert(P(4));
+        assert(c.size() == 2);
+        assert(*r.first == 4);
+        assert(r.second);
+
+        r = c.insert(P(5));
+        assert(c.size() == 3);
+        assert(*r.first == 5);
+        assert(r.second);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<double, std::hash<double>,
+                                std::equal_to<double>, min_allocator<double>> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef double P;
+        C c;
+        R r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(r.second);
+
+        r = c.insert(P(3.5));
+        assert(c.size() == 1);
+        assert(*r.first == 3.5);
+        assert(!r.second);
+
+        r = c.insert(P(4.5));
+        assert(c.size() == 2);
+        assert(*r.first == 4.5);
+        assert(r.second);
+
+        r = c.insert(P(5.5));
+        assert(c.size() == 3);
+        assert(*r.first == 5.5);
+        assert(r.second);
+    }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                            std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
+        typedef std::pair<C::iterator, bool> R;
+        typedef MoveOnly P;
+        C c;
+        R r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r.first == 3);
+        assert(r.second);
+
+        r = c.insert(P(3));
+        assert(c.size() == 1);
+        assert(*r.first == 3);
+        assert(!r.second);
+
+        r = c.insert(P(4));
+        assert(c.size() == 2);
+        assert(*r.first == 4);
+        assert(r.second);
+
+        r = c.insert(P(5));
+        assert(c.size() == 3);
+        assert(*r.first == 5);
+        assert(r.second);
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/iterators.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/iterators.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/iterators.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/iterators.fail.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator       begin()        {return __table_.begin();}
+// iterator       end()          {return __table_.end();}
+// const_iterator begin()  const {return __table_.begin();}
+// const_iterator end()    const {return __table_.end();}
+// const_iterator cbegin() const {return __table_.begin();}
+// const_iterator cend()   const {return __table_.end();}
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i = c.begin();
+        assert(*i == 1);
+        *i = 2;
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 6);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+    }
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/iterators.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/iterators.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/iterators.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,127 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// iterator       begin()        {return __table_.begin();}
+// iterator       end()          {return __table_.end();}
+// const_iterator begin()  const {return __table_.begin();}
+// const_iterator end()    const {return __table_.end();}
+// const_iterator cbegin() const {return __table_.begin();}
+// const_iterator cend()   const {return __table_.end();}
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i;
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::const_iterator i;
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::iterator i;
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        C::const_iterator i;
+    }
+#endif
+#if _LIBCPP_STD_VER > 11
+    { // N3644 testing
+        typedef std::unordered_set<int> C;
+        C::iterator ii1{}, ii2{};
+        C::iterator ii4 = ii1;
+        C::const_iterator cii{};
+        assert ( ii1 == ii2 );
+        assert ( ii1 == ii4 );
+
+        assert (!(ii1 != ii2 ));
+
+        assert ( (ii1 == cii ));
+        assert ( (cii == ii1 ));
+        assert (!(ii1 != cii ));
+        assert (!(cii != ii1 ));
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/load_factor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/load_factor.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/load_factor.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/load_factor.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// float load_factor() const
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        const C c;
+        assert(c.load_factor() == 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        const C c(std::begin(a), std::end(a));
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        const C c;
+        assert(c.load_factor() == 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,261 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// local_iterator       begin (size_type n);
+// local_iterator       end   (size_type n);
+// const_local_iterator begin (size_type n) const;
+// const_local_iterator end   (size_type n) const;
+// const_local_iterator cbegin(size_type n) const;
+// const_local_iterator cend  (size_type n) const;
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+        *i = 2;
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 1);
+        ++i;
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 2);
+        assert(*i == 2);
+        ++i;
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+
+        b = c.bucket(5);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(6);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+    }
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/local_iterators.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,388 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// local_iterator       begin (size_type n);
+// local_iterator       end   (size_type n);
+// const_local_iterator begin (size_type n) const;
+// const_local_iterator end   (size_type n) const;
+// const_local_iterator cbegin(size_type n) const;
+// const_local_iterator cend  (size_type n) const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.begin(b);
+        I j = c.end(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.begin(b);
+        j = c.end(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        typedef C::const_local_iterator I;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        const C c(a, a + sizeof(a)/sizeof(a[0]));
+        assert(c.bucket_count() >= 5);
+        C::size_type b = c.bucket(0);
+        I i = c.cbegin(b);
+        I j = c.cend(b);
+        assert(std::distance(i, j) == 0);
+
+        b = c.bucket(1);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 1);
+
+        b = c.bucket(2);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 2);
+
+        b = c.bucket(3);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 3);
+
+        b = c.bucket(4);
+        i = c.cbegin(b);
+        j = c.cend(b);
+        assert(std::distance(i, j) == 1);
+        assert(*i == 4);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/max_bucket_count.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/max_bucket_count.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/max_bucket_count.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/max_bucket_count.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type max_bucket_count() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        const C c;
+        assert(c.max_bucket_count() > 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        const C c;
+        assert(c.max_bucket_count() > 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/max_load_factor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/max_load_factor.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/max_load_factor.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/max_load_factor.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        const C c;
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        C c;
+        assert(c.max_load_factor() == 1);
+        c.max_load_factor(2.5);
+        assert(c.max_load_factor() == 2.5);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        const C c;
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        C c;
+        assert(c.max_load_factor() == 1);
+        c.max_load_factor(2.5);
+        assert(c.max_load_factor() == 2.5);
+    }
+#endif
+#if _LIBCPP_DEBUG_LEVEL >= 1
+    {
+        typedef std::unordered_set<int> C;
+        C c;
+        c.max_load_factor(-0.5f);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/max_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/max_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/max_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/max_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type max_size() const;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        std::unordered_set<int> u;
+        assert(u.max_size() > 0);
+    }
+#if __cplusplus >= 201103L
+    {
+        std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> u;
+        assert(u.max_size() > 0);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/rehash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/rehash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/rehash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/rehash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void rehash(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class C>
+void test(const C& c)
+{
+    assert(c.size() == 4);
+    assert(c.count(1) == 1);
+    assert(c.count(2) == 1);
+    assert(c.count(3) == 1);
+    assert(c.count(4) == 1);
+}
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 5);
+        c.rehash(3);
+        assert(c.bucket_count() == 5);
+        test(c);
+        c.max_load_factor(2);
+        c.rehash(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.rehash(31);
+        assert(c.bucket_count() == 31);
+        test(c);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 5);
+        c.rehash(3);
+        assert(c.bucket_count() == 5);
+        test(c);
+        c.max_load_factor(2);
+        c.rehash(3);
+        assert(c.bucket_count() == 3);
+        test(c);
+        c.rehash(31);
+        assert(c.bucket_count() == 31);
+        test(c);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/reserve.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/reserve.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/reserve.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/reserve.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void reserve(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class C>
+void test(const C& c)
+{
+    assert(c.size() == 4);
+    assert(c.count(1) == 1);
+    assert(c.count(2) == 1);
+    assert(c.count(3) == 1);
+    assert(c.count(4) == 1);
+}
+
+int main()
+{
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 5);
+        c.reserve(3);
+        assert(c.bucket_count() == 5);
+        test(c);
+        c.max_load_factor(2);
+        c.reserve(3);
+        assert(c.bucket_count() >= 2);
+        test(c);
+        c.reserve(31);
+        assert(c.bucket_count() >= 16);
+        test(c);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int, std::hash<int>,
+                                      std::equal_to<int>, min_allocator<int>> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        test(c);
+        assert(c.bucket_count() >= 5);
+        c.reserve(3);
+        assert(c.bucket_count() == 5);
+        test(c);
+        c.max_load_factor(2);
+        c.reserve(3);
+        assert(c.bucket_count() >= 2);
+        test(c);
+        c.reserve(31);
+        assert(c.bucket_count() >= 16);
+        test(c);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/swap_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/swap_member.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/swap_member.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/swap_member.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,571 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void swap(unordered_set& u);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../test_compare.h"
+#include "../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        c1.swap(c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/types.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+// {
+// public:
+//     // types
+//     typedef Value                                                      value_type;
+//     typedef value_type                                                 key_type;
+//     typedef Hash                                                       hasher;
+//     typedef Pred                                                       key_equal;
+//     typedef Alloc                                                      allocator_type;
+//     typedef value_type&                                                reference;
+//     typedef const value_type&                                          const_reference;
+//     typedef typename allocator_traits<allocator_type>::pointer         pointer;
+//     typedef typename allocator_traits<allocator_type>::const_pointer   const_pointer;
+//     typedef typename allocator_traits<allocator_type>::size_type       size_type;
+//     typedef typename allocator_traits<allocator_type>::difference_type difference_type;
+
+#include <unordered_set>
+#include <type_traits>
+
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<short> C;
+        static_assert((std::is_same<C::value_type, short>::value), "");
+        static_assert((std::is_same<C::key_type, short>::value), "");
+        static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
+        static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
+        static_assert((std::is_same<C::allocator_type, std::allocator<C::value_type> >::value), "");
+        static_assert((std::is_same<C::reference, C::value_type&>::value), "");
+        static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
+        static_assert((std::is_same<C::pointer, C::value_type*>::value), "");
+        static_assert((std::is_same<C::const_pointer, const C::value_type*>::value), "");
+        static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+        static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<short, std::hash<short>,
+                                  std::equal_to<short>, min_allocator<short>> C;
+        static_assert((std::is_same<C::value_type, short>::value), "");
+        static_assert((std::is_same<C::key_type, short>::value), "");
+        static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
+        static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
+        static_assert((std::is_same<C::allocator_type, min_allocator<C::value_type> >::value), "");
+        static_assert((std::is_same<C::reference, C::value_type&>::value), "");
+        static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
+        static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
+        static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
+    //  min_allocator doesn't have a size_type, so one gets synthesized
+        static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+        static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// explicit unordered_set(const allocator_type& __a);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(test_allocator<NotConstructible>(10));
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == test_allocator<NotConstructible>(10));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(min_allocator<NotConstructible>{});
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == min_allocator<NotConstructible>());
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef NotConstructible T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+
+        A a(43);
+        C c(3, a);
+        assert(c.bucket_count() == 3);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp ());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef NotConstructible T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+
+        HF hf(42);
+        A a(43);
+        C c(4, hf, a);
+        assert(c.bucket_count() == 4);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp ());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,184 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set& operator=(const unordered_set& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(4));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef std::unordered_set<int> C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(a, a + sizeof(a)/sizeof(a[0]));
+        C *p = &c;
+        c = *p;
+        assert(c.size() == 4);
+        assert(std::is_permutation(c.begin(), c.end(), a));
+    }
+    {
+        typedef other_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = c0;
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A()
+           );
+        c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set& operator=(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        C c =   {
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        c =     {
+                    P(1),
+                    P(2),
+                    P(3),
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        C c =   {
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        c =     {
+                    P(1),
+                    P(2),
+                    P(3),
+                    P(4),
+                    P(1),
+                    P(2)
+                };
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,225 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set& operator=(unordered_set&& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(4));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(10)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef other_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A(4)
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef min_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(a, a + 2,
+            7,
+            test_hash<std::hash<int> >(2),
+            test_compare<std::equal_to<int> >(3),
+            A()
+           );
+        c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_set<int> s1 = {1, 2, 3};
+        std::unordered_set<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_set<int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,147 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(const unordered_set& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   other_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            other_allocator<int>(10)
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == other_allocator<int>(-2));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = c0;
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,107 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(const unordered_set& u, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c(c0, test_allocator<int>(5));
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(5));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c(c0, min_allocator<int>());
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set();
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c;
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c;
+        assert(c.bucket_count() == 0);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        std::unordered_set<int> c = {};
+        assert(c.bucket_count() == 0);
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_set()
+//    noexcept(
+//        is_nothrow_default_constructible<allocator_type>::value &&
+//        is_nothrow_default_constructible<key_compare>::value &&
+//        is_nothrow_copy_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+#include "../../../test_hash.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp();
+    some_comp(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_default_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// ~unordered_set() // implied noexcept;
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+#if __has_feature(cxx_noexcept)
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    ~some_comp() noexcept(false);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+    ~some_hash() noexcept(false);
+};
+
+#endif
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_destructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,163 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(initializer_list<value_type> il);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c = {
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            };
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c = {
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            };
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+
+        A a(42);
+        C c({
+                T(1),
+                T(2),
+                T(3),
+                T(4),
+                T(1),
+                T(2)
+            }, 12, a);
+
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+
+        A a(42);
+        HF hf(43);
+        C c({
+                T(1),
+                T(2),
+                T(3),
+                T(4),
+                T(1),
+                T(2)
+            }, 12, hf, a);
+
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(initializer_list<value_type> il, size_type n);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(initializer_list<value_type> il, size_type n,
+//               const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,102 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(initializer_list<value_type> il, size_type n,
+//               const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(initializer_list<value_type> il, size_type n,
+//               const hasher& hf, const key_equal& eql, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        C c({
+                P(1),
+                P(2),
+                P(3),
+                P(4),
+                P(1),
+                P(2)
+            },
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,194 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(unordered_set&& u);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 0);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 0);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        C c = std::move(c0);
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_set<int> s1 = {1, 2, 3};
+        std::unordered_set<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_set<int> s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,156 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(unordered_set&& u, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        typedef int P;
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(std::move(c0), A(12));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(12));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+    {
+        typedef int P;
+        typedef test_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A(10)
+           );
+        C c(std::move(c0), A(10));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef int P;
+        typedef min_allocator<int> A;
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   A
+                                   > C;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c0(a, a + sizeof(a)/sizeof(a[0]),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            A()
+           );
+        C c(std::move(c0), A());
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == A());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+
+        assert(c0.empty());
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_set& operator=(unordered_set&& c)
+//     noexcept(
+//          allocator_type::propagate_on_container_move_assignment::value &&
+//          is_nothrow_move_assignable<allocator_type>::value &&
+//          is_nothrow_move_assignable<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp& operator=(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+    some_hash& operator=(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// unordered_set(unordered_set&&)
+//        noexcept(is_nothrow_move_constructible<allocator_type>::value &&
+//                 is_nothrow_move_constructible<key_compare>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    some_comp(const some_comp&);
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash();
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        static_assert(std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        static_assert(!std::is_nothrow_move_constructible<C>::value, "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,168 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     unordered_set(InputIterator first, InputIterator last);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
+        assert(c.bucket_count() >= 5);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if _LIBCPP_STD_VER > 11
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+        T arr[] =
+        {
+            T(1),
+            T(2),
+            T(3),
+            T(4),
+            T(1),
+            T(2)
+        };
+        A a(42);
+        C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
+        assert(c.bucket_count() >= 12);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == HF());
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+    {
+        typedef int T;
+        typedef test_hash<std::hash<T>> HF;
+        typedef test_compare<std::equal_to<T>> Comp;
+        typedef test_allocator<T> A;
+        typedef std::unordered_set<T, HF, Comp, A> C;
+        T arr[] =
+        {
+            T(1),
+            T(2),
+            T(3),
+            T(4),
+            T(1),
+            T(2)
+        };
+        HF hf(43);
+        A a(42);
+        C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
+        assert(c.bucket_count() >= 16);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == hf);
+        assert(!(c.hash_function() == HF()));
+        assert(c.key_eq() == Comp());
+        assert(c.get_allocator() == a);
+        assert(!(c.get_allocator() == A()));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+
+#endif
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     unordered_set(InputIterator first, InputIterator last, size_type n);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >());
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     unordered_set(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >());
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     unordered_set(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// template <class InputIterator>
+//     unordered_set(InputIterator first, InputIterator last, size_type n,
+//                   const hasher& hf, const key_equal& eql,
+//                   const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+#include <cfloat>
+
+#include "test_iterators.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   test_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            test_allocator<int>(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == test_allocator<int>(10));
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<int,
+                                   test_hash<std::hash<int> >,
+                                   test_compare<std::equal_to<int> >,
+                                   min_allocator<int>
+                                   > C;
+        typedef int P;
+        P a[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
+            7,
+            test_hash<std::hash<int> >(8),
+            test_compare<std::equal_to<int> >(9),
+            min_allocator<int>()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.size() == 4);
+        assert(c.count(1) == 1);
+        assert(c.count(2) == 1);
+        assert(c.count(3) == 1);
+        assert(c.count(4) == 1);
+        assert(c.hash_function() == test_hash<std::hash<int> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
+        assert(c.get_allocator() == min_allocator<int>());
+        assert(!c.empty());
+        assert(std::distance(c.begin(), c.end()) == c.size());
+        assert(std::distance(c.cbegin(), c.cend()) == c.size());
+        assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// explicit unordered_set(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c = 7;
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// explicit unordered_set(size_type n);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7);
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7);
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(size_type n, const hasher& hf);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(size_type n, const hasher& hf, const key_equal& eql);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (test_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// unordered_set(size_type n, const hasher& hf, const key_equal& eql, const allocator_type& a);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../NotConstructible.h"
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   test_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9),
+            test_allocator<NotConstructible>(10)
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (test_allocator<NotConstructible>(10)));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef std::unordered_set<NotConstructible,
+                                   test_hash<std::hash<NotConstructible> >,
+                                   test_compare<std::equal_to<NotConstructible> >,
+                                   min_allocator<NotConstructible>
+                                   > C;
+        C c(7,
+            test_hash<std::hash<NotConstructible> >(8),
+            test_compare<std::equal_to<NotConstructible> >(9),
+            min_allocator<NotConstructible>()
+           );
+        assert(c.bucket_count() == 7);
+        assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
+        assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
+        assert(c.get_allocator() == (min_allocator<NotConstructible>()));
+        assert(c.size() == 0);
+        assert(c.empty());
+        assert(std::distance(c.begin(), c.end()) == 0);
+        assert(c.load_factor() == 0);
+        assert(c.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/db_swap_1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/db_swap_1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/db_swap_1.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/db_swap_1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void swap(unordered_set& x, unordered_set& y);
+
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <unordered_set>
+#include <cassert>
+
+int main()
+{
+#if _LIBCPP_DEBUG >= 1
+    {
+        int a1[] = {1, 3, 7, 9, 10};
+        int a2[] = {0, 2, 4, 5, 6, 8, 11};
+        std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+        std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+        std::unordered_set<int>::iterator i1 = c1.begin();
+        std::unordered_set<int>::iterator i2 = c2.begin();
+        swap(c1, c2);
+        c1.erase(i2);
+        c2.erase(i1);
+        std::unordered_set<int>::iterator j = i1;
+        c1.erase(i1);
+        assert(false);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// void swap(unordered_set& c)
+//     noexcept(!allocator_type::propagate_on_container_swap::value ||
+//              __is_nothrow_swappable<allocator_type>::value);
+
+// This tests a conforming extension
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../MoveOnly.h"
+#include "test_allocator.h"
+
+template <class T>
+struct some_comp
+{
+    typedef T value_type;
+    
+    some_comp() {}
+    some_comp(const some_comp&) {}
+};
+
+template <class T>
+struct some_hash
+{
+    typedef T value_type;
+    some_hash() {}
+    some_hash(const some_hash&);
+};
+
+int main()
+{
+#if __has_feature(cxx_noexcept)
+    {
+        typedef std::unordered_set<MoveOnly> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                           std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                          std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
+        C c1, c2;
+        static_assert(noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+    {
+        typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
+                                                         some_comp<MoveOnly>> C;
+        C c1, c2;
+        static_assert(!noexcept(swap(c1, c2)), "");
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,571 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void swap(unordered_set& x, unordered_set& y);
+
+#include <unordered_set>
+#include <cassert>
+
+#include "../../../test_compare.h"
+#include "../../../test_hash.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+int main()
+{
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef test_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(1));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(2));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef other_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc(2));
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc(1));
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#if __cplusplus >= 201103L
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() == 0);
+        assert(c2.size() == 0);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() == 0);
+        assert(c1.size() == 0);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+    {
+        typedef test_hash<std::hash<int> > Hash;
+        typedef test_compare<std::equal_to<int> > Compare;
+        typedef min_allocator<int> Alloc;
+        typedef std::unordered_set<int, Hash, Compare, Alloc> C;
+        typedef int P;
+        P a1[] =
+        {
+            P(1),
+            P(2),
+            P(3),
+            P(4),
+            P(1),
+            P(2)
+        };
+        P a2[] =
+        {
+            P(10),
+            P(20),
+            P(30),
+            P(40),
+            P(50),
+            P(60),
+            P(70),
+            P(80)
+        };
+        C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc());
+        C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc());
+        c2.max_load_factor(2);
+        swap(c1, c2);
+
+        assert(c1.bucket_count() >= 11);
+        assert(c1.size() == 8);
+        assert(*c1.find(10) == 10);
+        assert(*c1.find(20) == 20);
+        assert(*c1.find(30) == 30);
+        assert(*c1.find(40) == 40);
+        assert(*c1.find(50) == 50);
+        assert(*c1.find(60) == 60);
+        assert(*c1.find(70) == 70);
+        assert(*c1.find(80) == 80);
+        assert(c1.hash_function() == Hash(2));
+        assert(c1.key_eq() == Compare(2));
+        assert(c1.get_allocator() == Alloc());
+        assert(std::distance(c1.begin(), c1.end()) == c1.size());
+        assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+        assert(c1.max_load_factor() == 2);
+
+        assert(c2.bucket_count() >= 5);
+        assert(c2.size() == 4);
+        assert(c2.count(1) == 1);
+        assert(c2.count(2) == 1);
+        assert(c2.count(3) == 1);
+        assert(c2.count(4) == 1);
+        assert(c2.hash_function() == Hash(1));
+        assert(c2.key_eq() == Compare(1));
+        assert(c2.get_allocator() == Alloc());
+        assert(std::distance(c2.begin(), c2.end()) == c2.size());
+        assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+        assert(c2.max_load_factor() == 1);
+    }
+#endif
+}

Added: libcxx/trunk/test/std/containers/unord/unord.set/version.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/version.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/version.pass.cpp (added)
+++ libcxx/trunk/test/std/containers/unord/unord.set/version.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+#include <unordered_set>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/A.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/A.h?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/A.h (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/A.h Fri Dec 19 19:40:03 2014
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef A_H
+#define A_H
+
+#include <cassert>
+
+class A
+{
+    int id_;
+public:
+    explicit A(int id) : id_(id) {++count;}
+    A(const A& a) : id_(a.id_) {++count;}
+    ~A() {assert(id_ >= 0); id_ = -1; --count;}
+
+    int id() const {return id_;}
+
+    static int count;
+};
+
+int A::count = 0;
+
+#endif  // A_H

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/AB.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/AB.h?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/AB.h (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/AB.h Fri Dec 19 19:40:03 2014
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef AB_H
+#define AB_H
+
+#include <cassert>
+
+class A
+{
+    int id_;
+public:
+    explicit A(int id) : id_(id) {++count;}
+    A(const A& a) : id_(a.id_) {++count;}
+    virtual ~A() {assert(id_ >= 0); id_ = -1; --count;}
+
+    static int count;
+};
+
+int A::count = 0;
+
+class B
+    : public A
+{
+public:
+    explicit B(int id) : A(id) {++count;}
+    B(const B& a) : A(a) {++count;}
+    virtual ~B() {--count;}
+
+    static int count;
+};
+
+int B::count = 0;
+
+#endif  // AB_H

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.fail.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr& operator=(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p1 = new A(1);
+    const std::auto_ptr<A> ap1(p1);
+    A* p2 = new A(2);
+    std::auto_ptr<A> ap2(p2);
+    assert(A::count == 2);
+    assert(ap1.get() == p1);
+    assert(ap2.get() == p2);
+    std::auto_ptr<A>& apr = ap2 = ap1;
+    assert(&apr == &ap2);
+    assert(A::count == 1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p1);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr& operator=(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p1 = new A(1);
+    std::auto_ptr<A> ap1(p1);
+    A* p2 = new A(2);
+    std::auto_ptr<A> ap2(p2);
+    assert(A::count == 2);
+    assert(ap1.get() == p1);
+    assert(ap2.get() == p2);
+    std::auto_ptr<A>& apr = ap2 = ap1;
+    assert(&apr == &ap2);
+    assert(A::count == 1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p1);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.fail.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    {
+    B* p = new B(1);
+    const std::auto_ptr<B> ap1(p);
+    std::auto_ptr<A> ap2(ap1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    {
+    B* p = new B(1);
+    std::auto_ptr<B> ap1(p);
+    std::auto_ptr<A> ap2(ap1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.fail.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// template<class Y> auto_ptr& operator=(auto_ptr<Y>& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    {
+    B* p1 = new B(1);
+    const std::auto_ptr<B> ap1(p1);
+    A* p2 = new A(2);
+    std::auto_ptr<A> ap2(p2);
+    assert(A::count == 2);
+    assert(B::count == 1);
+    assert(ap1.get() == p1);
+    assert(ap2.get() == p2);
+    std::auto_ptr<A>& apr = ap2 = ap1;
+    assert(&apr == &ap2);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// template<class Y> auto_ptr& operator=(auto_ptr<Y>& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    {
+    B* p1 = new B(1);
+    std::auto_ptr<B> ap1(p1);
+    A* p2 = new A(2);
+    std::auto_ptr<A> ap2(p2);
+    assert(A::count == 2);
+    assert(B::count == 1);
+    assert(ap1.get() == p1);
+    assert(ap2.get() == p2);
+    std::auto_ptr<A>& apr = ap2 = ap1;
+    assert(&apr == &ap2);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.fail.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    const std::auto_ptr<A> ap1(p);
+    std::auto_ptr<A> ap2(ap1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr(auto_ptr& a) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap1(p);
+    std::auto_ptr<A> ap2(ap1);
+    assert(ap1.get() == 0);
+    assert(ap2.get() == p);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/explicit.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/explicit.fail.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/explicit.fail.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/explicit.fail.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// explicit auto_ptr(X* p =0) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap = p;
+    assert(ap.get() == p);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+    {
+    std::auto_ptr<A> ap;
+    assert(ap.get() == 0);
+    }
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// explicit auto_ptr(X* p =0) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    assert(ap.get() == p);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+    {
+    std::auto_ptr<A> ap;
+    assert(ap.get() == 0);
+    }
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr& operator=(auto_ptr_ref<X> r) throw()
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p1 = new A(1);
+    std::auto_ptr<A> ap1(p1);
+    std::auto_ptr_ref<A> apr = ap1;
+    std::auto_ptr<A> ap2(new A(2));
+    ap2 = apr;
+    assert(A::count == 1);
+    assert(ap2.get() == p1);
+    assert(ap1.get() == 0);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// auto_ptr(auto_ptr_ref<X> r) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    {
+    B* p1 = new B(1);
+    std::auto_ptr<B> ap1(p1);
+    std::auto_ptr_ref<A> apr = ap1;
+    std::auto_ptr<A> ap2(apr);
+    assert(ap2.get() == p1);
+    assert(ap1.get() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// template<class Y> operator auto_ptr<Y>() throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+std::auto_ptr<B>
+source()
+{
+    return std::auto_ptr<B>(new B(1));
+}
+
+void
+test()
+{
+    std::auto_ptr<A> ap2(source());
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// template<class Y> operator auto_ptr_ref<Y>() throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../AB.h"
+
+void
+test()
+{
+    B* p1 = new B(1);
+    std::auto_ptr<B> ap1(p1);
+    std::auto_ptr_ref<A> apr = ap1;
+    delete p1;
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// X& operator*() const throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    assert(ap->id() == 1);
+    *ap = A(3);
+    assert(ap->id() == 3);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// X& operator*() const throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    const std::auto_ptr<A> ap(p);
+    assert((*ap).id() == 1);
+    *ap = A(3);
+    assert((*ap).id() == 3);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// X* release() throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    A* p2 = ap.release();
+    assert(p2 == p);
+    assert(ap.get() == 0);
+    delete p;
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X> class auto_ptr;
+
+// void reset(X* p=0) throw();
+
+#include <memory>
+#include <cassert>
+
+#include "../A.h"
+
+void
+test()
+{
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    ap.reset();
+    assert(ap.get() == 0);
+    assert(A::count == 0);
+    }
+    assert(A::count == 0);
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    ap.reset(p);
+    assert(ap.get() == p);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+    {
+    A* p = new A(1);
+    std::auto_ptr<A> ap(p);
+    A* p2 = new A(2);
+    ap.reset(p2);
+    assert(ap.get() == p2);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
+
+int main()
+{
+    test();
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class X>
+// class auto_ptr
+// {
+// public:
+//   typedef X element_type;
+//   ...
+// };
+
+#include <memory>
+#include <type_traits>
+
+template <class T>
+void
+test()
+{
+    static_assert((std::is_same<typename std::auto_ptr<T>::element_type, T>::value), "");
+}
+
+int main()
+{
+    test<int>();
+    test<double>();
+    test<void>();
+    std::auto_ptr<void> p;
+}

Added: libcxx/trunk/test/std/depr/depr.auto.ptr/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.auto.ptr/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.auto.ptr/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.auto.ptr/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/assert_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/assert_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/assert_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/assert_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <assert.h>
+
+#include <assert.h>
+
+#ifndef assert
+#error assert not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/ciso646.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/ciso646.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/ciso646.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/ciso646.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ciso646>
+
+#include <ciso646>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/complex.h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/complex.h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/complex.h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/complex.h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <complex.h>
+
+#include <complex.h>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+    std::complex<double> d;
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/ctype_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/ctype_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/ctype_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/ctype_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,103 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ctype.h>
+
+#include <ctype.h>
+#include <type_traits>
+#include <cassert>
+
+#ifdef isalnum
+#error isalnum defined
+#endif
+
+#ifdef isalpha
+#error isalpha defined
+#endif
+
+#ifdef isblank
+#error isblank defined
+#endif
+
+#ifdef iscntrl
+#error iscntrl defined
+#endif
+
+#ifdef isdigit
+#error isdigit defined
+#endif
+
+#ifdef isgraph
+#error isgraph defined
+#endif
+
+#ifdef islower
+#error islower defined
+#endif
+
+#ifdef isprint
+#error isprint defined
+#endif
+
+#ifdef ispunct
+#error ispunct defined
+#endif
+
+#ifdef isspace
+#error isspace defined
+#endif
+
+#ifdef isupper
+#error isupper defined
+#endif
+
+#ifdef isxdigit
+#error isxdigit defined
+#endif
+
+#ifdef tolower
+#error tolower defined
+#endif
+
+#ifdef toupper
+#error toupper defined
+#endif
+
+int main()
+{
+    static_assert((std::is_same<decltype(isalnum(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isalpha(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isblank(0)), int>::value), "");
+    static_assert((std::is_same<decltype(iscntrl(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isdigit(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isgraph(0)), int>::value), "");
+    static_assert((std::is_same<decltype(islower(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isprint(0)), int>::value), "");
+    static_assert((std::is_same<decltype(ispunct(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isspace(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isupper(0)), int>::value), "");
+    static_assert((std::is_same<decltype(isxdigit(0)), int>::value), "");
+    static_assert((std::is_same<decltype(tolower(0)), int>::value), "");
+    static_assert((std::is_same<decltype(toupper(0)), int>::value), "");
+
+    assert(isalnum('a'));
+    assert(isalpha('a'));
+    assert(isblank(' '));
+    assert(!iscntrl(' '));
+    assert(!isdigit('a'));
+    assert(isgraph('a'));
+    assert(islower('a'));
+    assert(isprint('a'));
+    assert(!ispunct('a'));
+    assert(!isspace('a'));
+    assert(!isupper('a'));
+    assert(isxdigit('a'));
+    assert(tolower('A') == 'a');
+    assert(toupper('a') == 'A');
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/errno_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/errno_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/errno_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/errno_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <errno.h>
+
+#include <errno.h>
+
+#ifndef EDOM
+#error EDOM not defined
+#endif
+
+#ifndef EILSEQ
+#error EILSEQ not defined
+#endif
+
+#ifndef ERANGE
+#error ERANGE not defined
+#endif
+
+#ifndef errno
+#error errno not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/fenv_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/fenv_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/fenv_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/fenv_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: newlib
+
+// <fenv.h>
+
+#include <fenv.h>
+#include <type_traits>
+
+#ifndef FE_DIVBYZERO
+#error FE_DIVBYZERO not defined
+#endif
+
+#ifndef FE_INEXACT
+#error FE_INEXACT not defined
+#endif
+
+#ifndef FE_INVALID
+#error FE_INVALID not defined
+#endif
+
+#ifndef FE_OVERFLOW
+#error FE_OVERFLOW not defined
+#endif
+
+#ifndef FE_UNDERFLOW
+#error FE_UNDERFLOW not defined
+#endif
+
+#ifndef FE_ALL_EXCEPT
+#error FE_ALL_EXCEPT not defined
+#endif
+
+#ifndef FE_DOWNWARD
+#error FE_DOWNWARD not defined
+#endif
+
+#ifndef FE_TONEAREST
+#error FE_TONEAREST not defined
+#endif
+
+#ifndef FE_TOWARDZERO
+#error FE_TOWARDZERO not defined
+#endif
+
+#ifndef FE_UPWARD
+#error FE_UPWARD not defined
+#endif
+
+#ifndef FE_DFL_ENV
+#error FE_DFL_ENV not defined
+#endif
+
+int main()
+{
+    fenv_t fenv = {0};
+    fexcept_t fex = 0;
+    static_assert((std::is_same<decltype(feclearexcept(0)), int>::value), "");
+    static_assert((std::is_same<decltype(fegetexceptflag(&fex, 0)), int>::value), "");
+    static_assert((std::is_same<decltype(feraiseexcept(0)), int>::value), "");
+    static_assert((std::is_same<decltype(fesetexceptflag(&fex, 0)), int>::value), "");
+    static_assert((std::is_same<decltype(fetestexcept(0)), int>::value), "");
+    static_assert((std::is_same<decltype(fegetround()), int>::value), "");
+    static_assert((std::is_same<decltype(fesetround(0)), int>::value), "");
+    static_assert((std::is_same<decltype(fegetenv(&fenv)), int>::value), "");
+    static_assert((std::is_same<decltype(feholdexcept(&fenv)), int>::value), "");
+    static_assert((std::is_same<decltype(fesetenv(&fenv)), int>::value), "");
+    static_assert((std::is_same<decltype(feupdateenv(&fenv)), int>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/float_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,140 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+ // test <float.h>
+
+#include <float.h>
+
+#ifndef FLT_ROUNDS
+#error FLT_ROUNDS not defined
+#endif
+
+#ifndef FLT_EVAL_METHOD
+#error FLT_EVAL_METHOD not defined
+#endif
+
+#ifndef FLT_RADIX
+#error FLT_RADIX not defined
+#endif
+
+#ifndef FLT_MANT_DIG
+#error FLT_MANT_DIG not defined
+#endif
+
+#ifndef DBL_MANT_DIG
+#error DBL_MANT_DIG not defined
+#endif
+
+#ifndef LDBL_MANT_DIG
+#error LDBL_MANT_DIG not defined
+#endif
+
+#ifndef DECIMAL_DIG
+#error DECIMAL_DIG not defined
+#endif
+
+#ifndef FLT_DIG
+#error FLT_DIG not defined
+#endif
+
+#ifndef DBL_DIG
+#error DBL_DIG not defined
+#endif
+
+#ifndef LDBL_DIG
+#error LDBL_DIG not defined
+#endif
+
+#ifndef FLT_MIN_EXP
+#error FLT_MIN_EXP not defined
+#endif
+
+#ifndef DBL_MIN_EXP
+#error DBL_MIN_EXP not defined
+#endif
+
+#ifndef LDBL_MIN_EXP
+#error LDBL_MIN_EXP not defined
+#endif
+
+#ifndef FLT_MIN_10_EXP
+#error FLT_MIN_10_EXP not defined
+#endif
+
+#ifndef DBL_MIN_10_EXP
+#error DBL_MIN_10_EXP not defined
+#endif
+
+#ifndef LDBL_MIN_10_EXP
+#error LDBL_MIN_10_EXP not defined
+#endif
+
+#ifndef FLT_MAX_EXP
+#error FLT_MAX_EXP not defined
+#endif
+
+#ifndef DBL_MAX_EXP
+#error DBL_MAX_EXP not defined
+#endif
+
+#ifndef LDBL_MAX_EXP
+#error LDBL_MAX_EXP not defined
+#endif
+
+#ifndef FLT_MAX_10_EXP
+#error FLT_MAX_10_EXP not defined
+#endif
+
+#ifndef DBL_MAX_10_EXP
+#error DBL_MAX_10_EXP not defined
+#endif
+
+#ifndef LDBL_MAX_10_EXP
+#error LDBL_MAX_10_EXP not defined
+#endif
+
+#ifndef FLT_MAX
+#error FLT_MAX not defined
+#endif
+
+#ifndef DBL_MAX
+#error DBL_MAX not defined
+#endif
+
+#ifndef LDBL_MAX
+#error LDBL_MAX not defined
+#endif
+
+#ifndef FLT_EPSILON
+#error FLT_EPSILON not defined
+#endif
+
+#ifndef DBL_EPSILON
+#error DBL_EPSILON not defined
+#endif
+
+#ifndef LDBL_EPSILON
+#error LDBL_EPSILON not defined
+#endif
+
+#ifndef FLT_MIN
+#error FLT_MIN not defined
+#endif
+
+#ifndef DBL_MIN
+#error DBL_MIN not defined
+#endif
+
+#ifndef LDBL_MIN
+#error LDBL_MIN not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/inttypes_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/inttypes_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/inttypes_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,643 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <inttypes.h>
+
+#include <inttypes.h>
+#include <type_traits>
+
+#ifndef PRId8
+#error PRId8 not defined
+#endif
+
+#ifndef PRId16
+#error PRId16 not defined
+#endif
+
+#ifndef PRId32
+#error PRId32 not defined
+#endif
+
+#ifndef PRId64
+#error PRId64 not defined
+#endif
+
+#ifndef PRIdLEAST8
+#error PRIdLEAST8 not defined
+#endif
+
+#ifndef PRIdLEAST16
+#error PRIdLEAST16 not defined
+#endif
+
+#ifndef PRIdLEAST32
+#error PRIdLEAST32 not defined
+#endif
+
+#ifndef PRIdLEAST64
+#error PRIdLEAST64 not defined
+#endif
+
+#ifndef PRIdFAST8
+#error PRIdFAST8 not defined
+#endif
+
+#ifndef PRIdFAST16
+#error PRIdFAST16 not defined
+#endif
+
+#ifndef PRIdFAST32
+#error PRIdFAST32 not defined
+#endif
+
+#ifndef PRIdFAST64
+#error PRIdFAST64 not defined
+#endif
+
+#ifndef PRIdMAX
+#error PRIdMAX not defined
+#endif
+
+#ifndef PRIdPTR
+#error PRIdPTR not defined
+#endif
+
+#ifndef PRIi8
+#error PRIi8 not defined
+#endif
+
+#ifndef PRIi16
+#error PRIi16 not defined
+#endif
+
+#ifndef PRIi32
+#error PRIi32 not defined
+#endif
+
+#ifndef PRIi64
+#error PRIi64 not defined
+#endif
+
+#ifndef PRIiLEAST8
+#error PRIiLEAST8 not defined
+#endif
+
+#ifndef PRIiLEAST16
+#error PRIiLEAST16 not defined
+#endif
+
+#ifndef PRIiLEAST32
+#error PRIiLEAST32 not defined
+#endif
+
+#ifndef PRIiLEAST64
+#error PRIiLEAST64 not defined
+#endif
+
+#ifndef PRIiFAST8
+#error PRIiFAST8 not defined
+#endif
+
+#ifndef PRIiFAST16
+#error PRIiFAST16 not defined
+#endif
+
+#ifndef PRIiFAST32
+#error PRIiFAST32 not defined
+#endif
+
+#ifndef PRIiFAST64
+#error PRIiFAST64 not defined
+#endif
+
+#ifndef PRIiMAX
+#error PRIiMAX not defined
+#endif
+
+#ifndef PRIiPTR
+#error PRIiPTR not defined
+#endif
+
+#ifndef PRIo8
+#error PRIo8 not defined
+#endif
+
+#ifndef PRIo16
+#error PRIo16 not defined
+#endif
+
+#ifndef PRIo32
+#error PRIo32 not defined
+#endif
+
+#ifndef PRIo64
+#error PRIo64 not defined
+#endif
+
+#ifndef PRIoLEAST8
+#error PRIoLEAST8 not defined
+#endif
+
+#ifndef PRIoLEAST16
+#error PRIoLEAST16 not defined
+#endif
+
+#ifndef PRIoLEAST32
+#error PRIoLEAST32 not defined
+#endif
+
+#ifndef PRIoLEAST64
+#error PRIoLEAST64 not defined
+#endif
+
+#ifndef PRIoFAST8
+#error PRIoFAST8 not defined
+#endif
+
+#ifndef PRIoFAST16
+#error PRIoFAST16 not defined
+#endif
+
+#ifndef PRIoFAST32
+#error PRIoFAST32 not defined
+#endif
+
+#ifndef PRIoFAST64
+#error PRIoFAST64 not defined
+#endif
+
+#ifndef PRIoMAX
+#error PRIoMAX not defined
+#endif
+
+#ifndef PRIoPTR
+#error PRIoPTR not defined
+#endif
+
+#ifndef PRIu8
+#error PRIu8 not defined
+#endif
+
+#ifndef PRIu16
+#error PRIu16 not defined
+#endif
+
+#ifndef PRIu32
+#error PRIu32 not defined
+#endif
+
+#ifndef PRIu64
+#error PRIu64 not defined
+#endif
+
+#ifndef PRIuLEAST8
+#error PRIuLEAST8 not defined
+#endif
+
+#ifndef PRIuLEAST16
+#error PRIuLEAST16 not defined
+#endif
+
+#ifndef PRIuLEAST32
+#error PRIuLEAST32 not defined
+#endif
+
+#ifndef PRIuLEAST64
+#error PRIuLEAST64 not defined
+#endif
+
+#ifndef PRIuFAST8
+#error PRIuFAST8 not defined
+#endif
+
+#ifndef PRIuFAST16
+#error PRIuFAST16 not defined
+#endif
+
+#ifndef PRIuFAST32
+#error PRIuFAST32 not defined
+#endif
+
+#ifndef PRIuFAST64
+#error PRIuFAST64 not defined
+#endif
+
+#ifndef PRIuMAX
+#error PRIuMAX not defined
+#endif
+
+#ifndef PRIuPTR
+#error PRIuPTR not defined
+#endif
+
+#ifndef PRIx8
+#error PRIx8 not defined
+#endif
+
+#ifndef PRIx16
+#error PRIx16 not defined
+#endif
+
+#ifndef PRIx32
+#error PRIx32 not defined
+#endif
+
+#ifndef PRIx64
+#error PRIx64 not defined
+#endif
+
+#ifndef PRIxLEAST8
+#error PRIxLEAST8 not defined
+#endif
+
+#ifndef PRIxLEAST16
+#error PRIxLEAST16 not defined
+#endif
+
+#ifndef PRIxLEAST32
+#error PRIxLEAST32 not defined
+#endif
+
+#ifndef PRIxLEAST64
+#error PRIxLEAST64 not defined
+#endif
+
+#ifndef PRIxFAST8
+#error PRIxFAST8 not defined
+#endif
+
+#ifndef PRIxFAST16
+#error PRIxFAST16 not defined
+#endif
+
+#ifndef PRIxFAST32
+#error PRIxFAST32 not defined
+#endif
+
+#ifndef PRIxFAST64
+#error PRIxFAST64 not defined
+#endif
+
+#ifndef PRIxMAX
+#error PRIxMAX not defined
+#endif
+
+#ifndef PRIxPTR
+#error PRIxPTR not defined
+#endif
+
+#ifndef PRIX8
+#error PRIX8 not defined
+#endif
+
+#ifndef PRIX16
+#error PRIX16 not defined
+#endif
+
+#ifndef PRIX32
+#error PRIX32 not defined
+#endif
+
+#ifndef PRIX64
+#error PRIX64 not defined
+#endif
+
+#ifndef PRIXLEAST8
+#error PRIXLEAST8 not defined
+#endif
+
+#ifndef PRIXLEAST16
+#error PRIXLEAST16 not defined
+#endif
+
+#ifndef PRIXLEAST32
+#error PRIXLEAST32 not defined
+#endif
+
+#ifndef PRIXLEAST64
+#error PRIXLEAST64 not defined
+#endif
+
+#ifndef PRIXFAST8
+#error PRIXFAST8 not defined
+#endif
+
+#ifndef PRIXFAST16
+#error PRIXFAST16 not defined
+#endif
+
+#ifndef PRIXFAST32
+#error PRIXFAST32 not defined
+#endif
+
+#ifndef PRIXFAST64
+#error PRIXFAST64 not defined
+#endif
+
+#ifndef PRIXMAX
+#error PRIXMAX not defined
+#endif
+
+#ifndef PRIXPTR
+#error PRIXPTR not defined
+#endif
+
+#ifndef SCNd8
+#error SCNd8 not defined
+#endif
+
+#ifndef SCNd16
+#error SCNd16 not defined
+#endif
+
+#ifndef SCNd32
+#error SCNd32 not defined
+#endif
+
+#ifndef SCNd64
+#error SCNd64 not defined
+#endif
+
+#ifndef SCNdLEAST8
+#error SCNdLEAST8 not defined
+#endif
+
+#ifndef SCNdLEAST16
+#error SCNdLEAST16 not defined
+#endif
+
+#ifndef SCNdLEAST32
+#error SCNdLEAST32 not defined
+#endif
+
+#ifndef SCNdLEAST64
+#error SCNdLEAST64 not defined
+#endif
+
+#ifndef SCNdFAST8
+#error SCNdFAST8 not defined
+#endif
+
+#ifndef SCNdFAST16
+#error SCNdFAST16 not defined
+#endif
+
+#ifndef SCNdFAST32
+#error SCNdFAST32 not defined
+#endif
+
+#ifndef SCNdFAST64
+#error SCNdFAST64 not defined
+#endif
+
+#ifndef SCNdMAX
+#error SCNdMAX not defined
+#endif
+
+#ifndef SCNdPTR
+#error SCNdPTR not defined
+#endif
+
+#ifndef SCNi8
+#error SCNi8 not defined
+#endif
+
+#ifndef SCNi16
+#error SCNi16 not defined
+#endif
+
+#ifndef SCNi32
+#error SCNi32 not defined
+#endif
+
+#ifndef SCNi64
+#error SCNi64 not defined
+#endif
+
+#ifndef SCNiLEAST8
+#error SCNiLEAST8 not defined
+#endif
+
+#ifndef SCNiLEAST16
+#error SCNiLEAST16 not defined
+#endif
+
+#ifndef SCNiLEAST32
+#error SCNiLEAST32 not defined
+#endif
+
+#ifndef SCNiLEAST64
+#error SCNiLEAST64 not defined
+#endif
+
+#ifndef SCNiFAST8
+#error SCNiFAST8 not defined
+#endif
+
+#ifndef SCNiFAST16
+#error SCNiFAST16 not defined
+#endif
+
+#ifndef SCNiFAST32
+#error SCNiFAST32 not defined
+#endif
+
+#ifndef SCNiFAST64
+#error SCNiFAST64 not defined
+#endif
+
+#ifndef SCNiMAX
+#error SCNiMAX not defined
+#endif
+
+#ifndef SCNiPTR
+#error SCNiPTR not defined
+#endif
+
+#ifndef SCNo8
+#error SCNo8 not defined
+#endif
+
+#ifndef SCNo16
+#error SCNo16 not defined
+#endif
+
+#ifndef SCNo32
+#error SCNo32 not defined
+#endif
+
+#ifndef SCNo64
+#error SCNo64 not defined
+#endif
+
+#ifndef SCNoLEAST8
+#error SCNoLEAST8 not defined
+#endif
+
+#ifndef SCNoLEAST16
+#error SCNoLEAST16 not defined
+#endif
+
+#ifndef SCNoLEAST32
+#error SCNoLEAST32 not defined
+#endif
+
+#ifndef SCNoLEAST64
+#error SCNoLEAST64 not defined
+#endif
+
+#ifndef SCNoFAST8
+#error SCNoFAST8 not defined
+#endif
+
+#ifndef SCNoFAST16
+#error SCNoFAST16 not defined
+#endif
+
+#ifndef SCNoFAST32
+#error SCNoFAST32 not defined
+#endif
+
+#ifndef SCNoFAST64
+#error SCNoFAST64 not defined
+#endif
+
+#ifndef SCNoMAX
+#error SCNoMAX not defined
+#endif
+
+#ifndef SCNoPTR
+#error SCNoPTR not defined
+#endif
+
+#ifndef SCNu8
+#error SCNu8 not defined
+#endif
+
+#ifndef SCNu16
+#error SCNu16 not defined
+#endif
+
+#ifndef SCNu32
+#error SCNu32 not defined
+#endif
+
+#ifndef SCNu64
+#error SCNu64 not defined
+#endif
+
+#ifndef SCNuLEAST8
+#error SCNuLEAST8 not defined
+#endif
+
+#ifndef SCNuLEAST16
+#error SCNuLEAST16 not defined
+#endif
+
+#ifndef SCNuLEAST32
+#error SCNuLEAST32 not defined
+#endif
+
+#ifndef SCNuLEAST64
+#error SCNuLEAST64 not defined
+#endif
+
+#ifndef SCNuFAST8
+#error SCNuFAST8 not defined
+#endif
+
+#ifndef SCNuFAST16
+#error SCNuFAST16 not defined
+#endif
+
+#ifndef SCNuFAST32
+#error SCNuFAST32 not defined
+#endif
+
+#ifndef SCNuFAST64
+#error SCNuFAST64 not defined
+#endif
+
+#ifndef SCNuMAX
+#error SCNuMAX not defined
+#endif
+
+#ifndef SCNuPTR
+#error SCNuPTR not defined
+#endif
+
+#ifndef SCNx8
+#error SCNx8 not defined
+#endif
+
+#ifndef SCNx16
+#error SCNx16 not defined
+#endif
+
+#ifndef SCNx32
+#error SCNx32 not defined
+#endif
+
+#ifndef SCNx64
+#error SCNx64 not defined
+#endif
+
+#ifndef SCNxLEAST8
+#error SCNxLEAST8 not defined
+#endif
+
+#ifndef SCNxLEAST16
+#error SCNxLEAST16 not defined
+#endif
+
+#ifndef SCNxLEAST32
+#error SCNxLEAST32 not defined
+#endif
+
+#ifndef SCNxLEAST64
+#error SCNxLEAST64 not defined
+#endif
+
+#ifndef SCNxFAST8
+#error SCNxFAST8 not defined
+#endif
+
+#ifndef SCNxFAST16
+#error SCNxFAST16 not defined
+#endif
+
+#ifndef SCNxFAST32
+#error SCNxFAST32 not defined
+#endif
+
+#ifndef SCNxFAST64
+#error SCNxFAST64 not defined
+#endif
+
+#ifndef SCNxMAX
+#error SCNxMAX not defined
+#endif
+
+#ifndef SCNxPTR
+#error SCNxPTR not defined
+#endif
+
+int main()
+{
+    {
+    imaxdiv_t  i1 = {0};
+    }
+    intmax_t i = 0;
+    static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), "");
+    static_assert((std::is_same<decltype(imaxdiv(i, i)), imaxdiv_t>::value), "");
+    static_assert((std::is_same<decltype(strtoimax("", (char**)0, 0)), intmax_t>::value), "");
+    static_assert((std::is_same<decltype(strtoumax("", (char**)0, 0)), uintmax_t>::value), "");
+    static_assert((std::is_same<decltype(wcstoimax(L"", (wchar_t**)0, 0)), intmax_t>::value), "");
+    static_assert((std::is_same<decltype(wcstoumax(L"", (wchar_t**)0, 0)), uintmax_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/iso646_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/iso646_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/iso646_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/iso646_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <iso646.h>
+
+#include <iso646.h>
+
+int main()
+{
+    // Nothing to test
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/limits_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/limits_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/limits_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/limits_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,92 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+ // test limits.h
+
+#include <limits.h>
+
+#ifndef CHAR_BIT
+#error CHAR_BIT not defined
+#endif
+
+#ifndef SCHAR_MIN
+#error SCHAR_MIN not defined
+#endif
+
+#ifndef SCHAR_MAX
+#error SCHAR_MAX not defined
+#endif
+
+#ifndef UCHAR_MAX
+#error UCHAR_MAX not defined
+#endif
+
+#ifndef CHAR_MIN
+#error CHAR_MIN not defined
+#endif
+
+#ifndef CHAR_MAX
+#error CHAR_MAX not defined
+#endif
+
+#ifndef MB_LEN_MAX
+#error MB_LEN_MAX not defined
+#endif
+
+#ifndef SHRT_MIN
+#error SHRT_MIN not defined
+#endif
+
+#ifndef SHRT_MAX
+#error SHRT_MAX not defined
+#endif
+
+#ifndef USHRT_MAX
+#error USHRT_MAX not defined
+#endif
+
+#ifndef INT_MIN
+#error INT_MIN not defined
+#endif
+
+#ifndef INT_MAX
+#error INT_MAX not defined
+#endif
+
+#ifndef UINT_MAX
+#error UINT_MAX not defined
+#endif
+
+#ifndef LONG_MIN
+#error LONG_MIN not defined
+#endif
+
+#ifndef LONG_MAX
+#error LONG_MAX not defined
+#endif
+
+#ifndef ULONG_MAX
+#error ULONG_MAX not defined
+#endif
+
+#ifndef LLONG_MIN
+#error LLONG_MIN not defined
+#endif
+
+#ifndef LLONG_MAX
+#error LLONG_MAX not defined
+#endif
+
+#ifndef ULLONG_MAX
+#error ULLONG_MAX not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/locale_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/locale_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/locale_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/locale_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale.h>
+
+#include <locale.h>
+#include <type_traits>
+
+#ifndef LC_ALL
+#error LC_ALL not defined
+#endif
+
+#ifndef LC_COLLATE
+#error LC_COLLATE not defined
+#endif
+
+#ifndef LC_CTYPE
+#error LC_CTYPE not defined
+#endif
+
+#ifndef LC_MONETARY
+#error LC_MONETARY not defined
+#endif
+
+#ifndef LC_NUMERIC
+#error LC_NUMERIC not defined
+#endif
+
+#ifndef LC_TIME
+#error LC_TIME not defined
+#endif
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+int main()
+{
+    lconv lc;
+    static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
+    static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,683 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <math.h>
+
+// XFAIL: linux
+
+#include <math.h>
+#include <type_traits>
+#include <cassert>
+
+#include "hexfloat.h"
+
+void test_acos()
+{
+    static_assert((std::is_same<decltype(acos((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(acosf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(acosl(0)), long double>::value), "");
+    assert(acos(1) == 0);
+}
+
+void test_asin()
+{
+    static_assert((std::is_same<decltype(asin((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(asinf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(asinl(0)), long double>::value), "");
+    assert(asin(0) == 0);
+}
+
+void test_atan()
+{
+    static_assert((std::is_same<decltype(atan((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(atanf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(atanl(0)), long double>::value), "");
+    assert(atan(0) == 0);
+}
+
+void test_atan2()
+{
+    static_assert((std::is_same<decltype(atan2((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(atan2f(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(atan2l(0,0)), long double>::value), "");
+    assert(atan2(0,1) == 0);
+}
+
+void test_ceil()
+{
+    static_assert((std::is_same<decltype(ceil((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(ceilf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(ceill(0)), long double>::value), "");
+    assert(ceil(0) == 0);
+}
+
+void test_cos()
+{
+    static_assert((std::is_same<decltype(cos((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(cosf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(cosl(0)), long double>::value), "");
+    assert(cos(0) == 1);
+}
+
+void test_cosh()
+{
+    static_assert((std::is_same<decltype(cosh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(coshf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(coshl(0)), long double>::value), "");
+    assert(cosh(0) == 1);
+}
+
+void test_exp()
+{
+    static_assert((std::is_same<decltype(exp((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(expf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(expl(0)), long double>::value), "");
+    assert(exp(0) == 1);
+}
+
+void test_fabs()
+{
+    static_assert((std::is_same<decltype(fabs((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fabsf(0.f)), float>::value), "");
+    static_assert((std::is_same<decltype(fabsl(0.L)), long double>::value), "");
+    assert(fabs(-1.f) == 1);
+}
+
+void test_floor()
+{
+    static_assert((std::is_same<decltype(floor((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(floorf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(floorl(0)), long double>::value), "");
+    assert(floor(1) == 1);
+}
+
+void test_fmod()
+{
+    static_assert((std::is_same<decltype(fmod((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fmodf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(fmodl(0,0)), long double>::value), "");
+    assert(fmod(1.5,1) == .5);
+}
+
+void test_frexp()
+{
+    int ip;
+    static_assert((std::is_same<decltype(frexp((double)0, &ip)), double>::value), "");
+    static_assert((std::is_same<decltype(frexpf(0, &ip)), float>::value), "");
+    static_assert((std::is_same<decltype(frexpl(0, &ip)), long double>::value), "");
+    assert(frexp(0, &ip) == 0);
+}
+
+void test_ldexp()
+{
+    int ip = 1;
+    static_assert((std::is_same<decltype(ldexp((double)0, ip)), double>::value), "");
+    static_assert((std::is_same<decltype(ldexpf(0, ip)), float>::value), "");
+    static_assert((std::is_same<decltype(ldexpl(0, ip)), long double>::value), "");
+    assert(ldexp(1, ip) == 2);
+}
+
+void test_log()
+{
+    static_assert((std::is_same<decltype(log((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(logf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(logl(0)), long double>::value), "");
+    assert(log(1) == 0);
+}
+
+void test_log10()
+{
+    static_assert((std::is_same<decltype(log10((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(log10f(0)), float>::value), "");
+    static_assert((std::is_same<decltype(log10l(0)), long double>::value), "");
+    assert(log10(1) == 0);
+}
+
+void test_modf()
+{
+    static_assert((std::is_same<decltype(modf((double)0, (double*)0)), double>::value), "");
+    static_assert((std::is_same<decltype(modff(0, (float*)0)), float>::value), "");
+    static_assert((std::is_same<decltype(modfl(0, (long double*)0)), long double>::value), "");
+    double i;
+    assert(modf(1., &i) == 0);
+}
+
+void test_pow()
+{
+    static_assert((std::is_same<decltype(pow((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(powf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(powl(0,0)), long double>::value), "");
+    assert(pow(1,1) == 1);
+}
+
+void test_sin()
+{
+    static_assert((std::is_same<decltype(sin((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(sinf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(sinl(0)), long double>::value), "");
+    assert(sin(0) == 0);
+}
+
+void test_sinh()
+{
+    static_assert((std::is_same<decltype(sinh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(sinhf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(sinhl(0)), long double>::value), "");
+    assert(sinh(0) == 0);
+}
+
+void test_sqrt()
+{
+    static_assert((std::is_same<decltype(sqrt((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(sqrtf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(sqrtl(0)), long double>::value), "");
+    assert(sqrt(4) == 2);
+}
+
+void test_tan()
+{
+    static_assert((std::is_same<decltype(tan((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(tanf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(tanl(0)), long double>::value), "");
+    assert(tan(0) == 0);
+}
+
+void test_tanh()
+{
+    static_assert((std::is_same<decltype(tanh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(tanhf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(tanhl(0)), long double>::value), "");
+    assert(tanh(0) == 0);
+}
+
+void test_signbit()
+{
+    static_assert((std::is_same<decltype(signbit((float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(signbit((double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(signbit((long double)0)), bool>::value), "");
+    assert(signbit(-1.0) == true);
+}
+
+void test_fpclassify()
+{
+    static_assert((std::is_same<decltype(fpclassify((float)0)), int>::value), "");
+    static_assert((std::is_same<decltype(fpclassify((double)0)), int>::value), "");
+    static_assert((std::is_same<decltype(fpclassify((long double)0)), int>::value), "");
+    assert(fpclassify(-1.0) == FP_NORMAL);
+}
+
+void test_isfinite()
+{
+    static_assert((std::is_same<decltype(isfinite((float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isfinite((double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isfinite((long double)0)), bool>::value), "");
+    assert(isfinite(-1.0) == true);
+}
+
+void test_isinf()
+{
+    static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
+    assert(isinf(-1.0) == false);
+}
+
+void test_isnan()
+{
+    static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
+    assert(isnan(-1.0) == false);
+}
+
+void test_isnormal()
+{
+    static_assert((std::is_same<decltype(isnormal((float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isnormal((double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isnormal((long double)0)), bool>::value), "");
+    assert(isnormal(-1.0) == true);
+}
+
+void test_isgreater()
+{
+    static_assert((std::is_same<decltype(isgreater((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreater((long double)0, (long double)0)), bool>::value), "");
+    assert(isgreater(-1.0, 0.F) == false);
+}
+
+void test_isgreaterequal()
+{
+    static_assert((std::is_same<decltype(isgreaterequal((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isgreaterequal((long double)0, (long double)0)), bool>::value), "");
+    assert(isgreaterequal(-1.0, 0.F) == false);
+}
+
+void test_isless()
+{
+    static_assert((std::is_same<decltype(isless((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isless((long double)0, (long double)0)), bool>::value), "");
+    assert(isless(-1.0, 0.F) == true);
+}
+
+void test_islessequal()
+{
+    static_assert((std::is_same<decltype(islessequal((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessequal((long double)0, (long double)0)), bool>::value), "");
+    assert(islessequal(-1.0, 0.F) == true);
+}
+
+void test_islessgreater()
+{
+    static_assert((std::is_same<decltype(islessgreater((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(islessgreater((long double)0, (long double)0)), bool>::value), "");
+    assert(islessgreater(-1.0, 0.F) == true);
+}
+
+void test_isunordered()
+{
+    static_assert((std::is_same<decltype(isunordered((float)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((float)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((float)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((double)0, (long double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((long double)0, (float)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((long double)0, (double)0)), bool>::value), "");
+    static_assert((std::is_same<decltype(isunordered((long double)0, (long double)0)), bool>::value), "");
+    assert(isunordered(-1.0, 0.F) == false);
+}
+
+void test_acosh()
+{
+    static_assert((std::is_same<decltype(acosh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(acoshf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(acoshl(0)), long double>::value), "");
+    assert(acosh(1) == 0);
+}
+
+void test_asinh()
+{
+    static_assert((std::is_same<decltype(asinh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(asinhf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(asinhl(0)), long double>::value), "");
+    assert(asinh(0) == 0);
+}
+
+void test_atanh()
+{
+    static_assert((std::is_same<decltype(atanh((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(atanhf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(atanhl(0)), long double>::value), "");
+    assert(atanh(0) == 0);
+}
+
+void test_cbrt()
+{
+    static_assert((std::is_same<decltype(cbrt((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(cbrtf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(cbrtl(0)), long double>::value), "");
+    assert(cbrt(1) == 1);
+}
+
+void test_copysign()
+{
+    static_assert((std::is_same<decltype(copysign((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(copysignf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(copysignl(0,0)), long double>::value), "");
+    assert(copysign(1,1) == 1);
+}
+
+void test_erf()
+{
+    static_assert((std::is_same<decltype(erf((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(erff(0)), float>::value), "");
+    static_assert((std::is_same<decltype(erfl(0)), long double>::value), "");
+    assert(erf(0) == 0);
+}
+
+void test_erfc()
+{
+    static_assert((std::is_same<decltype(erfc((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(erfcf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(erfcl(0)), long double>::value), "");
+    assert(erfc(0) == 1);
+}
+
+void test_exp2()
+{
+    static_assert((std::is_same<decltype(exp2((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(exp2f(0)), float>::value), "");
+    static_assert((std::is_same<decltype(exp2l(0)), long double>::value), "");
+    assert(exp2(1) == 2);
+}
+
+void test_expm1()
+{
+    static_assert((std::is_same<decltype(expm1((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(expm1f(0)), float>::value), "");
+    static_assert((std::is_same<decltype(expm1l(0)), long double>::value), "");
+    assert(expm1(0) == 0);
+}
+
+void test_fdim()
+{
+    static_assert((std::is_same<decltype(fdim((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fdimf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(fdiml(0,0)), long double>::value), "");
+    assert(fdim(1,0) == 1);
+}
+
+void test_fma()
+{
+    static_assert((std::is_same<decltype(fma((double)0, (double)0,  (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fmaf(0,0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(fmal(0,0,0)), long double>::value), "");
+    assert(fma(1,1,1) == 2);
+}
+
+void test_fmax()
+{
+    static_assert((std::is_same<decltype(fmax((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fmaxf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(fmaxl(0,0)), long double>::value), "");
+    assert(fmax(1,0) == 1);
+}
+
+void test_fmin()
+{
+    static_assert((std::is_same<decltype(fmin((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(fminf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(fminl(0,0)), long double>::value), "");
+    assert(fmin(1,0) == 0);
+}
+
+void test_hypot()
+{
+    static_assert((std::is_same<decltype(hypot((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(hypotf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(hypotl(0,0)), long double>::value), "");
+    assert(hypot(3,4) == 5);
+}
+
+void test_ilogb()
+{
+    static_assert((std::is_same<decltype(ilogb((double)0)), int>::value), "");
+    static_assert((std::is_same<decltype(ilogbf(0)), int>::value), "");
+    static_assert((std::is_same<decltype(ilogbl(0)), int>::value), "");
+    assert(ilogb(1) == 0);
+}
+
+void test_lgamma()
+{
+    static_assert((std::is_same<decltype(lgamma((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(lgammaf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(lgammal(0)), long double>::value), "");
+    assert(lgamma(1) == 0);
+}
+
+void test_llrint()
+{
+    static_assert((std::is_same<decltype(llrint((double)0)), long long>::value), "");
+    static_assert((std::is_same<decltype(llrintf(0)), long long>::value), "");
+    static_assert((std::is_same<decltype(llrintl(0)), long long>::value), "");
+    assert(llrint(1) == 1LL);
+}
+
+void test_llround()
+{
+    static_assert((std::is_same<decltype(llround((double)0)), long long>::value), "");
+    static_assert((std::is_same<decltype(llroundf(0)), long long>::value), "");
+    static_assert((std::is_same<decltype(llroundl(0)), long long>::value), "");
+    assert(llround(1) == 1LL);
+}
+
+void test_log1p()
+{
+    static_assert((std::is_same<decltype(log1p((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(log1pf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(log1pl(0)), long double>::value), "");
+    assert(log1p(0) == 0);
+}
+
+void test_log2()
+{
+    static_assert((std::is_same<decltype(log2((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(log2f(0)), float>::value), "");
+    static_assert((std::is_same<decltype(log2l(0)), long double>::value), "");
+    assert(log2(1) == 0);
+}
+
+void test_logb()
+{
+    static_assert((std::is_same<decltype(logb((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(logbf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(logbl(0)), long double>::value), "");
+    assert(logb(1) == 0);
+}
+
+void test_lrint()
+{
+    static_assert((std::is_same<decltype(lrint((double)0)), long>::value), "");
+    static_assert((std::is_same<decltype(lrintf(0)), long>::value), "");
+    static_assert((std::is_same<decltype(lrintl(0)), long>::value), "");
+    assert(lrint(1) == 1L);
+}
+
+void test_lround()
+{
+    static_assert((std::is_same<decltype(lround((double)0)), long>::value), "");
+    static_assert((std::is_same<decltype(lroundf(0)), long>::value), "");
+    static_assert((std::is_same<decltype(lroundl(0)), long>::value), "");
+    assert(lround(1) == 1L);
+}
+
+void test_nan()
+{
+    static_assert((std::is_same<decltype(nan("")), double>::value), "");
+    static_assert((std::is_same<decltype(nanf("")), float>::value), "");
+    static_assert((std::is_same<decltype(nanl("")), long double>::value), "");
+}
+
+void test_nearbyint()
+{
+    static_assert((std::is_same<decltype(nearbyint((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(nearbyintf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(nearbyintl(0)), long double>::value), "");
+    assert(nearbyint(1) == 1);
+}
+
+void test_nextafter()
+{
+    static_assert((std::is_same<decltype(nextafter((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(nextafterf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(nextafterl(0,0)), long double>::value), "");
+    assert(nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
+}
+
+void test_nexttoward()
+{
+    static_assert((std::is_same<decltype(nexttoward((double)0, (long double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(nexttowardf(0, (long double)0)), float>::value), "");
+    static_assert((std::is_same<decltype(nexttowardl(0, (long double)0)), long double>::value), "");
+    assert(nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
+}
+
+void test_remainder()
+{
+    static_assert((std::is_same<decltype(remainder((double)0, (double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(remainderf(0,0)), float>::value), "");
+    static_assert((std::is_same<decltype(remainderl(0,0)), long double>::value), "");
+    static_assert((std::is_same<decltype(remainder((int)0, (int)0)), double>::value), "");
+    assert(remainder(0.5,1) == 0.5);
+}
+
+void test_remquo()
+{
+    int ip;
+    static_assert((std::is_same<decltype(remquo((double)0, (double)0, &ip)), double>::value), "");
+    static_assert((std::is_same<decltype(remquof(0,0, &ip)), float>::value), "");
+    static_assert((std::is_same<decltype(remquol(0,0, &ip)), long double>::value), "");
+    assert(remquo(0.5,1, &ip) == 0.5);
+}
+
+void test_rint()
+{
+    static_assert((std::is_same<decltype(rint((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(rintf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(rintl(0)), long double>::value), "");
+    assert(rint(1) == 1);
+}
+
+void test_round()
+{
+    static_assert((std::is_same<decltype(round((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(roundf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(roundl(0)), long double>::value), "");
+    assert(round(1) == 1);
+}
+
+void test_scalbln()
+{
+    static_assert((std::is_same<decltype(scalbln((double)0, (long)0)), double>::value), "");
+    static_assert((std::is_same<decltype(scalblnf(0, (long)0)), float>::value), "");
+    static_assert((std::is_same<decltype(scalblnl(0, (long)0)), long double>::value), "");
+    assert(scalbln(1, 1) == 2);
+}
+
+void test_scalbn()
+{
+    static_assert((std::is_same<decltype(scalbn((double)0, (int)0)), double>::value), "");
+    static_assert((std::is_same<decltype(scalbnf(0, (int)0)), float>::value), "");
+    static_assert((std::is_same<decltype(scalbnl(0, (int)0)), long double>::value), "");
+    assert(scalbn(1, 1) == 2);
+}
+
+void test_tgamma()
+{
+    static_assert((std::is_same<decltype(tgamma((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(tgammaf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(tgammal(0)), long double>::value), "");
+    assert(tgamma(1) == 1);
+}
+
+void test_trunc()
+{
+    static_assert((std::is_same<decltype(trunc((double)0)), double>::value), "");
+    static_assert((std::is_same<decltype(truncf(0)), float>::value), "");
+    static_assert((std::is_same<decltype(truncl(0)), long double>::value), "");
+    assert(trunc(1) == 1);
+}
+
+int main()
+{
+    test_acos();
+    test_asin();
+    test_atan();
+    test_atan2();
+    test_ceil();
+    test_cos();
+    test_cosh();
+    test_exp();
+    test_fabs();
+    test_floor();
+    test_fmod();
+    test_frexp();
+    test_ldexp();
+    test_log();
+    test_log10();
+    test_modf();
+    test_pow();
+    test_sin();
+    test_sinh();
+    test_sqrt();
+    test_tan();
+    test_tanh();
+    test_signbit();
+    test_fpclassify();
+    test_isfinite();
+    test_isinf();
+    test_isnan();
+    test_isnormal();
+    test_isgreater();
+    test_isgreaterequal();
+    test_isless();
+    test_islessequal();
+    test_islessgreater();
+    test_isunordered();
+    test_acosh();
+    test_asinh();
+    test_atanh();
+    test_cbrt();
+    test_copysign();
+    test_erf();
+    test_erfc();
+    test_exp2();
+    test_expm1();
+    test_fdim();
+    test_fma();
+    test_fmax();
+    test_fmin();
+    test_hypot();
+    test_ilogb();
+    test_lgamma();
+    test_llrint();
+    test_llround();
+    test_log1p();
+    test_log2();
+    test_logb();
+    test_lrint();
+    test_lround();
+    test_nan();
+    test_nearbyint();
+    test_nextafter();
+    test_nexttoward();
+    test_remainder();
+    test_remquo();
+    test_rint();
+    test_round();
+    test_scalbln();
+    test_scalbn();
+    test_tgamma();
+    test_trunc();
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/setjmp_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/setjmp_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/setjmp_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <setjmp.h>
+
+#include <setjmp.h>
+#include <type_traits>
+
+int main()
+{
+    jmp_buf jb;
+    static_assert((std::is_same<decltype(longjmp(jb, 0)), void>::value),
+                  "std::is_same<decltype(longjmp(jb, 0)), void>::value");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/signal_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/signal_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/signal_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/signal_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <signal.h>
+
+#include <signal.h>
+#include <type_traits>
+
+#ifndef SIG_DFL
+#error SIG_DFL not defined
+#endif
+
+#ifndef SIG_ERR
+#error SIG_ERR not defined
+#endif
+
+#ifndef SIG_IGN
+#error SIG_IGN not defined
+#endif
+
+#ifndef SIGABRT
+#error SIGABRT not defined
+#endif
+
+#ifndef SIGFPE
+#error SIGFPE not defined
+#endif
+
+#ifndef SIGILL
+#error SIGILL not defined
+#endif
+
+#ifndef SIGINT
+#error SIGINT not defined
+#endif
+
+#ifndef SIGSEGV
+#error SIGSEGV not defined
+#endif
+
+#ifndef SIGTERM
+#error SIGTERM not defined
+#endif
+
+int main()
+{
+    sig_atomic_t sig;
+    typedef void (*func)(int);
+    static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
+    static_assert((std::is_same<decltype(raise(0)), int>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdarg_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stdarg_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdarg_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdarg.h>
+
+#include <stdarg.h>
+
+#ifndef va_arg
+#error va_arg not defined
+#endif
+
+#if __cplusplus >= 201103L
+#  ifndef va_copy
+#    error va_copy is not defined when c++ >= 11
+#  endif
+#endif
+
+#ifndef va_end
+#error va_end not defined
+#endif
+
+#ifndef va_start
+#error va_start not defined
+#endif
+
+int main()
+{
+    va_list va;
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stdbool_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdbool_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stdbool_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdbool_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdbool.h>
+
+#include <stdbool.h>
+
+#ifndef __bool_true_false_are_defined
+#error __bool_true_false_are_defined not defined
+#endif
+
+#ifdef bool
+#error bool should not be defined
+#endif
+
+#ifdef true
+#error true should not be defined
+#endif
+
+#ifdef false
+#error false should not be defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stddef_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stddef_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stddef_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stddef_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <stddef.h>
+
+#include <stddef.h>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef offsetof
+#error offsetof not defined
+#endif
+
+int main()
+{
+    static_assert(sizeof(size_t) == sizeof(void*),
+                  "sizeof(size_t) == sizeof(void*)");
+    static_assert(std::is_unsigned<size_t>::value,
+                  "std::is_unsigned<size_t>::value");
+    static_assert(std::is_integral<size_t>::value,
+                  "std::is_integral<size_t>::value");
+    static_assert(sizeof(ptrdiff_t) == sizeof(void*),
+                  "sizeof(ptrdiff_t) == sizeof(void*)");
+    static_assert(std::is_signed<ptrdiff_t>::value,
+                  "std::is_signed<ptrdiff_t>::value");
+    static_assert(std::is_integral<ptrdiff_t>::value,
+                  "std::is_integral<ptrdiff_t>::value");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdint_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,290 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdint.h>
+
+#include <stdint.h>
+#include <csignal>
+#include <cwctype>
+#include <climits>
+#include <type_traits>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+    // typedef int8_t
+    static_assert(sizeof(int8_t)*CHAR_BIT == 8,
+                 "sizeof(int8_t)*CHAR_BIT == 8");
+    static_assert(std::is_signed<int8_t>::value,
+                 "std::is_signed<int8_t>::value");
+    // typedef int16_t
+    static_assert(sizeof(int16_t)*CHAR_BIT == 16,
+                 "sizeof(int16_t)*CHAR_BIT == 16");
+    static_assert(std::is_signed<int16_t>::value,
+                 "std::is_signed<int16_t>::value");
+    // typedef int32_t
+    static_assert(sizeof(int32_t)*CHAR_BIT == 32,
+                 "sizeof(int32_t)*CHAR_BIT == 32");
+    static_assert(std::is_signed<int32_t>::value,
+                 "std::is_signed<int32_t>::value");
+    // typedef int64_t
+    static_assert(sizeof(int64_t)*CHAR_BIT == 64,
+                 "sizeof(int64_t)*CHAR_BIT == 64");
+    static_assert(std::is_signed<int64_t>::value,
+                 "std::is_signed<int64_t>::value");
+
+    // typedef uint8_t
+    static_assert(sizeof(uint8_t)*CHAR_BIT == 8,
+                 "sizeof(uint8_t)*CHAR_BIT == 8");
+    static_assert(std::is_unsigned<uint8_t>::value,
+                 "std::is_unsigned<uint8_t>::value");
+    // typedef uint16_t
+    static_assert(sizeof(uint16_t)*CHAR_BIT == 16,
+                 "sizeof(uint16_t)*CHAR_BIT == 16");
+    static_assert(std::is_unsigned<uint16_t>::value,
+                 "std::is_unsigned<uint16_t>::value");
+    // typedef uint32_t
+    static_assert(sizeof(uint32_t)*CHAR_BIT == 32,
+                 "sizeof(uint32_t)*CHAR_BIT == 32");
+    static_assert(std::is_unsigned<uint32_t>::value,
+                 "std::is_unsigned<uint32_t>::value");
+    // typedef uint64_t
+    static_assert(sizeof(uint64_t)*CHAR_BIT == 64,
+                 "sizeof(uint64_t)*CHAR_BIT == 64");
+    static_assert(std::is_unsigned<uint64_t>::value,
+                 "std::is_unsigned<uint64_t>::value");
+
+    // typedef int_least8_t
+    static_assert(sizeof(int_least8_t)*CHAR_BIT >= 8,
+                 "sizeof(int_least8_t)*CHAR_BIT >= 8");
+    static_assert(std::is_signed<int_least8_t>::value,
+                 "std::is_signed<int_least8_t>::value");
+    // typedef int_least16_t
+    static_assert(sizeof(int_least16_t)*CHAR_BIT >= 16,
+                 "sizeof(int_least16_t)*CHAR_BIT >= 16");
+    static_assert(std::is_signed<int_least16_t>::value,
+                 "std::is_signed<int_least16_t>::value");
+    // typedef int_least32_t
+    static_assert(sizeof(int_least32_t)*CHAR_BIT >= 32,
+                 "sizeof(int_least32_t)*CHAR_BIT >= 32");
+    static_assert(std::is_signed<int_least32_t>::value,
+                 "std::is_signed<int_least32_t>::value");
+    // typedef int_least64_t
+    static_assert(sizeof(int_least64_t)*CHAR_BIT >= 64,
+                 "sizeof(int_least64_t)*CHAR_BIT >= 64");
+    static_assert(std::is_signed<int_least64_t>::value,
+                 "std::is_signed<int_least64_t>::value");
+
+    // typedef uint_least8_t
+    static_assert(sizeof(uint_least8_t)*CHAR_BIT >= 8,
+                 "sizeof(uint_least8_t)*CHAR_BIT >= 8");
+    static_assert(std::is_unsigned<uint_least8_t>::value,
+                 "std::is_unsigned<uint_least8_t>::value");
+    // typedef uint_least16_t
+    static_assert(sizeof(uint_least16_t)*CHAR_BIT >= 16,
+                 "sizeof(uint_least16_t)*CHAR_BIT >= 16");
+    static_assert(std::is_unsigned<uint_least16_t>::value,
+                 "std::is_unsigned<uint_least16_t>::value");
+    // typedef uint_least32_t
+    static_assert(sizeof(uint_least32_t)*CHAR_BIT >= 32,
+                 "sizeof(uint_least32_t)*CHAR_BIT >= 32");
+    static_assert(std::is_unsigned<uint_least32_t>::value,
+                 "std::is_unsigned<uint_least32_t>::value");
+    // typedef uint_least64_t
+    static_assert(sizeof(uint_least64_t)*CHAR_BIT >= 64,
+                 "sizeof(uint_least64_t)*CHAR_BIT >= 64");
+    static_assert(std::is_unsigned<uint_least64_t>::value,
+                 "std::is_unsigned<uint_least64_t>::value");
+
+    // typedef int_fast8_t
+    static_assert(sizeof(int_fast8_t)*CHAR_BIT >= 8,
+                 "sizeof(int_fast8_t)*CHAR_BIT >= 8");
+    static_assert(std::is_signed<int_fast8_t>::value,
+                 "std::is_signed<int_fast8_t>::value");
+    // typedef int_fast16_t
+    static_assert(sizeof(int_fast16_t)*CHAR_BIT >= 16,
+                 "sizeof(int_fast16_t)*CHAR_BIT >= 16");
+    static_assert(std::is_signed<int_fast16_t>::value,
+                 "std::is_signed<int_fast16_t>::value");
+    // typedef int_fast32_t
+    static_assert(sizeof(int_fast32_t)*CHAR_BIT >= 32,
+                 "sizeof(int_fast32_t)*CHAR_BIT >= 32");
+    static_assert(std::is_signed<int_fast32_t>::value,
+                 "std::is_signed<int_fast32_t>::value");
+    // typedef int_fast64_t
+    static_assert(sizeof(int_fast64_t)*CHAR_BIT >= 64,
+                 "sizeof(int_fast64_t)*CHAR_BIT >= 64");
+    static_assert(std::is_signed<int_fast64_t>::value,
+                 "std::is_signed<int_fast64_t>::value");
+
+    // typedef uint_fast8_t
+    static_assert(sizeof(uint_fast8_t)*CHAR_BIT >= 8,
+                 "sizeof(uint_fast8_t)*CHAR_BIT >= 8");
+    static_assert(std::is_unsigned<uint_fast8_t>::value,
+                 "std::is_unsigned<uint_fast8_t>::value");
+    // typedef uint_fast16_t
+    static_assert(sizeof(uint_fast16_t)*CHAR_BIT >= 16,
+                 "sizeof(uint_fast16_t)*CHAR_BIT >= 16");
+    static_assert(std::is_unsigned<uint_fast16_t>::value,
+                 "std::is_unsigned<uint_fast16_t>::value");
+    // typedef uint_fast32_t
+    static_assert(sizeof(uint_fast32_t)*CHAR_BIT >= 32,
+                 "sizeof(uint_fast32_t)*CHAR_BIT >= 32");
+    static_assert(std::is_unsigned<uint_fast32_t>::value,
+                 "std::is_unsigned<uint_fast32_t>::value");
+    // typedef uint_fast64_t
+    static_assert(sizeof(uint_fast64_t)*CHAR_BIT >= 64,
+                 "sizeof(uint_fast64_t)*CHAR_BIT >= 64");
+    static_assert(std::is_unsigned<uint_fast64_t>::value,
+                 "std::is_unsigned<uint_fast64_t>::value");
+
+    // typedef intptr_t
+    static_assert(sizeof(intptr_t) >= sizeof(void*),
+                 "sizeof(intptr_t) >= sizeof(void*)");
+    static_assert(std::is_signed<intptr_t>::value,
+                 "std::is_signed<intptr_t>::value");
+    // typedef uintptr_t
+    static_assert(sizeof(uintptr_t) >= sizeof(void*),
+                 "sizeof(uintptr_t) >= sizeof(void*)");
+    static_assert(std::is_unsigned<uintptr_t>::value,
+                 "std::is_unsigned<uintptr_t>::value");
+
+    // typedef intmax_t
+    static_assert(sizeof(intmax_t) >= sizeof(long long),
+                 "sizeof(intmax_t) >= sizeof(long long)");
+    static_assert(std::is_signed<intmax_t>::value,
+                 "std::is_signed<intmax_t>::value");
+    // typedef uintmax_t
+    static_assert(sizeof(uintmax_t) >= sizeof(unsigned long long),
+                 "sizeof(uintmax_t) >= sizeof(unsigned long long)");
+    static_assert(std::is_unsigned<uintmax_t>::value,
+                 "std::is_unsigned<uintmax_t>::value");
+
+    // INTN_MIN
+    static_assert(INT8_MIN == -128, "INT8_MIN == -128");
+    static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
+    static_assert(INT32_MIN == -2147483648U, "INT32_MIN == -2147483648");
+    static_assert(INT64_MIN == -9223372036854775808ULL, "INT64_MIN == -9223372036854775808LL");
+
+    // INTN_MAX
+    static_assert(INT8_MAX == 127, "INT8_MAX == 127");
+    static_assert(INT16_MAX == 32767, "INT16_MAX == 32767");
+    static_assert(INT32_MAX == 2147483647, "INT32_MAX == 2147483647");
+    static_assert(INT64_MAX == 9223372036854775807LL, "INT64_MAX == 9223372036854775807LL");
+
+    // UINTN_MAX
+    static_assert(UINT8_MAX == 255, "UINT8_MAX == 255");
+    static_assert(UINT16_MAX == 65535, "UINT16_MAX == 65535");
+    static_assert(UINT32_MAX == 4294967295U, "UINT32_MAX == 4294967295");
+    static_assert(UINT64_MAX == 18446744073709551615ULL, "UINT64_MAX == 18446744073709551615ULL");
+
+    // INT_FASTN_MIN
+    static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
+    static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
+    static_assert(INT_FAST32_MIN <= -2147483648U, "INT_FAST32_MIN <= -2147483648");
+    static_assert(INT_FAST64_MIN <= -9223372036854775808ULL, "INT_FAST64_MIN <= -9223372036854775808LL");
+
+    // INT_FASTN_MAX
+    static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
+    static_assert(INT_FAST16_MAX >= 32767, "INT_FAST16_MAX >= 32767");
+    static_assert(INT_FAST32_MAX >= 2147483647, "INT_FAST32_MAX >= 2147483647");
+    static_assert(INT_FAST64_MAX >= 9223372036854775807LL, "INT_FAST64_MAX >= 9223372036854775807LL");
+
+    // UINT_FASTN_MAX
+    static_assert(UINT_FAST8_MAX >= 255, "UINT_FAST8_MAX >= 255");
+    static_assert(UINT_FAST16_MAX >= 65535, "UINT_FAST16_MAX >= 65535");
+    static_assert(UINT_FAST32_MAX >= 4294967295U, "UINT_FAST32_MAX >= 4294967295");
+    static_assert(UINT_FAST64_MAX >= 18446744073709551615ULL, "UINT_FAST64_MAX >= 18446744073709551615ULL");
+
+    // INTPTR_MIN
+    assert(INTPTR_MIN == std::numeric_limits<intptr_t>::min());
+
+    // INTPTR_MAX
+    assert(INTPTR_MAX == std::numeric_limits<intptr_t>::max());
+
+    // UINTPTR_MAX
+    assert(UINTPTR_MAX == std::numeric_limits<uintptr_t>::max());
+
+    // INTMAX_MIN
+    assert(INTMAX_MIN == std::numeric_limits<intmax_t>::min());
+
+    // INTMAX_MAX
+    assert(INTMAX_MAX == std::numeric_limits<intmax_t>::max());
+
+    // UINTMAX_MAX
+    assert(UINTMAX_MAX == std::numeric_limits<uintmax_t>::max());
+
+    // PTRDIFF_MIN
+    assert(PTRDIFF_MIN == std::numeric_limits<ptrdiff_t>::min());
+
+    // PTRDIFF_MAX
+    assert(PTRDIFF_MAX == std::numeric_limits<ptrdiff_t>::max());
+
+    // SIG_ATOMIC_MIN
+    assert(SIG_ATOMIC_MIN == std::numeric_limits<sig_atomic_t>::min());
+
+    // SIG_ATOMIC_MAX
+    assert(SIG_ATOMIC_MAX == std::numeric_limits<sig_atomic_t>::max());
+
+    // SIZE_MAX
+    assert(SIZE_MAX == std::numeric_limits<size_t>::max());
+
+    // WCHAR_MIN
+    assert(WCHAR_MIN == std::numeric_limits<wchar_t>::min());
+
+    // WCHAR_MAX
+    assert(WCHAR_MAX == std::numeric_limits<wchar_t>::max());
+
+    // WINT_MIN
+    assert(WINT_MIN == std::numeric_limits<wint_t>::min());
+
+    // WINT_MAX
+    assert(WINT_MAX == std::numeric_limits<wint_t>::max());
+
+#ifndef INT8_C
+#error INT8_C not defined
+#endif
+
+#ifndef INT16_C
+#error INT16_C not defined
+#endif
+
+#ifndef INT32_C
+#error INT32_C not defined
+#endif
+
+#ifndef INT64_C
+#error INT64_C not defined
+#endif
+
+#ifndef UINT8_C
+#error UINT8_C not defined
+#endif
+
+#ifndef UINT16_C
+#error UINT16_C not defined
+#endif
+
+#ifndef UINT32_C
+#error UINT32_C not defined
+#endif
+
+#ifndef UINT64_C
+#error UINT64_C not defined
+#endif
+
+#ifndef INTMAX_C
+#error INTMAX_C not defined
+#endif
+
+#ifndef UINTMAX_C
+#error UINTMAX_C not defined
+#endif
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stdio_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdio_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stdio_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdio_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdio.h>
+
+#include <stdio.h>
+#include <type_traits>
+
+#ifndef BUFSIZ
+#error BUFSIZ not defined
+#endif
+
+#ifndef EOF
+#error EOF not defined
+#endif
+
+#ifndef FILENAME_MAX
+#error FILENAME_MAX not defined
+#endif
+
+#ifndef FOPEN_MAX
+#error FOPEN_MAX not defined
+#endif
+
+#ifndef L_tmpnam
+#error L_tmpnam not defined
+#endif
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef SEEK_CUR
+#error SEEK_CUR not defined
+#endif
+
+#ifndef SEEK_END
+#error SEEK_END not defined
+#endif
+
+#ifndef SEEK_SET
+#error SEEK_SET not defined
+#endif
+
+#ifndef TMP_MAX
+#error TMP_MAX not defined
+#endif
+
+#ifndef _IOFBF
+#error _IOFBF not defined
+#endif
+
+#ifndef _IOLBF
+#error _IOLBF not defined
+#endif
+
+#ifndef _IONBF
+#error _IONBF not defined
+#endif
+
+#ifndef stderr
+#error stderr not defined
+#endif
+
+#ifndef stdin
+#error stdin not defined
+#endif
+
+#ifndef stdout
+#error stdout not defined
+#endif
+
+#include <cstdarg>
+
+#pragma clang diagnostic ignored "-Wformat-zero-length"
+
+int main()
+{
+    FILE* fp = 0;
+    fpos_t fpos = {0};
+    size_t s = 0;
+    char* cp = 0;
+    va_list va;
+    static_assert((std::is_same<decltype(remove("")), int>::value), "");
+    static_assert((std::is_same<decltype(rename("","")), int>::value), "");
+    static_assert((std::is_same<decltype(tmpfile()), FILE*>::value), "");
+    static_assert((std::is_same<decltype(tmpnam(cp)), char*>::value), "");
+    static_assert((std::is_same<decltype(fclose(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fflush(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fopen("", "")), FILE*>::value), "");
+    static_assert((std::is_same<decltype(freopen("", "", fp)), FILE*>::value), "");
+    static_assert((std::is_same<decltype(setbuf(fp,cp)), void>::value), "");
+    static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
+    static_assert((std::is_same<decltype(fprintf(fp," ")), int>::value), "");
+    static_assert((std::is_same<decltype(fscanf(fp,"")), int>::value), "");
+    static_assert((std::is_same<decltype(printf("\n")), int>::value), "");
+    static_assert((std::is_same<decltype(scanf("\n")), int>::value), "");
+    static_assert((std::is_same<decltype(snprintf(cp,0,"p")), int>::value), "");
+    static_assert((std::is_same<decltype(sprintf(cp," ")), int>::value), "");
+    static_assert((std::is_same<decltype(sscanf("","")), int>::value), "");
+    static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vfscanf(fp,"",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vprintf(" ",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vscanf("",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vsnprintf(cp,0," ",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vsprintf(cp," ",va)), int>::value), "");
+    static_assert((std::is_same<decltype(vsscanf("","",va)), int>::value), "");
+    static_assert((std::is_same<decltype(fgetc(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fgets(cp,0,fp)), char*>::value), "");
+    static_assert((std::is_same<decltype(fputc(0,fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fputs("",fp)), int>::value), "");
+    static_assert((std::is_same<decltype(getc(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(getchar()), int>::value), "");
+#if _LIBCPP_STD_VER < 14
+    static_assert((std::is_same<decltype(gets(cp)), char*>::value), "");
+#endif
+    static_assert((std::is_same<decltype(putc(0,fp)), int>::value), "");
+    static_assert((std::is_same<decltype(putchar(0)), int>::value), "");
+    static_assert((std::is_same<decltype(puts("")), int>::value), "");
+    static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
+    static_assert((std::is_same<decltype(fwrite((const void*)0,0,0,fp)), size_t>::value), "");
+    static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
+    static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
+    static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::value), "");
+    static_assert((std::is_same<decltype(ftell(fp)), long>::value), "");
+    static_assert((std::is_same<decltype(rewind(fp)), void>::value), "");
+    static_assert((std::is_same<decltype(clearerr(fp)), void>::value), "");
+    static_assert((std::is_same<decltype(feof(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(ferror(fp)), int>::value), "");
+    static_assert((std::is_same<decltype(perror("")), void>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/stdlib_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/stdlib_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/stdlib_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <stdlib.h>
+
+#include <stdlib.h>
+#include <type_traits>
+
+#ifndef EXIT_FAILURE
+#error EXIT_FAILURE not defined
+#endif
+
+#ifndef EXIT_SUCCESS
+#error EXIT_SUCCESS not defined
+#endif
+
+#ifndef MB_CUR_MAX
+#error MB_CUR_MAX not defined
+#endif
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef RAND_MAX
+#error RAND_MAX not defined
+#endif
+
+int main()
+{
+    size_t s = 0;
+    div_t d;
+    ldiv_t ld;
+    lldiv_t lld;
+    char** endptr = 0;
+    static_assert((std::is_same<decltype(atof("")), double>::value), "");
+    static_assert((std::is_same<decltype(atoi("")), int>::value), "");
+    static_assert((std::is_same<decltype(atol("")), long>::value), "");
+    static_assert((std::is_same<decltype(atoll("")), long long>::value), "");
+    static_assert((std::is_same<decltype(getenv("")), char*>::value), "");
+    static_assert((std::is_same<decltype(strtod("", endptr)), double>::value), "");
+    static_assert((std::is_same<decltype(strtof("", endptr)), float>::value), "");
+    static_assert((std::is_same<decltype(strtold("", endptr)), long double>::value), "");
+    static_assert((std::is_same<decltype(strtol("", endptr,0)), long>::value), "");
+    static_assert((std::is_same<decltype(strtoll("", endptr,0)), long long>::value), "");
+    static_assert((std::is_same<decltype(strtoul("", endptr,0)), unsigned long>::value), "");
+    static_assert((std::is_same<decltype(strtoull("", endptr,0)), unsigned long long>::value), "");
+    static_assert((std::is_same<decltype(rand()), int>::value), "");
+    static_assert((std::is_same<decltype(srand(0)), void>::value), "");
+    static_assert((std::is_same<decltype(calloc(0,0)), void*>::value), "");
+    static_assert((std::is_same<decltype(free(0)), void>::value), "");
+    static_assert((std::is_same<decltype(malloc(0)), void*>::value), "");
+    static_assert((std::is_same<decltype(realloc(0,0)), void*>::value), "");
+    static_assert((std::is_same<decltype(abort()), void>::value), "");
+    static_assert((std::is_same<decltype(atexit(0)), int>::value), "");
+    static_assert((std::is_same<decltype(exit(0)), void>::value), "");
+    static_assert((std::is_same<decltype(_Exit(0)), void>::value), "");
+    static_assert((std::is_same<decltype(getenv("")), char*>::value), "");
+    static_assert((std::is_same<decltype(system("")), int>::value), "");
+    static_assert((std::is_same<decltype(bsearch(0,0,0,0,0)), void*>::value), "");
+    static_assert((std::is_same<decltype(qsort(0,0,0,0)), void>::value), "");
+    static_assert((std::is_same<decltype(abs(0)), int>::value), "");
+    static_assert((std::is_same<decltype(labs((long)0)), long>::value), "");
+    static_assert((std::is_same<decltype(llabs((long long)0)), long long>::value), "");
+    static_assert((std::is_same<decltype(div(0,0)), div_t>::value), "");
+    static_assert((std::is_same<decltype(ldiv(0L,0L)), ldiv_t>::value), "");
+    static_assert((std::is_same<decltype(lldiv(0LL,0LL)), lldiv_t>::value), "");
+    static_assert((std::is_same<decltype(mblen("",0)), int>::value), "");
+    wchar_t* pw = 0;
+    const wchar_t* pwc = 0;
+    char* pc = 0;
+    static_assert((std::is_same<decltype(mbtowc(pw,"",0)), int>::value), "");
+    static_assert((std::is_same<decltype(wctomb(pc,L' ')), int>::value), "");
+    static_assert((std::is_same<decltype(mbstowcs(pw,"",0)), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcstombs(pc,pwc,0)), size_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/string_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/string_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/string_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/string_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string.h>
+
+#include <string.h>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+int main()
+{
+    size_t s = 0;
+    void* vp = 0;
+    const void* vpc = 0;
+    char* cp = 0;
+    const char* cpc = 0;
+    static_assert((std::is_same<decltype(memcpy(vp, vpc, s)), void*>::value), "");
+    static_assert((std::is_same<decltype(memmove(vp, vpc, s)), void*>::value), "");
+    static_assert((std::is_same<decltype(strcpy(cp, cpc)), char*>::value), "");
+    static_assert((std::is_same<decltype(strncpy(cp, cpc, s)), char*>::value), "");
+    static_assert((std::is_same<decltype(strcat(cp, cpc)), char*>::value), "");
+    static_assert((std::is_same<decltype(strncat(cp, cpc, s)), char*>::value), "");
+    static_assert((std::is_same<decltype(memcmp(vpc, vpc, s)), int>::value), "");
+    static_assert((std::is_same<decltype(strcmp(cpc, cpc)), int>::value), "");
+    static_assert((std::is_same<decltype(strncmp(cpc, cpc, s)), int>::value), "");
+    static_assert((std::is_same<decltype(strcoll(cpc, cpc)), int>::value), "");
+    static_assert((std::is_same<decltype(strxfrm(cp, cpc, s)), size_t>::value), "");
+    static_assert((std::is_same<decltype(memchr(vp, 0, s)), void*>::value), "");
+    static_assert((std::is_same<decltype(strchr(cp, 0)), char*>::value), "");
+    static_assert((std::is_same<decltype(strcspn(cpc, cpc)), size_t>::value), "");
+    static_assert((std::is_same<decltype(strpbrk(cp, cpc)), char*>::value), "");
+    static_assert((std::is_same<decltype(strrchr(cp, 0)), char*>::value), "");
+    static_assert((std::is_same<decltype(strspn(cpc, cpc)), size_t>::value), "");
+    static_assert((std::is_same<decltype(strstr(cp, cpc)), char*>::value), "");
+    static_assert((std::is_same<decltype(strtok(cp, cpc)), char*>::value), "");
+    static_assert((std::is_same<decltype(memset(vp, 0, s)), void*>::value), "");
+    static_assert((std::is_same<decltype(strerror(0)), char*>::value), "");
+    static_assert((std::is_same<decltype(strlen(cpc)), size_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/tgmath_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/tgmath_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/tgmath_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tgmath.h>
+
+#include <tgmath.h>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+    std::complex<double> cd;
+    double x = sin(1.0);
+    (void)x; // to placate scan-build
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/time_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/time_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/time_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/time_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <time.h>
+
+#include <time.h>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#error CLOCKS_PER_SEC not defined
+#endif
+
+int main()
+{
+    clock_t c = 0;
+    size_t s = 0;
+    time_t t = 0;
+    tm tmv = {0};
+    static_assert((std::is_same<decltype(clock()), clock_t>::value), "");
+    static_assert((std::is_same<decltype(difftime(t,t)), double>::value), "");
+    static_assert((std::is_same<decltype(mktime(&tmv)), time_t>::value), "");
+    static_assert((std::is_same<decltype(time(&t)), time_t>::value), "");
+    static_assert((std::is_same<decltype(asctime(&tmv)), char*>::value), "");
+    static_assert((std::is_same<decltype(ctime(&t)), char*>::value), "");
+    static_assert((std::is_same<decltype(gmtime(&t)), tm*>::value), "");
+    static_assert((std::is_same<decltype(localtime(&t)), tm*>::value), "");
+    char* c1 = 0;
+    const char* c2 = 0;
+    static_assert((std::is_same<decltype(strftime(c1,s,c2,&tmv)), size_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/uchar_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/uchar_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/uchar_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/uchar_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+//
+// XFAIL: apple-darwin
+// XFAIL: newlib
+
+// <uchar.h>
+
+#include <uchar.h>
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <wchar.h>
+
+#include <wchar.h>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef WCHAR_MAX
+#error WCHAR_MAX not defined
+#endif
+
+#ifndef WCHAR_MIN
+#error WCHAR_MIN not defined
+#endif
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+int main()
+{
+    mbstate_t mb = {0};
+    size_t s = 0;
+    tm *tm = 0;
+    wint_t w = 0;
+    ::FILE* fp = 0;
+#ifdef __APPLE__
+    __darwin_va_list va;
+#else
+    __builtin_va_list va;
+#endif
+    char* ns = 0;
+    wchar_t* ws = 0;
+    static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), "");
+    static_assert((std::is_same<decltype(fwscanf(fp, L"")), int>::value), "");
+    static_assert((std::is_same<decltype(swprintf(ws, s, L"")), int>::value), "");
+    static_assert((std::is_same<decltype(swscanf(L"", L"")), int>::value), "");
+    static_assert((std::is_same<decltype(vfwprintf(fp, L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(vfwscanf(fp, L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(vswprintf(ws, s, L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(vswscanf(L"", L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(vwprintf(L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(vwscanf(L"", va)), int>::value), "");
+    static_assert((std::is_same<decltype(wprintf(L"")), int>::value), "");
+    static_assert((std::is_same<decltype(wscanf(L"")), int>::value), "");
+    static_assert((std::is_same<decltype(fgetwc(fp)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(fgetws(ws, 0, fp)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(fputwc(L' ', fp)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(fputws(L"", fp)), int>::value), "");
+    static_assert((std::is_same<decltype(fwide(fp, 0)), int>::value), "");
+    static_assert((std::is_same<decltype(getwc(fp)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(getwchar()), wint_t>::value), "");
+    static_assert((std::is_same<decltype(putwc(L' ', fp)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(putwchar(L' ')), wint_t>::value), "");
+    static_assert((std::is_same<decltype(ungetwc(L' ', fp)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(wcstod(L"", (wchar_t**)0)), double>::value), "");
+    static_assert((std::is_same<decltype(wcstof(L"", (wchar_t**)0)), float>::value), "");
+    static_assert((std::is_same<decltype(wcstold(L"", (wchar_t**)0)), long double>::value), "");
+    static_assert((std::is_same<decltype(wcstol(L"", (wchar_t**)0, 0)), long>::value), "");
+    static_assert((std::is_same<decltype(wcstoll(L"", (wchar_t**)0, 0)), long long>::value), "");
+    static_assert((std::is_same<decltype(wcstoul(L"", (wchar_t**)0, 0)), unsigned long>::value), "");
+    static_assert((std::is_same<decltype(wcstoull(L"", (wchar_t**)0, 0)), unsigned long long>::value), "");
+    static_assert((std::is_same<decltype(wcscpy(ws, L"")), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcsncpy(ws, L"", s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcscat(ws, L"")), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcsncat(ws, L"", s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcscmp(L"", L"")), int>::value), "");
+    static_assert((std::is_same<decltype(wcscoll(L"", L"")), int>::value), "");
+    static_assert((std::is_same<decltype(wcsncmp(L"", L"", s)), int>::value), "");
+    static_assert((std::is_same<decltype(wcsxfrm(ws, L"", s)), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcschr((wchar_t*)0, L' ')), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcscspn(L"", L"")), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcslen(L"")), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcspbrk((wchar_t*)0, L"")), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcsrchr((wchar_t*)0, L' ')), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcsspn(L"", L"")), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcsstr((wchar_t*)0, L"")), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcstok(ws, L"", (wchar_t**)0)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wmemchr((wchar_t*)0, L' ', s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wmemcmp(L"", L"", s)), int>::value), "");
+    static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), "");
+    static_assert((std::is_same<decltype(wcsftime(ws, s, L"", tm)), size_t>::value), "");
+    static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(wctob(w)), int>::value), "");
+    static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), "");
+    static_assert((std::is_same<decltype(mbrlen("", s, &mb)), size_t>::value), "");
+    static_assert((std::is_same<decltype(mbrtowc(ws, "", s, &mb)), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcrtomb(ns, L' ', &mb)), size_t>::value), "");
+    static_assert((std::is_same<decltype(mbsrtowcs(ws, (const char**)0, s, &mb)), size_t>::value), "");
+    static_assert((std::is_same<decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)), size_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.c.headers/wctype_h.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/wctype_h.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.c.headers/wctype_h.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.c.headers/wctype_h.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <wctype.h>
+
+#include <wctype.h>
+#include <type_traits>
+
+#ifndef WEOF
+#error WEOF not defined
+#endif
+
+#ifdef iswalnum
+#error iswalnum defined
+#endif
+
+#ifdef iswalpha
+#error iswalpha defined
+#endif
+
+#ifdef iswblank
+#error iswblank defined
+#endif
+
+#ifdef iswcntrl
+#error iswcntrl defined
+#endif
+
+#ifdef iswdigit
+#error iswdigit defined
+#endif
+
+#ifdef iswgraph
+#error iswgraph defined
+#endif
+
+#ifdef iswlower
+#error iswlower defined
+#endif
+
+#ifdef iswprint
+#error iswprint defined
+#endif
+
+#ifdef iswpunct
+#error iswpunct defined
+#endif
+
+#ifdef iswspace
+#error iswspace defined
+#endif
+
+#ifdef iswupper
+#error iswupper defined
+#endif
+
+#ifdef iswxdigit
+#error iswxdigit defined
+#endif
+
+#ifdef iswctype
+#error iswctype defined
+#endif
+
+#ifdef wctype
+#error wctype defined
+#endif
+
+#ifdef towlower
+#error towlower defined
+#endif
+
+#ifdef towupper
+#error towupper defined
+#endif
+
+#ifdef towctrans
+#error towctrans defined
+#endif
+
+#ifdef wctrans
+#error wctrans defined
+#endif
+
+int main()
+{
+    wint_t w = 0;
+    wctrans_t wctr = 0;
+    wctype_t wct = 0;
+    static_assert((std::is_same<decltype(iswalnum(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswalpha(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswblank(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswcntrl(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswdigit(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswgraph(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswlower(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswprint(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswpunct(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswspace(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswupper(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswxdigit(w)), int>::value), "");
+    static_assert((std::is_same<decltype(iswctype(w, wct)), int>::value), "");
+    static_assert((std::is_same<decltype(wctype("")), wctype_t>::value), "");
+    static_assert((std::is_same<decltype(towlower(w)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(towupper(w)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(towctrans(w, wctr)), wint_t>::value), "");
+    static_assert((std::is_same<decltype(wctrans("")), wctrans_t>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// pointer_to_binary_function
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double binary_f(int i, short j) {return i - j + .75;}
+
+int main()
+{
+    typedef std::pointer_to_binary_function<int, short, double> F;
+    static_assert((std::is_base_of<std::binary_function<int, short, double>, F>::value), "");
+    const F f(binary_f);
+    assert(f(36, 27) == 9.75);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// pointer_to_unary_function
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double unary_f(int i) {return 0.5 - i;}
+
+int main()
+{
+    typedef std::pointer_to_unary_function<int, double> F;
+    static_assert((std::is_base_of<std::unary_function<int, double>, F>::value), "");
+    const F f(unary_f);
+    assert(f(36) == -35.5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <CopyConstructible Arg, Returnable Result>
+// pointer_to_unary_function<Arg, Result>
+// ptr_fun(Result (*f)(Arg));
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double unary_f(int i) {return 0.5 - i;}
+
+int main()
+{
+    assert(std::ptr_fun(unary_f)(36) == -35.5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <CopyConstructible Arg1, CopyConstructible Arg2, Returnable Result>
+// pointer_to_binary_function<Arg1,Arg2,Result>
+// ptr_fun(Result (*f)(Arg1, Arg2));
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double binary_f(int i, short j) {return i - j + .75;}
+
+int main()
+{
+    assert(std::ptr_fun(binary_f)(36, 27) == 9.75);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<cReturnable S, ClassType T>
+//   const_mem_fun_t<S,T>
+//   mem_fun(S (T::*f)() const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun(&A::a3)(&a) == 1);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   const_mem_fun1_t<S,T,A>
+//   mem_fun(S (T::*f)(A) const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun(&A::a4)(&a, 6) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun1_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun1_ref_t<double, A, unsigned> F;
+    static_assert((std::is_base_of<std::binary_function<A, unsigned, double>, F>::value), "");
+    const F f(&A::a4);
+    const A a = A();
+    assert(f(a, 6) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun1_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun1_t<double, A, unsigned> F;
+    static_assert((std::is_base_of<std::binary_function<const A*, unsigned, double>, F>::value), "");
+    const F f(&A::a4);
+    const A a = A();
+    assert(f(&a, 6) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   const_mem_fun_ref_t<S,T>
+//   mem_fun_ref(S (T::*f)() const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun_ref(&A::a3)(a) == 1);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   const_mem_fun1_ref_t<S,T,A>
+//   mem_fun_ref(S (T::*f)(A) const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun_ref(&A::a4)(a, 6) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun_ref_t<int, A> F;
+    static_assert((std::is_base_of<std::unary_function<A, int>, F>::value), "");
+    const F f(&A::a3);
+    const A a = A();
+    assert(f(a) == 1);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun_t<int, A> F;
+    static_assert((std::is_base_of<std::unary_function<const A*, int>, F>::value), "");
+    const F f(&A::a3);
+    const A a = A();
+    assert(f(&a) == 1);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   mem_fun_t<S,T>
+//   mem_fun(S (T::*f)());
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun(&A::a1)(&a) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   mem_fun1_t<S,T,A>
+//   mem_fun(S (T::*f)(A));
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun(&A::a2)(&a, 5) == 6);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun1_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun1_ref_t<short, A, int> F;
+    static_assert((std::is_base_of<std::binary_function<A, int, short>, F>::value), "");
+    const F f(&A::a2);
+    A a;
+    assert(f(a, 5) == 6);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun1_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun1_t<short, A, int> F;
+    static_assert((std::is_base_of<std::binary_function<A*, int, short>, F>::value), "");
+    const F f(&A::a2);
+    A a;
+    assert(f(&a, 5) == 6);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   mem_fun_ref_t<S,T>
+//   mem_fun_ref(S (T::*f)());
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun_ref(&A::a1)(a) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   mem_fun1_ref_t<S,T,A>
+//   mem_fun_ref(S (T::*f)(A));
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun_ref(&A::a2)(a, 5) == 6);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun_ref_t<char, A> F;
+    static_assert((std::is_base_of<std::unary_function<A, char>, F>::value), "");
+    const F f(&A::a1);
+    A a;
+    assert(f(a) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun_t<char, A> F;
+    static_assert((std::is_base_of<std::unary_function<A*, char>, F>::value), "");
+    const F f(&A::a1);
+    A a;
+    assert(f(&a) == 5);
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Arg1, class Arg2, class Result>
+// struct binary_function
+// {
+//     typedef Arg1   first_argument_type;
+//     typedef Arg2   second_argument_type;
+//     typedef Result result_type;
+// };
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_same<std::binary_function<int, unsigned, char>::first_argument_type, int>::value), "");
+    static_assert((std::is_same<std::binary_function<int, unsigned, char>::second_argument_type, unsigned>::value), "");
+    static_assert((std::is_same<std::binary_function<int, unsigned, char>::result_type, char>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Arg, class Result>
+// struct unary_function
+// {
+//     typedef Arg    argument_type;
+//     typedef Result result_type;
+// };
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_same<std::unary_function<unsigned, char>::argument_type, unsigned>::value), "");
+    static_assert((std::is_same<std::unary_function<unsigned, char>::result_type, char>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.function.objects/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.function.objects/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.function.objects/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+//
+// class ios_base
+// {
+// public:
+//     typedef T1 io_state;
+// };
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    std::strstream::io_state b = std::strstream::eofbit;
+    assert(b == std::ios::eofbit);
+}

Added: libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+//
+// class ios_base
+// {
+// public:
+//     typedef T2 open_mode;
+// };
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    std::strstream::open_mode b = std::strstream::app;
+    assert(b == std::ios::app);
+}

Added: libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+//
+// class ios_base
+// {
+// public:
+//     typedef T3 seek_dir;
+// };
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    std::strstream::seek_dir b = std::strstream::cur;
+    assert(b == std::ios::cur);
+}

Added: libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+//
+// class ios_base
+// {
+// public:
+//     typedef OFF_T streamoff;
+// };
+
+#include <ios>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_integral<std::ios_base::streamoff>::value), "");
+    static_assert((std::is_signed<std::ios_base::streamoff>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+//
+// class ios_base
+// {
+// public:
+//     typedef POS_T streampos;
+// };
+
+#include <ios>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_same<std::ios_base::streampos, std::streampos>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Fn, class T>
+//   binder1st<Fn>
+//   bind1st(const Fn& fn, const T& x);
+
+#include <functional>
+#include <cassert>
+
+#include "../test_func.h"
+
+int main()
+{
+    assert(std::bind1st(test_func(1), 5)(10.) == -5.);
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Fn, class T>
+//   binder2nd<Fn>
+//   bind2nd(const Fn& op, const T& x);
+
+#include <functional>
+#include <cassert>
+
+#include "../test_func.h"
+
+int main()
+{
+    assert(std::bind2nd(test_func(1), 5)(10) == 5.);
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Fn>
+// class binder1st
+//   : public unary_function<typename Fn::second_argument_type, typename Fn::result_type>
+// {
+// protected:
+//   Fn op;
+//   typename Fn::first_argument_type value;
+// public:
+//   binder2nd(const Fn& x, const typename Fn::second_argument_type& y);
+//
+//   typename Fn::result_type operator()(const typename Fn::first_argument_type& x) const;
+//   typename Fn::result_type operator()(typename Fn::first_argument_type& x) const;
+// };
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "../test_func.h"
+
+class test
+    : public std::binder1st<test_func>
+{
+    typedef std::binder1st<test_func> base;
+public:
+    test() : std::binder1st<test_func>(test_func(2), 30) {}
+
+    void do_test()
+    {
+        static_assert((std::is_base_of<
+                         std::unary_function<test_func::second_argument_type,
+                                             test_func::result_type>,
+                         test>::value), "");
+        assert(op.id() == 2);
+        assert(value == 30);
+
+        double d = 5;
+        assert((*this)(d) == 35);
+        assert((*this)(5) == 25);
+    }
+};
+
+int main()
+{
+    test t;
+    t.do_test();
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class Fn>
+// class binder2nd
+//   : public unary_function<typename Fn::first_argument_type, typename Fn::result_type>
+// {
+// protected:
+//   Fn op;
+//   typename Fn::second_argument_type value;
+// public:
+//   binder2nd(const Fn& x, const typename Fn::second_argument_type& y);
+//
+//   typename Fn::result_type operator()(const typename Fn::first_argument_type& x) const;
+//   typename Fn::result_type operator()(typename Fn::first_argument_type& x) const;
+// };
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "../test_func.h"
+
+class test
+    : public std::binder2nd<test_func>
+{
+    typedef std::binder2nd<test_func> base;
+public:
+    test() : std::binder2nd<test_func>(test_func(3), 4.5) {}
+
+    void do_test()
+    {
+        static_assert((std::is_base_of<
+                         std::unary_function<test_func::first_argument_type,
+                                             test_func::result_type>,
+                         test>::value), "");
+        assert(op.id() == 3);
+        assert(value == 4.5);
+
+        int i = 5;
+        assert((*this)(i) == 22.5);
+        assert((*this)(5) == 0.5);
+    }
+};
+
+int main()
+{
+    test t;
+    t.do_test();
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/depr/depr.lib.binders/test_func.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/test_func.h?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/test_func.h (added)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/test_func.h Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEST_FUNC_H
+#define TEST_FUNC_H
+
+class test_func
+{
+    int id_;
+public:
+    typedef int first_argument_type;
+    typedef double second_argument_type;
+    typedef long double result_type;
+
+    explicit test_func(int id) : id_(id) {}
+
+    int id() const {return id_;}
+
+    result_type operator() (const first_argument_type& x, second_argument_type& y) const
+        {return x+y;}
+    result_type operator() (const first_argument_type& x, const second_argument_type& y) const
+        {return x-y;}
+    result_type operator() (first_argument_type& x, const second_argument_type& y) const
+        {return x*y;}
+};
+
+#endif  // TEST_FUNC_H

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// explicit istrstream(const char* s);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const char buf[] = "123 4.5 dog";
+        std::istrstream in(buf);
+        int i;
+        in >> i;
+        assert(i == 123);
+        double d;
+        in >> d;
+        assert(d == 4.5);
+        std::string s;
+        in >> s;
+        assert(s == "dog");
+        assert(in.eof());
+        assert(!in.fail());
+        in.clear();
+        in.putback('g');
+        assert(!in.fail());
+        in.putback('g');
+        assert(in.fail());
+        assert(buf[9] == 'o');
+        assert(buf[10] == 'g');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/ccp_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// explicit istrstream(const char* s, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const char buf[] = "123 4.5 dog";
+        std::istrstream in(buf, 7);
+        int i;
+        in >> i;
+        assert(i == 123);
+        double d;
+        in >> d;
+        assert(d == 4.5);
+        std::string s;
+        in >> s;
+        assert(s == "");
+        assert(in.eof());
+        assert(in.fail());
+        in.clear();
+        in.putback('5');
+        assert(!in.fail());
+        in.putback('5');
+        assert(in.fail());
+        assert(buf[5] == '.');
+        assert(buf[6] == '5');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// explicit istrstream(char* s);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        std::istrstream in(buf);
+        int i;
+        in >> i;
+        assert(i == 123);
+        double d;
+        in >> d;
+        assert(d == 4.5);
+        std::string s;
+        in >> s;
+        assert(s == "dog");
+        assert(in.eof());
+        assert(!in.fail());
+        in.clear();
+        in.putback('g');
+        assert(!in.fail());
+        in.putback('g');
+        assert(!in.fail());
+        assert(buf[9] == 'g');
+        assert(buf[10] == 'g');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.cons/cp_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// explicit istrstream(char* s, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        std::istrstream in(buf, 7);
+        int i;
+        in >> i;
+        assert(i == 123);
+        double d;
+        in >> d;
+        assert(d == 4.5);
+        std::string s;
+        in >> s;
+        assert(s == "");
+        assert(in.eof());
+        assert(in.fail());
+        in.clear();
+        in.putback('5');
+        assert(!in.fail());
+        in.putback('5');
+        assert(!in.fail());
+        assert(buf[5] == '5');
+        assert(buf[6] == '5');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/rdbuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/rdbuf.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/rdbuf.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/rdbuf.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// strstreambuf* rdbuf() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const char buf[] = "123 4.5 dog";
+        const std::istrstream in(buf);
+        std::strstreambuf* sb = in.rdbuf();
+        assert(sb->sgetc() == '1');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/str.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/str.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/str.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/depr.istrstream.members/str.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+
+// char* str();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const char buf[] = "123 4.5 dog";
+        std::istrstream in(buf);
+        assert(in.str() == std::string("123 4.5 dog"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/types.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.istrstream/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class istrstream
+//     : public basic_istream<char>
+// {
+//     ...
+
+#include <strstream>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::istream, std::istrstream>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// ostrstream(char* s, int n, ios_base::openmode mode = ios_base::out);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        std::ostrstream out(buf, 0);
+        assert(out.str() == std::string("123 4.5 dog"));
+        int i = 321;
+        double d = 5.5;
+        std::string s("cat");
+        out << i << ' ' << d << ' ' << s << std::ends;
+        assert(out.str() == std::string("321 5.5 cat"));
+    }
+    {
+        char buf[23] = "123 4.5 dog";
+        std::ostrstream out(buf, 11, std::ios::app);
+        assert(out.str() == std::string("123 4.5 dog"));
+        int i = 321;
+        double d = 5.5;
+        std::string s("cat");
+        out << i << ' ' << d << ' ' << s << std::ends;
+        assert(out.str() == std::string("123 4.5 dog321 5.5 cat"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// ostrstream();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    std::ostrstream out;
+    int i = 123;
+    double d = 4.5;
+    std::string s("dog");
+    out << i << ' ' << d << ' ' << s << std::ends;
+    assert(out.str() == std::string("123 4.5 dog"));
+    out.freeze(false);
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/freeze.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/freeze.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/freeze.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/freeze.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// void freeze(bool freezefl = true);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::ostrstream out;
+        out.freeze();
+        assert(!out.fail());
+        out << 'a';
+        assert(out.fail());
+        out.clear();
+        out.freeze(false);
+        out << 'a';
+        out << char(0);
+        assert(out.str() == std::string("a"));
+        out.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/pcount.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/pcount.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/pcount.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/pcount.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// int pcount() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::ostrstream out;
+        assert(out.pcount() == 0);
+        out << 123 << ' ' << 4.5 << ' ' << "dog";
+        assert(out.pcount() == 11);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/rdbuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/rdbuf.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/rdbuf.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/rdbuf.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// strstreambuf* rdbuf() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        const std::ostrstream out(buf, 0);
+        std::strstreambuf* sb = out.rdbuf();
+        assert(sb->sputc('a') == 'a');
+        assert(buf == std::string("a23 4.5 dog"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+
+// char* str();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::ostrstream out;
+        out << 123 << ' ' << 4.5 << ' ' << "dog" << std::ends;
+        assert(out.str() == std::string("123 4.5 dog"));
+        out.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/types.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.ostrstream/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class ostrstream
+//     : public basic_ostream<char>
+// {
+//     ...
+
+#include <strstream>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::ostream, std::ostrstream>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/cp_size_mode.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// strstream(char* s, int n, ios_base::openmode mode = ios_base::in | ios_base::out);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        std::strstream inout(buf, 0);
+        assert(inout.str() == std::string("123 4.5 dog"));
+        int i = 321;
+        double d = 5.5;
+        std::string s("cat");
+        inout >> i;
+        assert(inout.fail());
+        inout.clear();
+        inout << i << ' ' << d << ' ' << s;
+        assert(inout.str() == std::string("321 5.5 cat"));
+        i = 0;
+        d = 0;
+        s = "";
+        inout >> i >> d >> s;
+        assert(i == 321);
+        assert(d == 5.5);
+        assert(s == "cat");
+    }
+    {
+        char buf[23] = "123 4.5 dog";
+        std::strstream inout(buf, 11, std::ios::app);
+        assert(inout.str() == std::string("123 4.5 dog"));
+        int i = 0;
+        double d = 0;
+        std::string s;
+        inout >> i >> d >> s;
+        assert(i == 123);
+        assert(d == 4.5);
+        assert(s == "dog");
+        i = 321;
+        d = 5.5;
+        s = "cat";
+        inout.clear();
+        inout << i << ' ' << d << ' ' << s;
+        assert(inout.str() == std::string("123 4.5 dog321 5.5 cat"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// strstream();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    std::strstream inout;
+    int i = 123;
+    double d = 4.5;
+    std::string s("dog");
+    inout << i << ' ' << d << ' ' << s << std::ends;
+    assert(inout.str() == std::string("123 4.5 dog"));
+    i = 0;
+    d = 0;
+    s = "";
+    inout >> i >> d >> s;
+    assert(i == 123);
+    assert(d == 4.5);
+    assert(strcmp(s.c_str(), "dog") == 0);
+    inout.freeze(false);
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.dest/rdbuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.dest/rdbuf.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.dest/rdbuf.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.dest/rdbuf.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// strstreambuf* rdbuf() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "123 4.5 dog";
+        const std::strstream out(buf, 0);
+        std::strstreambuf* sb = out.rdbuf();
+        assert(sb->sputc('a') == 'a');
+        assert(buf == std::string("a23 4.5 dog"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// void freeze(bool freezefl = true);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstream out;
+        out.freeze();
+        assert(!out.fail());
+        out << 'a';
+        assert(out.fail());
+        out.clear();
+        out.freeze(false);
+        out << 'a';
+        out << char(0);
+        assert(out.str() == std::string("a"));
+        out.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// int pcount() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstream out;
+        assert(out.pcount() == 0);
+        out << 123 << ' ' << 4.5 << ' ' << "dog";
+        assert(out.pcount() == 11);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// char* str();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstream out;
+        out << 123 << ' ' << 4.5 << ' ' << "dog" << std::ends;
+        assert(out.str() == std::string("123 4.5 dog"));
+        out.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/types.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstream/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+//     : public basic_iostream<char>
+// {
+// public:
+//     // Types
+//     typedef char                        char_type;
+//     typedef char_traits<char>::int_type int_type;
+//     typedef char_traits<char>::pos_type pos_type;
+//     typedef char_traits<char>::off_type off_type;
+
+#include <strstream>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::iostream, std::strstream>::value), "");
+    static_assert((std::is_same<std::strstream::char_type, char>::value), "");
+    static_assert((std::is_same<std::strstream::int_type, std::char_traits<char>::int_type>::value), "");
+    static_assert((std::is_same<std::strstream::pos_type, std::char_traits<char>::pos_type>::value), "");
+    static_assert((std::is_same<std::strstream::off_type, std::char_traits<char>::off_type>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ccp_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ccp_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ccp_size.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ccp_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(const char* gnext_arg, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        const char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf), buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0, buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        char buf[10] = "abcd";
+        int s = std::strlen(buf);
+        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == 'j');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == 'j');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cscp_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cscp_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cscp_size.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cscp_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(const signed char* gnext_arg, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        const signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        const signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cucp_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cucp_size.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cucp_size.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cucp_size.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(const unsigned char* gnext_arg, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/custom_alloc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*));
+
+#include <strstream>
+#include <cassert>
+
+int called = 0;
+
+void* my_alloc(std::size_t n)
+{
+    static char buf[10000];
+    ++called;
+    return buf;
+}
+
+void my_free(void*)
+{
+    ++called;
+}
+
+struct test
+    : std::strstreambuf
+{
+    test(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*))
+        : std::strstreambuf(palloc_arg, pfree_arg) {}
+    virtual int_type overflow(int_type c)
+        {return std::strstreambuf::overflow(c);}
+};
+
+int main()
+{
+    {
+        test s(my_alloc, my_free);
+        assert(called == 0);
+        s.overflow('a');
+        assert(called == 1);
+    }
+    assert(called == 2);
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// explicit strstreambuf(streamsize alsize_arg = 0);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstreambuf s;
+        assert(s.str() == nullptr);
+        assert(s.pcount() == 0);
+    }
+    {
+        std::strstreambuf s(1024);
+        assert(s.str() == nullptr);
+        assert(s.pcount() == 0);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf), buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        signed char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0, buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        signed char buf[10] = "abcd";
+        int s = std::strlen((char*)buf);
+        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == 'j');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == 'j');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf));
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == 0);
+        assert(sb.snextc() == EOF);
+    }
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, sizeof(buf), buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        unsigned char buf[] = "abcd";
+        std::strstreambuf sb(buf, 0, buf);
+        assert(sb.sgetc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == EOF);
+    }
+    {
+        unsigned char buf[10] = "abcd";
+        int s = std::strlen((char*)buf);
+        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        assert(sb.sgetc() == 'a');
+        assert(sb.snextc() == 'b');
+        assert(sb.snextc() == 'c');
+        assert(sb.snextc() == 'd');
+        assert(sb.snextc() == EOF);
+        assert(sb.sputc('e') == 'e');
+        assert(sb.sputc('f') == 'f');
+        assert(sb.sputc('g') == 'g');
+        assert(sb.sputc('h') == 'h');
+        assert(sb.sputc('i') == 'i');
+        assert(sb.sputc('j') == 'j');
+        assert(sb.sputc('j') == EOF);
+        assert(sb.sgetc() == 'e');
+        assert(sb.snextc() == 'f');
+        assert(sb.snextc() == 'g');
+        assert(sb.snextc() == 'h');
+        assert(sb.snextc() == 'i');
+        assert(sb.snextc() == 'j');
+        assert(sb.snextc() == EOF);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/freeze.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/freeze.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/freeze.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/freeze.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// void freeze(bool freezefl = true);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstreambuf sb;
+        sb.freeze(true);
+        assert(sb.sputc('a') == EOF);
+        sb.freeze(false);
+        assert(sb.sputc('a') == 'a');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/pcount.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/pcount.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/pcount.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/pcount.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// int pcount() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstreambuf sb;
+        assert(sb.pcount() == 0);
+        assert(sb.sputc('a') == 'a');
+        assert(sb.pcount() == 1);
+        assert(sb.sputc(0) == 0);
+        assert(sb.pcount() == 2);
+        assert(sb.str() == std::string("a"));
+        assert(sb.pcount() == 2);
+        sb.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/str.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/str.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/str.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/str.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// char* str();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        std::strstreambuf sb;
+        assert(sb.sputc('a') == 'a');
+        assert(sb.sputc(0) == 0);
+        assert(sb.str() == std::string("a"));
+        sb.freeze(false);
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/overflow.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/overflow.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/overflow.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/overflow.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// int_type overflow(int_type c = EOF);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[12] = "abc";
+        std::strstreambuf sb(buf, sizeof(buf), buf);
+        assert(sb.sputc('1') == '1');
+        assert(sb.str() == std::string("1bc"));
+        assert(sb.sputc('2') == '2');
+        assert(sb.str() == std::string("12c"));
+        assert(sb.sputc('3') == '3');
+        assert(sb.str() == std::string("123"));
+        assert(sb.sputc('4') == '4');
+        assert(sb.str() == std::string("1234"));
+        assert(sb.sputc('5') == '5');
+        assert(sb.str() == std::string("12345"));
+        assert(sb.sputc('6') == '6');
+        assert(sb.str() == std::string("123456"));
+        assert(sb.sputc('7') == '7');
+        assert(sb.str() == std::string("1234567"));
+        assert(sb.sputc('8') == '8');
+        assert(sb.str() == std::string("12345678"));
+        assert(sb.sputc('9') == '9');
+        assert(sb.str() == std::string("123456789"));
+        assert(sb.sputc('0') == '0');
+        assert(sb.str() == std::string("1234567890"));
+        assert(sb.sputc('1') == '1');
+        assert(sb.str() == std::string("12345678901"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/pbackfail.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/pbackfail.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/pbackfail.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/pbackfail.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// int_type pbackfail(int_type c = EOF);
+
+#include <strstream>
+#include <cassert>
+
+struct test
+    : public std::strstreambuf
+{
+    typedef std::strstreambuf base;
+    test(char* gnext_arg, std::streamsize n, char* pbeg_arg = 0)
+        : base(gnext_arg, n, pbeg_arg) {}
+    test(const char* gnext_arg, std::streamsize n)
+        : base(gnext_arg, n) {}
+
+    virtual int_type pbackfail(int_type c = EOF) {return base::pbackfail(c);}
+};
+
+int main()
+{
+    {
+        const char buf[] = "123";
+        test sb(buf, 0);
+        assert(sb.sgetc() == '1');
+        assert(sb.snextc() == '2');
+        assert(sb.snextc() == '3');
+        assert(sb.sgetc() == '3');
+        assert(sb.snextc() == EOF);
+        assert(sb.pbackfail('3') == '3');
+        assert(sb.pbackfail('3') == EOF);
+        assert(sb.pbackfail('2') == '2');
+        assert(sb.pbackfail(EOF) != EOF);
+        assert(sb.pbackfail(EOF) == EOF);
+        assert(sb.str() == std::string("123"));
+    }
+    {
+        char buf[] = "123";
+        test sb(buf, 0);
+        assert(sb.sgetc() == '1');
+        assert(sb.snextc() == '2');
+        assert(sb.snextc() == '3');
+        assert(sb.sgetc() == '3');
+        assert(sb.snextc() == EOF);
+        assert(sb.pbackfail('3') == '3');
+        assert(sb.pbackfail('3') == '3');
+        assert(sb.pbackfail(EOF) != EOF);
+        assert(sb.pbackfail(EOF) == EOF);
+        assert(sb.str() == std::string("133"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekoff.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekoff.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekoff.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekoff.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// pos_type seekoff(off_type off, ios_base::seekdir way,
+//                  ios_base::openmode which = ios_base::in | ios_base::out);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "0123456789";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1);
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == -1);
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::out) == -1);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in | std::ios_base::out) == -1);
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in | std::ios_base::out) == -1);
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in | std::ios_base::out) == -1);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in) == 3);
+        assert(sb.sgetc() == '3');
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in) == 6);
+        assert(sb.sgetc() == '6');
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in) == 7);
+        assert(sb.sgetc() == '7');
+    }
+    {
+        char buf[] = "0123456789";
+        std::strstreambuf sb(buf, 0, buf);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in) == 3);
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in) == 6);
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in) == 7);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out | std::ios_base::in) == 3);
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out | std::ios_base::in) == -1);
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::out | std::ios_base::in) == 7);
+        assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == 3);
+        assert(sb.sputc('a') == 'a');
+        assert(sb.str() == std::string("012a456789"));
+        assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == 7);
+        assert(sb.sputc('b') == 'b');
+        assert(sb.str() == std::string("012a456b89"));
+        assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::out) == 7);
+        assert(sb.sputc('c') == 'c');
+        assert(sb.str() == std::string("012a456c89"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekpos.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekpos.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekpos.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/seekpos.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// pos_type seekpos(pos_type sp,
+//                  ios_base::openmode which = ios_base::in | ios_base::out);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "0123456789";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.pubseekpos(3, std::ios_base::out) == -1);
+        assert(sb.pubseekpos(3, std::ios_base::in | std::ios_base::out) == -1);
+        assert(sb.pubseekpos(3, std::ios_base::in) == 3);
+        assert(sb.sgetc() == '3');
+    }
+    {
+        char buf[] = "0123456789";
+        std::strstreambuf sb(buf, 0, buf);
+        assert(sb.pubseekpos(3, std::ios_base::in) == 3);
+        assert(sb.pubseekpos(3, std::ios_base::out | std::ios_base::in) == 3);
+        assert(sb.pubseekpos(3, std::ios_base::out) == 3);
+        assert(sb.sputc('a') == 'a');
+        assert(sb.str() == std::string("012a456789"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/setbuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/setbuf.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/setbuf.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/setbuf.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// streambuf* setbuf(char* s, streamsize n);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+    {
+        char buf[] = "0123456789";
+        std::strstreambuf sb(buf, 0);
+        assert(sb.pubsetbuf(0, 0) == &sb);
+        assert(sb.str() == std::string("0123456789"));
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/underflow.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/underflow.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/underflow.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.virtuals/underflow.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+
+// int_type underflow();
+
+#include <strstream>
+#include <cassert>
+
+struct test
+    : public std::strstreambuf
+{
+    typedef std::strstreambuf base;
+    test(char* gnext_arg, std::streamsize n, char* pbeg_arg = 0)
+        : base(gnext_arg, n, pbeg_arg) {}
+    test(const char* gnext_arg, std::streamsize n)
+        : base(gnext_arg, n) {}
+
+    base::int_type underflow() {return base::underflow();}
+};
+
+int main()
+{
+    {
+        char buf[10] = "123";
+        test sb(buf, 0, buf + 3);
+        assert(sb.underflow() == '1');
+        assert(sb.underflow() == '1');
+        assert(sb.snextc() == '2');
+        assert(sb.underflow() == '2');
+        assert(sb.underflow() == '2');
+        assert(sb.snextc() == '3');
+        assert(sb.underflow() == '3');
+        assert(sb.underflow() == '3');
+        assert(sb.snextc() == EOF);
+        assert(sb.underflow() == EOF);
+        assert(sb.underflow() == EOF);
+        sb.sputc('4');
+        assert(sb.underflow() == '4');
+        assert(sb.underflow() == '4');
+    }
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/types.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/types.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/types.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstreambuf
+//     : public basic_streambuf<char>
+
+#include <strstream>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::streambuf, std::strstreambuf>::value), "");
+}

Added: libcxx/trunk/test/std/depr/depr.str.strstreams/version.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/version.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/version.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/version.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+#include <strstream>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/depr/exception.unexpected/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/exception.unexpected/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/exception.unexpected/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/exception.unexpected/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test get_unexpected
+
+#include <exception>
+#include <cassert>
+#include <cstdlib>
+
+void f1() {}
+void f2() {}
+
+void f3()
+{
+    std::exit(0);
+}
+
+int main()
+{
+    
+    std::unexpected_handler old = std::get_unexpected();
+    // verify there is a previous unexpected handler
+    assert(old);
+    std::set_unexpected(f1);
+    assert(std::get_unexpected() == f1);
+    // verify f1 was replace with f2
+    std::set_unexpected(f2);
+    assert(std::get_unexpected() == f2);
+    // verify calling original unexpected handler calls terminate
+    std::set_terminate(f3);
+    (*old)();
+    assert(0);
+}

Added: libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/exception.unexpected/set.unexpected/set_unexpected.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test set_unexpected
+
+#include <exception>
+#include <cassert>
+#include <cstdlib>
+
+void f1() {}
+void f2() {}
+
+void f3()
+{
+    std::exit(0);
+}
+
+int main()
+{
+    std::unexpected_handler old = std::set_unexpected(f1);
+    // verify there is a previous unexpected handler
+    assert(old);
+    // verify f1 was replace with f2
+    assert(std::set_unexpected(f2) == f1);
+    // verify calling original unexpected handler calls terminate
+    std::set_terminate(f3);
+    (*old)();
+    assert(0);
+}

Added: libcxx/trunk/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test unexpected_handler
+
+#include <exception>
+
+void f() {}
+
+int main()
+{
+    std::unexpected_handler p = f;
+}

Added: libcxx/trunk/test/std/depr/exception.unexpected/unexpected/unexpected.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/exception.unexpected/unexpected/unexpected.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/exception.unexpected/unexpected/unexpected.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/exception.unexpected/unexpected/unexpected.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test unexpected
+
+#include <exception>
+#include <cstdlib>
+#include <cassert>
+
+void f1()
+{
+    std::exit(0);
+}
+
+int main()
+{
+    std::set_unexpected(f1);
+    std::unexpected();
+    assert(false);
+}

Added: libcxx/trunk/test/std/depr/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/depr/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/depr/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/assertions/cassert.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/assertions/cassert.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/assertions/cassert.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/assertions/cassert.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <cassert>
+
+#include <cassert>
+
+#ifndef assert
+#error assert not defined
+#endif
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/diagnostics.general/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/diagnostics.general/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/diagnostics.general/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/diagnostics.general/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/errno/cerrno.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/errno/cerrno.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/errno/cerrno.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/errno/cerrno.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,349 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test <cerrno>
+
+#include <cerrno>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+#ifndef E2BIG
+#error E2BIG not defined
+#endif
+
+#ifndef EACCES
+#error EACCES not defined
+#endif
+
+#ifndef EACCES
+#error EACCES not defined
+#endif
+
+#ifndef EADDRINUSE
+#error EADDRINUSE not defined
+#endif
+
+#ifndef EADDRNOTAVAIL
+#error EADDRNOTAVAIL not defined
+#endif
+
+#ifndef EAFNOSUPPORT
+#error EAFNOSUPPORT not defined
+#endif
+
+#ifndef EAGAIN
+#error EAGAIN not defined
+#endif
+
+#ifndef EALREADY
+#error EALREADY not defined
+#endif
+
+#ifndef EBADF
+#error EBADF not defined
+#endif
+
+#ifndef EBADMSG
+#error EBADMSG not defined
+#endif
+
+#ifndef EBUSY
+#error EBUSY not defined
+#endif
+
+#ifndef ECANCELED
+#error ECANCELED not defined
+#endif
+
+#ifndef ECHILD
+#error ECHILD not defined
+#endif
+
+#ifndef ECONNABORTED
+#error ECONNABORTED not defined
+#endif
+
+#ifndef ECONNREFUSED
+#error ECONNREFUSED not defined
+#endif
+
+#ifndef ECONNRESET
+#error ECONNRESET not defined
+#endif
+
+#ifndef EDEADLK
+#error EDEADLK not defined
+#endif
+
+#ifndef EDESTADDRREQ
+#error EDESTADDRREQ not defined
+#endif
+
+#ifndef EDOM
+#error EDOM not defined
+#endif
+
+#ifndef EEXIST
+#error EEXIST not defined
+#endif
+
+#ifndef EFAULT
+#error EFAULT not defined
+#endif
+
+#ifndef EFBIG
+#error EFBIG not defined
+#endif
+
+#ifndef EHOSTUNREACH
+#error EHOSTUNREACH not defined
+#endif
+
+#ifndef EIDRM
+#error EIDRM not defined
+#endif
+
+#ifndef EILSEQ
+#error EILSEQ not defined
+#endif
+
+#ifndef EINPROGRESS
+#error EINPROGRESS not defined
+#endif
+
+#ifndef EINTR
+#error EINTR not defined
+#endif
+
+#ifndef EINVAL
+#error EINVAL not defined
+#endif
+
+#ifndef EIO
+#error EIO not defined
+#endif
+
+#ifndef EISCONN
+#error EISCONN not defined
+#endif
+
+#ifndef EISDIR
+#error EISDIR not defined
+#endif
+
+#ifndef ELOOP
+#error ELOOP not defined
+#endif
+
+#ifndef EMFILE
+#error EMFILE not defined
+#endif
+
+#ifndef EMLINK
+#error EMLINK not defined
+#endif
+
+#ifndef EMSGSIZE
+#error EMSGSIZE not defined
+#endif
+
+#ifndef ENAMETOOLONG
+#error ENAMETOOLONG not defined
+#endif
+
+#ifndef ENETDOWN
+#error ENETDOWN not defined
+#endif
+
+#ifndef ENETRESET
+#error ENETRESET not defined
+#endif
+
+#ifndef ENETUNREACH
+#error ENETUNREACH not defined
+#endif
+
+#ifndef ENFILE
+#error ENFILE not defined
+#endif
+
+#ifndef ENOBUFS
+#error ENOBUFS not defined
+#endif
+
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+#ifndef ENODATA
+#error ENODATA not defined
+#endif
+#endif
+
+#ifndef ENODEV
+#error ENODEV not defined
+#endif
+
+#ifndef ENOENT
+#error ENOENT not defined
+#endif
+
+#ifndef ENOEXEC
+#error ENOEXEC not defined
+#endif
+
+#ifndef ENOLCK
+#error ENOLCK not defined
+#endif
+
+#ifndef ENOLINK
+#error ENOLINK not defined
+#endif
+
+#ifndef ENOMEM
+#error ENOMEM not defined
+#endif
+
+#ifndef ENOMSG
+#error ENOMSG not defined
+#endif
+
+#ifndef ENOPROTOOPT
+#error ENOPROTOOPT not defined
+#endif
+
+#ifndef ENOSPC
+#error ENOSPC not defined
+#endif
+
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+#ifndef ENOSR
+#error ENOSR not defined
+#endif
+#endif
+
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+#ifndef ENOSTR
+#error ENOSTR not defined
+#endif
+#endif
+
+#ifndef ENOSYS
+#error ENOSYS not defined
+#endif
+
+#ifndef ENOTCONN
+#error ENOTCONN not defined
+#endif
+
+#ifndef ENOTDIR
+#error ENOTDIR not defined
+#endif
+
+#ifndef ENOTEMPTY
+#error ENOTEMPTY not defined
+#endif
+
+#ifndef ENOTRECOVERABLE
+#error ENOTRECOVERABLE not defined
+#endif
+
+#ifndef ENOTSOCK
+#error ENOTSOCK not defined
+#endif
+
+#ifndef ENOTSUP
+#error ENOTSUP not defined
+#endif
+
+#ifndef ENOTTY
+#error ENOTTY not defined
+#endif
+
+#ifndef ENXIO
+#error ENXIO not defined
+#endif
+
+#ifndef EOPNOTSUPP
+#error EOPNOTSUPP not defined
+#endif
+
+#ifndef EOVERFLOW
+#error EOVERFLOW not defined
+#endif
+
+#ifndef EOWNERDEAD
+#error EOWNERDEAD not defined
+#endif
+
+#ifndef EPERM
+#error EPERM not defined
+#endif
+
+#ifndef EPIPE
+#error EPIPE not defined
+#endif
+
+#ifndef EPROTO
+#error EPROTO not defined
+#endif
+
+#ifndef EPROTONOSUPPORT
+#error EPROTONOSUPPORT not defined
+#endif
+
+#ifndef EPROTOTYPE
+#error EPROTOTYPE not defined
+#endif
+
+#ifndef ERANGE
+#error ERANGE not defined
+#endif
+
+#ifndef EROFS
+#error EROFS not defined
+#endif
+
+#ifndef ESPIPE
+#error ESPIPE not defined
+#endif
+
+#ifndef ESRCH
+#error ESRCH not defined
+#endif
+
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+#ifndef ETIME
+#error ETIME not defined
+#endif
+#endif
+
+#ifndef ETIMEDOUT
+#error ETIMEDOUT not defined
+#endif
+
+#ifndef ETXTBSY
+#error ETXTBSY not defined
+#endif
+
+#ifndef EWOULDBLOCK
+#error EWOULDBLOCK not defined
+#endif
+
+#ifndef EXDEV
+#error EXDEV not defined
+#endif
+
+#ifndef errno
+#error errno not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/domain.error/domain_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/domain.error/domain_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/domain.error/domain_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/domain.error/domain_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test domain_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::logic_error, std::domain_error>::value),
+                 "std::is_base_of<std::logic_error, std::domain_error>::value");
+    static_assert(std::is_polymorphic<std::domain_error>::value,
+                 "std::is_polymorphic<std::domain_error>::value");
+    {
+    const char* msg = "domain_error message";
+    std::domain_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::domain_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another domain_error message");
+    std::domain_error e(msg);
+    assert(e.what() == msg);
+    std::domain_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/invalid.argument/invalid_argument.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/invalid.argument/invalid_argument.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/invalid.argument/invalid_argument.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/invalid.argument/invalid_argument.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test invalid_argument
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::logic_error, std::invalid_argument>::value),
+                 "std::is_base_of<std::logic_error, std::invalid_argument>::value");
+    static_assert(std::is_polymorphic<std::invalid_argument>::value,
+                 "std::is_polymorphic<std::invalid_argument>::value");
+    {
+    const char* msg = "invalid_argument message";
+    std::invalid_argument e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::invalid_argument e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another invalid_argument message");
+    std::invalid_argument e(msg);
+    assert(e.what() == msg);
+    std::invalid_argument e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/length.error/length_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/length.error/length_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/length.error/length_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/length.error/length_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test length_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::logic_error, std::length_error>::value),
+                 "std::is_base_of<std::logic_error, std::length_error>::value");
+    static_assert(std::is_polymorphic<std::length_error>::value,
+                 "std::is_polymorphic<std::length_error>::value");
+    {
+    const char* msg = "length_error message";
+    std::length_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::length_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another length_error message");
+    std::length_error e(msg);
+    assert(e.what() == msg);
+    std::length_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/logic.error/logic_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/logic.error/logic_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/logic.error/logic_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/logic.error/logic_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test logic_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::exception, std::logic_error>::value),
+                 "std::is_base_of<std::exception, std::logic_error>::value");
+    static_assert(std::is_polymorphic<std::logic_error>::value,
+                 "std::is_polymorphic<std::logic_error>::value");
+    {
+    const char* msg = "logic_error message";
+    std::logic_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::logic_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another logic_error message");
+    std::logic_error e(msg);
+    assert(e.what() == msg);
+    std::logic_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/out.of.range/out_of_range.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/out.of.range/out_of_range.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/out.of.range/out_of_range.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/out.of.range/out_of_range.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test out_of_range
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::logic_error, std::out_of_range>::value),
+                 "std::is_base_of<std::logic_error, std::out_of_range>::value");
+    static_assert(std::is_polymorphic<std::out_of_range>::value,
+                 "std::is_polymorphic<std::out_of_range>::value");
+    {
+    const char* msg = "out_of_range message";
+    std::out_of_range e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::out_of_range e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another out_of_range message");
+    std::out_of_range e(msg);
+    assert(e.what() == msg);
+    std::out_of_range e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/overflow.error/overflow_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/overflow.error/overflow_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/overflow.error/overflow_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/overflow.error/overflow_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test overflow_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::runtime_error, std::overflow_error>::value),
+                 "std::is_base_of<std::runtime_error, std::overflow_error>::value");
+    static_assert(std::is_polymorphic<std::overflow_error>::value,
+                 "std::is_polymorphic<std::overflow_error>::value");
+    {
+    const char* msg = "overflow_error message";
+    std::overflow_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::overflow_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another overflow_error message");
+    std::overflow_error e(msg);
+    assert(e.what() == msg);
+    std::overflow_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/range.error/range_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/range.error/range_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/range.error/range_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/range.error/range_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test range_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::runtime_error, std::range_error>::value),
+                 "std::is_base_of<std::runtime_error, std::range_error>::value");
+    static_assert(std::is_polymorphic<std::range_error>::value,
+                 "std::is_polymorphic<std::range_error>::value");
+    {
+    const char* msg = "range_error message";
+    std::range_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::range_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another range_error message");
+    std::range_error e(msg);
+    assert(e.what() == msg);
+    std::range_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/runtime.error/runtime_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/runtime.error/runtime_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/runtime.error/runtime_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/runtime.error/runtime_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test runtime_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::exception, std::runtime_error>::value),
+                 "std::is_base_of<std::exception, std::runtime_error>::value");
+    static_assert(std::is_polymorphic<std::runtime_error>::value,
+                 "std::is_polymorphic<std::runtime_error>::value");
+    {
+    const char* msg = "runtime_error message";
+    std::runtime_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::runtime_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another runtime_error message");
+    std::runtime_error e(msg);
+    assert(e.what() == msg);
+    std::runtime_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/underflow.error/underflow_error.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/underflow.error/underflow_error.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/underflow.error/underflow_error.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/underflow.error/underflow_error.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// test underflow_error
+
+#include <stdexcept>
+#include <type_traits>
+#include <cstring>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_base_of<std::runtime_error, std::underflow_error>::value),
+                 "std::is_base_of<std::runtime_error, std::underflow_error>::value");
+    static_assert(std::is_polymorphic<std::underflow_error>::value,
+                 "std::is_polymorphic<std::underflow_error>::value");
+    {
+    const char* msg = "underflow_error message";
+    std::underflow_error e(msg);
+    assert(std::strcmp(e.what(), msg) == 0);
+    std::underflow_error e2(e);
+    assert(std::strcmp(e2.what(), msg) == 0);
+    e2 = e;
+    assert(std::strcmp(e2.what(), msg) == 0);
+    }
+    {
+    std::string msg("another underflow_error message");
+    std::underflow_error e(msg);
+    assert(e.what() == msg);
+    std::underflow_error e2(e);
+    assert(e2.what() == msg);
+    e2 = e;
+    assert(e2.what() == msg);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/std.exceptions/version.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/std.exceptions/version.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/std.exceptions/version.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/std.exceptions/version.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <stdexcept>
+
+#include <stdexcept>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/errc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/errc.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/errc.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/errc.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// enum errc {...}
+
+#include <system_error>
+
+int main()
+{
+    static_assert(static_cast<int>(std::errc::address_family_not_supported) == EAFNOSUPPORT, "");
+    static_assert(static_cast<int>(std::errc::address_in_use) == EADDRINUSE, "");
+    static_assert(static_cast<int>(std::errc::address_not_available) == EADDRNOTAVAIL, "");
+    static_assert(static_cast<int>(std::errc::already_connected) == EISCONN, "");
+    static_assert(static_cast<int>(std::errc::argument_list_too_long) == E2BIG, "");
+    static_assert(static_cast<int>(std::errc::argument_out_of_domain) == EDOM, "");
+    static_assert(static_cast<int>(std::errc::bad_address) == EFAULT, "");
+    static_assert(static_cast<int>(std::errc::bad_file_descriptor) == EBADF, "");
+    static_assert(static_cast<int>(std::errc::bad_message) == EBADMSG, "");
+    static_assert(static_cast<int>(std::errc::broken_pipe) == EPIPE, "");
+    static_assert(static_cast<int>(std::errc::connection_aborted) == ECONNABORTED, "");
+    static_assert(static_cast<int>(std::errc::connection_already_in_progress) == EALREADY, "");
+    static_assert(static_cast<int>(std::errc::connection_refused) == ECONNREFUSED, "");
+    static_assert(static_cast<int>(std::errc::connection_reset) == ECONNRESET, "");
+    static_assert(static_cast<int>(std::errc::cross_device_link) == EXDEV, "");
+    static_assert(static_cast<int>(std::errc::destination_address_required) == EDESTADDRREQ, "");
+    static_assert(static_cast<int>(std::errc::device_or_resource_busy) == EBUSY, "");
+    static_assert(static_cast<int>(std::errc::directory_not_empty) == ENOTEMPTY, "");
+    static_assert(static_cast<int>(std::errc::executable_format_error) == ENOEXEC, "");
+    static_assert(static_cast<int>(std::errc::file_exists) == EEXIST, "");
+    static_assert(static_cast<int>(std::errc::file_too_large) == EFBIG, "");
+    static_assert(static_cast<int>(std::errc::filename_too_long) == ENAMETOOLONG, "");
+    static_assert(static_cast<int>(std::errc::function_not_supported) == ENOSYS, "");
+    static_assert(static_cast<int>(std::errc::host_unreachable) == EHOSTUNREACH, "");
+    static_assert(static_cast<int>(std::errc::identifier_removed) == EIDRM, "");
+    static_assert(static_cast<int>(std::errc::illegal_byte_sequence) == EILSEQ, "");
+    static_assert(static_cast<int>(std::errc::inappropriate_io_control_operation) == ENOTTY, "");
+    static_assert(static_cast<int>(std::errc::interrupted) == EINTR, "");
+    static_assert(static_cast<int>(std::errc::invalid_argument) == EINVAL, "");
+    static_assert(static_cast<int>(std::errc::invalid_seek) == ESPIPE, "");
+    static_assert(static_cast<int>(std::errc::io_error) == EIO, "");
+    static_assert(static_cast<int>(std::errc::is_a_directory) == EISDIR, "");
+    static_assert(static_cast<int>(std::errc::message_size) == EMSGSIZE, "");
+    static_assert(static_cast<int>(std::errc::network_down) == ENETDOWN, "");
+    static_assert(static_cast<int>(std::errc::network_reset) == ENETRESET, "");
+    static_assert(static_cast<int>(std::errc::network_unreachable) == ENETUNREACH, "");
+    static_assert(static_cast<int>(std::errc::no_buffer_space) == ENOBUFS, "");
+    static_assert(static_cast<int>(std::errc::no_child_process) == ECHILD, "");
+    static_assert(static_cast<int>(std::errc::no_link) == ENOLINK, "");
+    static_assert(static_cast<int>(std::errc::no_lock_available) == ENOLCK, "");
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+    static_assert(static_cast<int>(std::errc::no_message_available) == ENODATA, "");
+#endif
+    static_assert(static_cast<int>(std::errc::no_message) == ENOMSG, "");
+    static_assert(static_cast<int>(std::errc::no_protocol_option) == ENOPROTOOPT, "");
+    static_assert(static_cast<int>(std::errc::no_space_on_device) == ENOSPC, "");
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+    static_assert(static_cast<int>(std::errc::no_stream_resources) == ENOSR, "");
+#endif
+    static_assert(static_cast<int>(std::errc::no_such_device_or_address) == ENXIO, "");
+    static_assert(static_cast<int>(std::errc::no_such_device) == ENODEV, "");
+    static_assert(static_cast<int>(std::errc::no_such_file_or_directory) == ENOENT, "");
+    static_assert(static_cast<int>(std::errc::no_such_process) == ESRCH, "");
+    static_assert(static_cast<int>(std::errc::not_a_directory) == ENOTDIR, "");
+    static_assert(static_cast<int>(std::errc::not_a_socket) == ENOTSOCK, "");
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+    static_assert(static_cast<int>(std::errc::not_a_stream) == ENOSTR, "");
+#endif
+    static_assert(static_cast<int>(std::errc::not_connected) == ENOTCONN, "");
+    static_assert(static_cast<int>(std::errc::not_enough_memory) == ENOMEM, "");
+    static_assert(static_cast<int>(std::errc::not_supported) == ENOTSUP, "");
+    static_assert(static_cast<int>(std::errc::operation_canceled) == ECANCELED, "");
+    static_assert(static_cast<int>(std::errc::operation_in_progress) == EINPROGRESS, "");
+    static_assert(static_cast<int>(std::errc::operation_not_permitted) == EPERM, "");
+    static_assert(static_cast<int>(std::errc::operation_not_supported) == EOPNOTSUPP, "");
+    static_assert(static_cast<int>(std::errc::operation_would_block) == EWOULDBLOCK, "");
+    static_assert(static_cast<int>(std::errc::owner_dead) == EOWNERDEAD, "");
+    static_assert(static_cast<int>(std::errc::permission_denied) == EACCES, "");
+    static_assert(static_cast<int>(std::errc::protocol_error) == EPROTO, "");
+    static_assert(static_cast<int>(std::errc::protocol_not_supported) == EPROTONOSUPPORT, "");
+    static_assert(static_cast<int>(std::errc::read_only_file_system) == EROFS, "");
+    static_assert(static_cast<int>(std::errc::resource_deadlock_would_occur) == EDEADLK, "");
+    static_assert(static_cast<int>(std::errc::resource_unavailable_try_again) == EAGAIN, "");
+    static_assert(static_cast<int>(std::errc::result_out_of_range) == ERANGE, "");
+    static_assert(static_cast<int>(std::errc::state_not_recoverable) == ENOTRECOVERABLE, "");
+#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
+    static_assert(static_cast<int>(std::errc::stream_timeout) == ETIME, "");
+#endif
+    static_assert(static_cast<int>(std::errc::text_file_busy) == ETXTBSY, "");
+    static_assert(static_cast<int>(std::errc::timed_out) == ETIMEDOUT, "");
+    static_assert(static_cast<int>(std::errc::too_many_files_open_in_system) == ENFILE, "");
+    static_assert(static_cast<int>(std::errc::too_many_files_open) == EMFILE, "");
+    static_assert(static_cast<int>(std::errc::too_many_links) == EMLINK, "");
+    static_assert(static_cast<int>(std::errc::too_many_symbolic_link_levels) == ELOOP, "");
+    static_assert(static_cast<int>(std::errc::value_too_large) == EOVERFLOW, "");
+    static_assert(static_cast<int>(std::errc::wrong_protocol_type) == EPROTOTYPE, "");
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,106 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// bool operator==(const error_code&      lhs, const error_code&      rhs);
+// bool operator==(const error_code&      lhs, const error_condition& rhs);
+// bool operator==(const error_condition& lhs, const error_code&      rhs);
+// bool operator==(const error_condition& lhs, const error_condition& rhs);
+// bool operator!=(const error_code&      lhs, const error_code&      rhs);
+// bool operator!=(const error_code&      lhs, const error_condition& rhs);
+// bool operator!=(const error_condition& lhs, const error_code&      rhs);
+// bool operator!=(const error_condition& lhs, const error_condition& rhs);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    std::error_code e_code1(5, std::generic_category());
+    std::error_code e_code2(5, std::system_category());
+    std::error_code e_code3(6, std::generic_category());
+    std::error_code e_code4(6, std::system_category());
+    std::error_condition e_condition1(5, std::generic_category());
+    std::error_condition e_condition2(5, std::system_category());
+    std::error_condition e_condition3(6, std::generic_category());
+    std::error_condition e_condition4(6, std::system_category());
+
+    assert(e_code1 == e_code1);
+    assert(e_code1 != e_code2);
+    assert(e_code1 != e_code3);
+    assert(e_code1 != e_code4);
+    assert(e_code1 == e_condition1);
+    assert(e_code1 != e_condition2);
+    assert(e_code1 != e_condition3);
+    assert(e_code1 != e_condition4);
+
+    assert(e_code2 != e_code1);
+    assert(e_code2 == e_code2);
+    assert(e_code2 != e_code3);
+    assert(e_code2 != e_code4);
+    assert(e_code2 == e_condition1);  // ?
+    assert(e_code2 == e_condition2);
+    assert(e_code2 != e_condition3);
+    assert(e_code2 != e_condition4);
+
+    assert(e_code3 != e_code1);
+    assert(e_code3 != e_code2);
+    assert(e_code3 == e_code3);
+    assert(e_code3 != e_code4);
+    assert(e_code3 != e_condition1);
+    assert(e_code3 != e_condition2);
+    assert(e_code3 == e_condition3);
+    assert(e_code3 != e_condition4);
+
+    assert(e_code4 != e_code1);
+    assert(e_code4 != e_code2);
+    assert(e_code4 != e_code3);
+    assert(e_code4 == e_code4);
+    assert(e_code4 != e_condition1);
+    assert(e_code4 != e_condition2);
+    assert(e_code4 == e_condition3);  // ?
+    assert(e_code4 == e_condition4);
+
+    assert(e_condition1 == e_code1);
+    assert(e_condition1 == e_code2);  // ?
+    assert(e_condition1 != e_code3);
+    assert(e_condition1 != e_code4);
+    assert(e_condition1 == e_condition1);
+    assert(e_condition1 != e_condition2);
+    assert(e_condition1 != e_condition3);
+    assert(e_condition1 != e_condition4);
+
+    assert(e_condition2 != e_code1);
+    assert(e_condition2 == e_code2);
+    assert(e_condition2 != e_code3);
+    assert(e_condition2 != e_code4);
+    assert(e_condition2 != e_condition1);
+    assert(e_condition2 == e_condition2);
+    assert(e_condition2 != e_condition3);
+    assert(e_condition2 != e_condition4);
+
+    assert(e_condition3 != e_code1);
+    assert(e_condition3 != e_code2);
+    assert(e_condition3 == e_code3);
+    assert(e_condition3 == e_code4);  // ?
+    assert(e_condition3 != e_condition1);
+    assert(e_condition3 != e_condition2);
+    assert(e_condition3 == e_condition3);
+    assert(e_condition3 != e_condition4);
+
+    assert(e_condition4 != e_code1);
+    assert(e_condition4 != e_code2);
+    assert(e_condition4 != e_code3);
+    assert(e_condition4 == e_code4);
+    assert(e_condition4 != e_condition1);
+    assert(e_condition4 != e_condition2);
+    assert(e_condition4 != e_condition3);
+    assert(e_condition4 == e_condition4);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// virtual string message(int ev) const = 0;
+
+#include <system_error>
+#include <cassert>
+#include <string>
+
+#include <stdio.h>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::generic_category();
+    const std::error_category& e_cat2 = std::system_category();
+    std::string m1 = e_cat1.message(5);
+    std::string m2 = e_cat2.message(5);
+    std::string m3 = e_cat2.message(6);
+    assert(!m1.empty());
+    assert(!m2.empty());
+    assert(!m3.empty());
+    assert(m1 == m2);
+    assert(m1 != m3);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// constexpr error_category() noexcept;
+
+#include <system_error>
+#include <type_traits>
+#include <string>
+#include <cassert>
+
+#if _LIBCPP_STD_VER > 11
+
+class test1
+    : public std::error_category
+{
+public:
+    constexpr test1() = default;  // won't compile if error_category() is not constexpr
+    virtual const char* name() const noexcept {return nullptr;}
+    virtual std::string message(int ev) const {return std::string();}
+};
+
+#endif  // _LIBCPP_STD_VER > 11
+
+int main()
+{
+#if _LIBCPP_STD_VER > 11
+    static_assert(std::is_nothrow_default_constructible<test1>::value,
+                                 "error_category() must exist and be noexcept");
+#endif  // _LIBCPP_STD_VER > 11
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// bool operator==(const error_category& rhs) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::generic_category();
+    const std::error_category& e_cat2 = std::generic_category();
+    const std::error_category& e_cat3 = std::system_category();
+    assert(e_cat1 == e_cat2);
+    assert(!(e_cat1 == e_cat3));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// bool operator<(const error_category& rhs) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::generic_category();
+    const std::error_category& e_cat2 = std::generic_category();
+    const std::error_category& e_cat3 = std::system_category();
+    assert(!(e_cat1 < e_cat2) && !(e_cat2 < e_cat1));
+    assert((e_cat1 < e_cat3) || (e_cat3 < e_cat1));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// bool operator!=(const error_category& rhs) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::generic_category();
+    const std::error_category& e_cat2 = std::generic_category();
+    const std::error_category& e_cat3 = std::system_category();
+    assert(!(e_cat1 != e_cat2));
+    assert(e_cat1 != e_cat3);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// const error_category& generic_category();
+
+#include <system_error>
+#include <cassert>
+#include <string>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::generic_category();
+    std::string m1 = e_cat1.name();
+    assert(m1 == "generic");
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// const error_category& system_category();
+
+#include <system_error>
+#include <cassert>
+#include <string>
+
+int main()
+{
+    const std::error_category& e_cat1 = std::system_category();
+    std::error_condition e_cond = e_cat1.default_error_condition(5);
+    assert(e_cond.value() == 5);
+    assert(e_cond.category() == std::generic_category());
+    e_cond = e_cat1.default_error_condition(5000);
+    assert(e_cond.value() == 5000);
+    assert(e_cond.category() == std::system_category());
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+#include <system_error>
+
+int main()
+{
+    std::error_category* p = 0;
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// virtual error_condition default_error_condition(int ev) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat = std::generic_category();
+    std::error_condition e_cond = e_cat.default_error_condition(static_cast<int>(std::errc::not_a_directory));
+    assert(e_cond.category() == e_cat);
+    assert(e_cond.value() == static_cast<int>(std::errc::not_a_directory));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// virtual bool equivalent(const error_code& code, int condition) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat = std::generic_category();
+    assert(e_cat.equivalent(std::error_code(5, e_cat), 5));
+    assert(!e_cat.equivalent(std::error_code(5, e_cat), 6));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_category
+
+// virtual bool equivalent(int code, const error_condition& condition) const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_category& e_cat = std::generic_category();
+    std::error_condition e_cond = e_cat.default_error_condition(5);
+    assert(e_cat.equivalent(5, e_cond));
+    assert(!e_cat.equivalent(6, e_cond));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// template <ErrorCodeEnum E> error_code(E e);
+
+#include <system_error>
+#include <cassert>
+
+enum testing
+{
+    zero, one, two
+};
+
+namespace std
+{
+
+template <> struct is_error_code_enum<testing> : public std::true_type {};
+
+}
+
+std::error_code
+make_error_code(testing x)
+{
+    return std::error_code(static_cast<int>(x), std::generic_category());
+}
+
+int main()
+{
+    {
+        std::error_code ec(two);
+        assert(ec.value() == 2);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// error_code();
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    std::error_code ec;
+    assert(ec.value() == 0);
+    assert(ec.category() == std::system_category());
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// error_code(int val, const error_category& cat);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_code ec(6, std::system_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::system_category());
+    }
+    {
+        std::error_code ec(8, std::generic_category());
+        assert(ec.value() == 8);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// template <ErrorCodeEnum E> error_code& operator=(E e);
+
+#include <system_error>
+#include <cassert>
+
+enum testing
+{
+    zero, one, two
+};
+
+namespace std
+{
+
+template <> struct is_error_code_enum<testing> : public std::true_type {};
+
+}
+
+std::error_code
+make_error_code(testing x)
+{
+    return std::error_code(static_cast<int>(x), std::generic_category());
+}
+
+int main()
+{
+    {
+        std::error_code ec;
+        ec = two;
+        assert(ec.value() == 2);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// void assign(int val, const error_category& cat);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_code ec;
+        ec.assign(6, std::system_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::system_category());
+    }
+    {
+        std::error_code ec;
+        ec.assign(8, std::generic_category());
+        assert(ec.value() == 8);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// void clear();
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_code ec;
+        ec.assign(6, std::generic_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::generic_category());
+        ec.clear();
+        assert(ec.value() == 0);
+        assert(ec.category() == std::system_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// bool operator<(const error_code& lhs, const error_code& rhs);
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_code ec1(6, std::generic_category());
+        const std::error_code ec2(7, std::generic_category());
+        assert(ec1 < ec2);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// error_code make_error_code(errc e);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_code ec = make_error_code(std::errc::operation_canceled);
+        assert(ec.value() == static_cast<int>(std::errc::operation_canceled));
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// template <class charT, class traits>
+//   basic_ostream<charT,traits>&
+//   operator<<(basic_ostream<charT,traits>& os, const error_code& ec);
+
+#include <system_error>
+#include <sstream>
+#include <cassert>
+
+int main()
+{
+    std::ostringstream out;
+    out << std::error_code(std::io_errc::stream);
+    assert(out.str() == "iostream:1");
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// explicit operator bool() const;
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_code ec(6, std::generic_category());
+        assert(static_cast<bool>(ec));
+    }
+    {
+        const std::error_code ec(0, std::generic_category());
+        assert(!static_cast<bool>(ec));
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// const error_category& category() const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_code ec(6, std::generic_category());
+    assert(ec.category() == std::generic_category());
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// error_condition default_error_condition() const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_code ec(6, std::generic_category());
+        std::error_condition e_cond = ec.default_error_condition();
+        assert(e_cond == ec);
+    }
+    {
+        const std::error_code ec(6, std::system_category());
+        std::error_condition e_cond = ec.default_error_condition();
+        assert(e_cond == ec);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// string message() const;
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    const std::error_code ec(6, std::generic_category());
+    assert(ec.message() == std::generic_category().message(6));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_code
+
+// int value() const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_code ec(6, std::system_category());
+    assert(ec.value() == 6);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// template <ErrorConditionEnum E> error_condition(E e);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_condition ec(std::errc::not_a_directory);
+        assert(ec.value() == static_cast<int>(std::errc::not_a_directory));
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// error_condition();
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    std::error_condition ec;
+    assert(ec.value() == 0);
+    assert(ec.category() == std::generic_category());
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// error_condition(int val, const error_category& cat);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_condition ec(6, std::system_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::system_category());
+    }
+    {
+        std::error_condition ec(8, std::generic_category());
+        assert(ec.value() == 8);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// template <ErrorConditionEnum E> error_condition& operator=(E e);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_condition ec;
+        ec = std::errc::not_enough_memory;
+        assert(ec.value() == static_cast<int>(std::errc::not_enough_memory));
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// void assign(int val, const error_category& cat);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_condition ec;
+        ec.assign(6, std::system_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::system_category());
+    }
+    {
+        std::error_condition ec;
+        ec.assign(8, std::generic_category());
+        assert(ec.value() == 8);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// void clear();
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        std::error_condition ec;
+        ec.assign(6, std::system_category());
+        assert(ec.value() == 6);
+        assert(ec.category() == std::system_category());
+        ec.clear();
+        assert(ec.value() == 0);
+        assert(ec.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// bool operator<(const error_condition& lhs, const error_condition& rhs);
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_condition ec1(6, std::generic_category());
+        const std::error_condition ec2(7, std::generic_category());
+        assert(ec1 < ec2);
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// error_condition make_error_condition(errc e);
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_condition ec1 = std::make_error_condition(std::errc::message_size);
+        assert(ec1.value() == static_cast<int>(std::errc::message_size));
+        assert(ec1.category() == std::generic_category());
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// explicit operator bool() const;
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        const std::error_condition ec(6, std::generic_category());
+        assert(static_cast<bool>(ec));
+    }
+    {
+        const std::error_condition ec(0, std::generic_category());
+        assert(!static_cast<bool>(ec));
+    }
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// const error_category& category() const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_condition ec(6, std::generic_category());
+    assert(ec.category() == std::generic_category());
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// string message() const;
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    const std::error_condition ec(6, std::generic_category());
+    assert(ec.message() == std::generic_category().message(6));
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class error_condition
+
+// int value() const;
+
+#include <system_error>
+#include <cassert>
+
+int main()
+{
+    const std::error_condition ec(6, std::system_category());
+    assert(ec.value() == 6);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class T>
+// struct hash
+//     : public unary_function<T, size_t>
+// {
+//     size_t operator()(T val) const;
+// };
+
+// Not very portable
+
+#include <system_error>
+#include <cassert>
+#include <type_traits>
+
+void
+test(int i)
+{
+    typedef std::error_code T;
+    typedef std::hash<T> H;
+    static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
+                                   H>::value), "");
+    H h;
+    T ec(i, std::system_category());
+    assert(h(ec) == i);
+}
+
+int main()
+{
+    test(0);
+    test(2);
+    test(10);
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp Fri Dec 19 19:40:03 2014
@@ -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()
+{
+}

Added: libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp?rev=224658&view=auto
==============================================================================
--- libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp (added)
+++ libcxx/trunk/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp Fri Dec 19 19:40:03 2014
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <system_error>
+
+// class system_error
+
+// system_error(error_code ec);
+
+// Test is slightly non-portable
+
+#include <system_error>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::system_error se(static_cast<int>(std::errc::not_a_directory),
+                         std::generic_category(), "some text");
+    assert(se.code() == std::make_error_code(std::errc::not_a_directory));
+    std::string what_message(se.what());
+    assert(what_message.find("Not a directory") != std::string::npos);
+}





More information about the cfe-commits mailing list