[libc++] Split off debug tests that were missed by ce1365f8f7e into test/libcxx
authorLouis Dionne <ldionne@apple.com>
Wed, 14 Oct 2020 14:54:59 +0000 (10:54 -0400)
committerLouis Dionne <ldionne@apple.com>
Wed, 14 Oct 2020 16:02:37 +0000 (12:02 -0400)
Also, some tests had multiple death tests in them, so split them into
separate tests instead. The second death test would obviously never
get run, because the first one would kill the program before.

114 files changed:
libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/db_move.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp [moved from libcxx/test/libcxx/containers/unord/unord.map/unord.map.swap/db_swap_1.pass.cpp with 55% similarity]
libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/db_move.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp [moved from libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.swap/db_swap_1.pass.cpp with 56% similarity]
libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/db_move.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp [moved from libcxx/test/libcxx/containers/unord/unord.multiset/unord.multiset.swap/db_swap_1.pass.cpp with 59% similarity]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp
libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/db_move.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp [moved from libcxx/test/libcxx/containers/unord/unord.set/unord.set.swap/db_swap_1.pass.cpp with 60% similarity]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp
libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp [new file with mode: 0644]
libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
libcxx/test/std/containers/unord/unord.map/max_load_factor.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp
libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
libcxx/test/std/containers/unord/unord.set/bucket_size.pass.cpp
libcxx/test/std/containers/unord/unord.set/max_load_factor.pass.cpp
libcxx/test/std/strings/basic.string/string.access/back.pass.cpp
libcxx/test/std/strings/basic.string/string.access/front.pass.cpp
libcxx/test/std/strings/basic.string/string.access/index.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp

diff --git a/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..31c0b59
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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_map
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    (void) c.bucket_size(3);
+    assert(false);
+
+    return 0;
+}
index fc14f0e..5e6fb25 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        typedef std::unordered_map<int, std::string> C;
-        C c;
-        (void) c.bucket(3);
-        assert(false);
-    }
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    (void) c.bucket(3);
+    assert(false);
 
     return 0;
 }
index 6abe0e7..f73c2ea 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        typedef std::unordered_map<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);
-    }
+int main(int, char**) {
+    typedef std::unordered_map<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);
 
     return 0;
 }
index 09c9ce3..d28a971 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        typedef std::unordered_map<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);
-    }
+int main(int, char**) {
+    typedef std::unordered_map<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);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..9f7432f
--- /dev/null
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c;
+    c.insert(std::make_pair(1, "one"));
+    C::iterator i = c.end();
+    C::value_type j = *i;
+    assert(false);
+
+    return 0;
+}
index 814d8bb..2df35fc 100644 (file)
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
 #include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;
     C c;
     c.insert(std::make_pair(1, "one"));
@@ -36,18 +31,6 @@ int main(int, char**)
     assert(i == c.end());
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
index 2ef8fd6..90d5d8c 100644 (file)
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
 #include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;
     C c;
     c.insert(std::make_pair(1, "one"));
     C::iterator i = c.end();
     C::value_type j = *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.end();
-    C::value_type j = *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..7acdbe1
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c;
+    c.insert(std::make_pair(1, "one"));
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..d1f52f4
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    C::value_type j = *i;
+    assert(false);
+
+    return 0;
+}
index 9902f19..ec53555 100644 (file)
 #include <unordered_map>
 #include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;
     C c(1);
     C::local_iterator i = c.begin(0);
     ++i;
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.begin(0);
-    ++i;
-    ++i;
-    assert(false);
-    }
-#endif
 
+    return 0;
 }
index 8495931..40fe6b2 100644 (file)
 #include <unordered_map>
 #include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;
     C c(1);
     C::local_iterator i = c.end(0);
     C::value_type j = *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    C::value_type j = *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..690d5dd
--- /dev/null
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+
+    return 0;
+}
index 5ccd7aa..6f8a026 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
-        std::unordered_map<int, int>::iterator i = s1.begin();
-        std::pair<const int, int> k = *i;
-        std::unordered_map<int, int> s2 = std::move(s1);
-        assert(*i == k);
-        s2.erase(i);
-        assert(s2.size() == 2);
-    }
+int main(int, char**) {
+    std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+    std::unordered_map<int, int>::iterator i = s1.begin();
+    std::pair<const int, int> k = *i;
+    std::unordered_map<int, int> s2 = std::move(s1);
+    assert(*i == k);
+    s2.erase(i);
+    assert(s2.size() == 2);
 
     return 0;
 }
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
-        std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
-        std::unordered_map<int, int>::iterator i1 = c1.begin();
-        std::unordered_map<int, int>::iterator i2 = c2.begin();
-        swap(c1, c2);
-        c1.erase(i2);
-        c2.erase(i1);
-        std::unordered_map<int, int>::iterator j = i1;
-        c1.erase(i1);
-        assert(false);
-    }
+int main(int, char**) {
+    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_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+    std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+    std::unordered_map<int, int>::iterator i1 = c1.begin();
+    std::unordered_map<int, int>::iterator i2 = c2.begin();
+    swap(c1, c2);
+    c1.erase(i2);
+    c2.erase(i1);
+    std::unordered_map<int, int>::iterator j = i1;
+    c1.erase(i1);
+    assert(false);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..a4d8cff
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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_map
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    c.max_load_factor(0);
+    assert(false);
+
+    return 0;
+}
index df3e838..c3bdf61 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
     std::unordered_map<int, int>::const_iterator i = l1.end();
     l1.erase(i);
     assert(false);
-    }
+
+    return 0;
 }
index 47c7b5c..3028580 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <cstdlib>
-#include <exception>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
@@ -32,5 +29,6 @@ int main(int, char**)
     std::unordered_map<int, int>::const_iterator i = l2.begin();
     l1.erase(i);
     assert(false);
-    }
+
+    return 0;
 }
index 3f7fd66..7ccfe2c 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
     std::unordered_map<int, int> l2(a1, a1+3);
     std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index f2a3b4b..a08572b 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
     std::unordered_map<int, int> l2(a1, a1+3);
     std::unordered_map<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index 7b39a33..727e2c5 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
     std::unordered_map<int, int> l2(a1, a1+3);
     std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index e120deb..49753c5 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_map<int, int> l1(a1, a1+3);
     std::unordered_map<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
     assert(false);
-    }
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp
new file mode 100644 (file)
index 0000000..83da554
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    (void) c.bucket(3);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..9d5a717
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    (void) c.bucket_size(3);
+    assert(false);
+
+    return 0;
+}
index 08c244c..419cd1a 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
index cf3cfec..af00bc2 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..a8346eb
--- /dev/null
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <cassert>
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c;
+    c.insert(std::make_pair(1, "one"));
+    C::iterator i = c.end();
+    C::value_type j = *i;
+    assert(false);
+
+    return 0;
+}
index 1192e1f..52daf9e 100644 (file)
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
 #include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <utility>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;
     C c;
     c.insert(std::make_pair(1, "one"));
@@ -36,18 +31,6 @@ int main(int, char**)
     assert(i == c.end());
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
index 846028d..47791a9 100644 (file)
 #define _LIBCPP_DEBUG 1
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
-#include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
+#include <unordered_map>
+#include <utility>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;
     C c;
     c.insert(std::make_pair(1, "one"));
     C::iterator i = c.end();
     C::value_type j = *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.end();
-    C::value_type j = *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..88a252f
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <cassert>
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c;
+    c.insert(std::make_pair(1, "one"));
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..962f5fc
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    C::value_type j = *i;
+    assert(false);
+
+    return 0;
+}
index c14e171..c68e6b7 100644 (file)
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
 #include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;
     C c(1);
     C::local_iterator i = c.begin(0);
     ++i;
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.begin(0);
-    ++i;
-    ++i;
-    assert(false);
-    }
-#endif
 
+    return 0;
 }
index 46e91db..e9315ae 100644 (file)
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
 
 #include <unordered_map>
-#include <string>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+#include <string>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;
     C c(1);
     C::local_iterator i = c.end(0);
     C::value_type j = *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    C::value_type j = *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..9b148a9
--- /dev/null
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <cassert>
+#include <functional>
+#include <string>
+#include <utility>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                        min_allocator<std::pair<const int, std::string>>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+
+    return 0;
+}
index a4fb6e5..c6cbbc1 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
-        std::unordered_multimap<int, int>::iterator i = s1.begin();
-        std::pair<const int, int> k = *i;
-        std::unordered_multimap<int, int> s2 = std::move(s1);
-        assert(*i == k);
-        s2.erase(i);
-        assert(s2.size() == 2);
-    }
+int main(int, char**) {
+    std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+    std::unordered_multimap<int, int>::iterator i = s1.begin();
+    std::pair<const int, int> k = *i;
+    std::unordered_multimap<int, int> s2 = std::move(s1);
+    assert(*i == k);
+    s2.erase(i);
+    assert(s2.size() == 2);
 
     return 0;
 }
 
 #include <unordered_map>
 #include <cassert>
+#include <utility>
 
 #include "test_macros.h"
 
 int main(int, char**)
 {
-    {
-        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);
-    }
+    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);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..6cc283e
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    c.max_load_factor(0);
+    assert(false);
+
+    return 0;
+}
index 36867de..8f6f2e0 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
     std::unordered_multimap<int, int>::const_iterator i = l1.end();
     l1.erase(i);
     assert(false);
-    }
+
+    return 0;
 }
index 47a3c0d..2341fb4 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <cstdlib>
-#include <exception>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
@@ -32,5 +29,6 @@ int main(int, char**)
     std::unordered_multimap<int, int>::const_iterator i = l2.begin();
     l1.erase(i);
     assert(false);
-    }
+
+    return 0;
 }
index 5e8a6ce..f4498d4 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
     std::unordered_multimap<int, int> l2(a1, a1+3);
     std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index 1865c79..b595a2c 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
     std::unordered_multimap<int, int> l2(a1, a1+3);
     std::unordered_multimap<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index 44c0bef..f9898a3 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
     std::unordered_multimap<int, int> l2(a1, a1+3);
     std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
     assert(false);
-    }
+
+    return 0;
 }
index 1c3dca4..8a32c14 100644 (file)
 
 #include <unordered_map>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
+#include <utility>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
     std::unordered_multimap<int, int> l1(a1, a1+3);
     std::unordered_multimap<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
     assert(false);
-    }
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp
new file mode 100644 (file)
index 0000000..58f95ac
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    (void) c.bucket(3);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..29f3635
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    (void) c.bucket_size(3);
+    assert(false);
+
+    return 0;
+}
index 29bc62e..b3c73ab 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..2a430ed
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.end();
+    (void) *i;
+    assert(false);
+
+    return 0;
+}
index a813c23..6c93b07 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_multiset<T> C;
     C c(1);
@@ -35,17 +29,6 @@ int main(int, char**)
     assert(i == c.end());
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
index 5bdab4d..df00740 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_multiset<T> C;
     C c(1);
     C::iterator i = c.end();
     (void) *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    (void) *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..da33dff
--- /dev/null
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..89dec6d
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    (void) *i;
+    assert(false);
+
+    return 0;
+}
index 4ad003f..9179f09 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_multiset<T> C;
     C c(1);
@@ -34,17 +28,6 @@ int main(int, char**)
     ++i;
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.begin(0);
-    ++i;
-    ++i;
-    assert(false);
-    }
-#endif
 
+    return 0;
 }
index 512912d..2c5983d 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_multiset<T> C;
     C c(1);
     C::local_iterator i = c.end(0);
     (void) *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    (void) *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..e994de2
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+
+    return 0;
+}
index bc72a3b..846338a 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
index 2aa2059..f37aedb 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index fd09b2a..d519ac7 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <cstdlib>
-#include <exception>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index 7b68007..06dc1b4 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index a320245..181f7ed 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index b28abfb..521093e 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index e8234cd..950a8b6 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..3ca44fc
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    c.max_load_factor(0);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp
new file mode 100644 (file)
index 0000000..29d0aae
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    (void) c.bucket(3);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..c12eb2e
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    (void) c.bucket_size(3);
+    assert(false);
+
+    return 0;
+}
index 70b096c..55a5713 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..1622705
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.end();
+    (void) *i;
+    assert(false);
+
+    return 0;
+}
index 90221a7..8b3002f 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_set<T> C;
     C c(1);
@@ -35,17 +29,6 @@ int main(int, char**)
     assert(i == c.end());
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
index 3fb1c86..88eec7f 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_set<T> C;
     C c(1);
     C::iterator i = c.end();
     (void) *i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    (void) *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..eb7474c
--- /dev/null
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    ++i;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp
new file mode 100644 (file)
index 0000000..ab1039d
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.end(0);
+    (void) *i;
+    assert(false);
+
+    return 0;
+}
index f506f42..32471dd 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_set<T> C;
     C c(1);
@@ -34,17 +28,6 @@ int main(int, char**)
     ++i;
     ++i;
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.begin(0);
-    ++i;
-    ++i;
-    assert(false);
-    }
-#endif
 
+    return 0;
 }
index fe998c5..285fc42 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     typedef int T;
     typedef std::unordered_set<T> C;
     C c(1);
     C::local_iterator i = c.end(0);
     (void) *i;
-
     assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    (void) *i;
-    assert(false);
-    }
-#endif
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp
new file mode 100644 (file)
index 0000000..3304866
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    typedef int T;
+    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    C c(1);
+    C::local_iterator i = c.begin(0);
+    ++i;
+    ++i;
+    assert(false);
+
+    return 0;
+}
index 5737270..1128040 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
-        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);
-    }
+int main(int, char**) {
+    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);
 
     return 0;
 }
index 9131483..5f673f1 100644 (file)
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index 3763f01..79385c8 100644 (file)
 #include <unordered_set>
 #include <cassert>
 #include <cstdlib>
-#include <exception>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index 40824dd..556e4b3 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index c492eee..4539741 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index a9e21fc..e4f3a31 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
index 666e9b4..b336db9 100644 (file)
 
 #include <unordered_set>
 #include <cassert>
-#include <exception>
-#include <cstdlib>
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    {
+int main(int, char**) {
     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);
-    }
+
+    return 0;
 }
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..7fd3465
--- /dev/null
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <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);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <unordered_set>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    c.max_load_factor(-0.5f);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp
new file mode 100644 (file)
index 0000000..521584f
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const charT& back() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string const s;
+    (void) s.back();
+    assert(false);
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp
new file mode 100644 (file)
index 0000000..4b675ab
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+//       charT& back();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string s;
+    (void) s.back();
+    assert(false);
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp
new file mode 100644 (file)
index 0000000..b023458
--- /dev/null
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const charT& front() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string const s;
+    (void) s.front();
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp
new file mode 100644 (file)
index 0000000..51f4d82
--- /dev/null
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+//       charT& front();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string s;
+    (void) s.front();
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp
new file mode 100644 (file)
index 0000000..c54902e
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// const_reference operator[](size_type pos) const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string const s;
+    char c = s[0];
+    assert(c == '\0');
+    c = s[1];
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp
new file mode 100644 (file)
index 0000000..3c75a45
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+//       reference operator[](size_type pos);
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::string s;
+    char c = s[0];
+    assert(c == '\0');
+    c = s[1];
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
new file mode 100644 (file)
index 0000000..6812ded
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T& optional<T>::operator*() &;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::optional<int> opt;
+    int x = *opt; (void)x;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
new file mode 100644 (file)
index 0000000..610fceb
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr const T& optional<T>::operator*() const &;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    const std::optional<int> opt;
+    int x = *opt; (void)x;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
new file mode 100644 (file)
index 0000000..d55832c
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() const &&;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+#include <utility>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+    std::optional<int> opt;
+    int x = *std::move(opt); (void)x;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
new file mode 100644 (file)
index 0000000..8d46cf2
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() &&;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+#include <utility>
+
+#include "test_macros.h"
+
+
+int main(int, char**) {
+    std::optional<int> opt;
+    int x = *std::move(opt); (void)x;
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
new file mode 100644 (file)
index 0000000..ee8f2b6
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr T* optional<T>::operator->();
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct X {
+    int test() noexcept {return 3;}
+};
+
+int main(int, char**) {
+    std::optional<X> opt;
+    assert(opt->test() == 3);
+    assert(false);
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
new file mode 100644 (file)
index 0000000..c37a3e9
--- /dev/null
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// <optional>
+
+// constexpr const T* optional<T>::operator->() const;
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <optional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct X {
+    constexpr int test() const {return 3;}
+};
+
+int main(int, char**) {
+    const std::optional<X> opt;
+    assert(opt->test() == 3);
+    assert(false);
+
+    return 0;
+}
index d461601..31adf31 100644 (file)
 
 // 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_map>
 #include <string>
 #include <cassert>
@@ -70,14 +66,6 @@ int main(int, char**)
         LIBCPP_ASSERT(c.bucket_size(4) == 1);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_map<int, std::string> C;
-        C c;
-        (void) c.bucket_size(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 8620dd1..070ba1e 100644 (file)
 // 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_map>
 #include <string>
 #include <cassert>
@@ -57,14 +52,6 @@ int main(int, char**)
         assert(c.max_load_factor() == 2.5);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_map<int, std::string> C;
-        C c;
-        c.max_load_factor(0);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index fc40eb8..981cb33 100644 (file)
 
 // 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_map>
 #include <string>
 #include <cassert>
@@ -66,14 +62,6 @@ int main(int, char**)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_multimap<int, std::string> C;
-        C c;
-        (void) c.bucket(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 64169cf..7e0a947 100644 (file)
 
 // 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_map>
 #include <string>
 #include <cassert>
@@ -74,14 +70,6 @@ int main(int, char**)
         LIBCPP_ASSERT(c.bucket_size(6) == 0);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_multimap<int, std::string> C;
-        C c;
-        (void) c.bucket_size(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 05a964d..ab08808 100644 (file)
 // 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_map>
 #include <string>
 #include <cassert>
@@ -56,14 +52,6 @@ int main(int, char**)
         assert(c.max_load_factor() == 2.5);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_multimap<int, std::string> C;
-        C c;
-        c.max_load_factor(0);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 262a840..5436c1e 100644 (file)
 
 // 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>
 
@@ -65,14 +61,6 @@ int main(int, char**)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_multiset<int> C;
-        C c;
-        (void) c.bucket(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index a64a178..be7a651 100644 (file)
 
 // 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>
 
@@ -73,14 +69,5 @@ int main(int, char**)
         LIBCPP_ASSERT(c.bucket_size(6) == 0);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_multiset<int> C;
-        C c;
-        (void) c.bucket_size(3);
-        assert(false);
-    }
-#endif
-
-  return 0;
+    return 0;
 }
index 566ea42..4d6738b 100644 (file)
 // 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>
 
@@ -55,14 +51,6 @@ int main(int, char**)
         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
 
-  return 0;
+    return 0;
 }
index 4b2cb0d..bcaa77b 100644 (file)
 
 // 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>
 
@@ -64,14 +60,6 @@ int main(int, char**)
             LIBCPP_ASSERT(c.bucket(i) == i % bc);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_set<int> C;
-        C c;
-        (void) c.bucket(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 5cea7fe..1016c49 100644 (file)
 
 // 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>
 
@@ -68,14 +64,6 @@ int main(int, char**)
         LIBCPP_ASSERT(c.bucket_size(4) == 1);
     }
 #endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
-    {
-        typedef std::unordered_set<int> C;
-        C c;
-        (void) c.bucket_size(3);
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index d6f7727..9951956 100644 (file)
 // 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>
 
@@ -55,14 +51,6 @@ int main(int, char**)
         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
 
-  return 0;
+    return 0;
 }
index e2a0c26..783daad 100644 (file)
 // const charT& back() const;
 //       charT& back();
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <string>
 #include <cassert>
 
@@ -50,13 +46,6 @@ int main(int, char**)
     test(S("1234567890123456789012345678901234567890"));
     }
 #endif
-#ifdef _LIBCPP_DEBUG
-    {
-        std::string s;
-        (void) s.back();
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index eaaa678..4cc9f31 100644 (file)
 // const charT& front() const;
 //       charT& front();
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <string>
 #include <cassert>
 
@@ -50,13 +46,6 @@ int main(int, char**)
     test(S("1234567890123456789012345678901234567890"));
     }
 #endif
-#ifdef _LIBCPP_DEBUG
-    {
-        std::string s;
-        (void) s.front();
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 782d92e..8de2583 100644 (file)
 // const_reference operator[](size_type pos) const;
 //       reference operator[](size_type pos);
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <string>
 #include <cassert>
 
@@ -59,15 +55,6 @@ int main(int, char**)
     assert(s2[0] == '\0');
     }
 #endif
-#ifdef _LIBCPP_DEBUG
-    {
-        std::string s;
-        char c = s[0];
-        assert(c == '\0');
-        c = s[1];
-        assert(false);
-    }
-#endif
 
-  return 0;
+    return 0;
 }
index 54c1464..98216df 100644 (file)
 
 // constexpr T& optional<T>::operator*() &;
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -62,13 +58,6 @@ int main(int, char**)
         assert((*opt).test() == 4);
     }
     static_assert(test() == 7, "");
-#ifdef _LIBCPP_DEBUG
-    {
-        optional<X> opt;
-        assert((*opt).test() == 3);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }
index 28fb666..f61cfce 100644 (file)
 
 // constexpr const T& optional<T>::operator*() const &;
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -58,13 +54,6 @@ int main(int, char**)
         constexpr optional<Y> opt(Y{});
         assert((*opt).test() == 2);
     }
-#ifdef _LIBCPP_DEBUG
-    {
-        const optional<X> opt;
-        assert((*opt).test() == 3);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }
index 2439197..bc6745d 100644 (file)
 
 // constexpr T&& optional<T>::operator*() const &&;
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -58,13 +54,6 @@ int main(int, char**)
         constexpr optional<Y> opt(Y{});
         assert((*std::move(opt)).test() == 2);
     }
-#ifdef _LIBCPP_DEBUG
-    {
-        optional<X> opt;
-        assert((*std::move(opt)).test() == 5);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }
index bee0c26..c8ee573 100644 (file)
 
 // constexpr T&& optional<T>::operator*() &&;
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -62,13 +58,6 @@ int main(int, char**)
         assert((*std::move(opt)).test() == 6);
     }
     static_assert(test() == 7, "");
-#ifdef _LIBCPP_DEBUG
-    {
-        optional<X> opt;
-        assert((*std::move(opt)).test() == 3);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }
index 56f4b2a..7cf043f 100644 (file)
 
 // constexpr T* optional<T>::operator->();
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -61,13 +57,6 @@ int main(int, char**)
     {
         static_assert(test() == 3, "");
     }
-#ifdef _LIBCPP_DEBUG
-    {
-        optional<X> opt;
-        assert(opt->test() == 3);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }
index d363453..b9c1fe7 100644 (file)
 
 // constexpr const T* optional<T>::operator->() const;
 
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
 #include <optional>
 #include <type_traits>
 #include <cassert>
@@ -65,13 +61,6 @@ int main(int, char**)
         constexpr optional<Z> opt(Z{});
         static_assert(opt->test() == 1, "");
     }
-#ifdef _LIBCPP_DEBUG
-    {
-        const optional<X> opt;
-        assert(opt->test() == 3);
-        assert(false);
-    }
-#endif  // _LIBCPP_DEBUG
 
-  return 0;
+    return 0;
 }