[libcxx-commits] [libcxx] 90248f2 - [libcxx][test] Split off debug mode tests

Kristina Bessonova via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 20 03:00:06 PDT 2021


Author: Kristina Bessonova
Date: 2021-04-20T11:59:36+02:00
New Revision: 90248f2daa05f73cc5d2ca971c187d6d292c63a0

URL: https://github.com/llvm/llvm-project/commit/90248f2daa05f73cc5d2ca971c187d6d292c63a0
DIFF: https://github.com/llvm/llvm-project/commit/90248f2daa05f73cc5d2ca971c187d6d292c63a0.diff

LOG: [libcxx][test] Split off debug mode tests

This continues the work started by @ldionne in 2908eb20ba7.

The debug mode tests from

- libcxx/containers/sequences/vector/
- libcxx/strings/basic.string/string.access/
- libcxx/strings/basic.string/string.iterators/

similarly contain two tests in every file making the second test never
run. The patch splits the tests into separate files.

Reviewed By: Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D100592

Added: 
    libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp

Modified: 
    libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
index 316f5b181e5de..5f5ab3a1d58cc 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    assert(c.back() == 0);
-    c.clear();
-    assert(c.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    assert(c.back() == 0);
-    c.clear();
-    assert(c.back() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  assert(c.back() == 0);
+  c.clear();
+  assert(c.back() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
new file mode 100644
index 0000000000000..1c1656b5dc545
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call back() on empty container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  assert(c.back() == 0);
+  c.clear();
+  assert(c.back() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
index 87335fa7942c8..868ad0a9de686 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
@@ -22,24 +22,13 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    const C c;
-    assert(c.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    const C c;
-    assert(c.back() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  const C c;
+  assert(c.back() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
new file mode 100644
index 0000000000000..9f307b6a151a8
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call back() on empty const container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  const C c;
+  assert(c.back() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
index 7e3a5c4555336..742b02d679f11 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
@@ -22,24 +22,13 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    const C c;
-    assert(c.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    const C c;
-    assert(c.front() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  const C c;
+  assert(c.front() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
new file mode 100644
index 0000000000000..adb223b85533c
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call front() on empty const container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  const C c;
+  assert(c.front() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
index 04ec899814c11..e0d8189b19b9a 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    assert(c.front() == 0);
-    c.clear();
-    assert(c.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    assert(c.front() == 0);
-    c.clear();
-    assert(c.front() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  assert(c.front() == 0);
+  c.clear();
+  assert(c.front() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
new file mode 100644
index 0000000000000..441bd2b50c08b
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call front() on empty container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  assert(c.front() == 0);
+  c.clear();
+  assert(c.front() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
index c3a0003040566..ad4ba72e7d331 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    assert(c[0] == 0);
-    c.clear();
-    assert(c[0] == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    assert(c[0] == 0);
-    c.clear();
-    assert(c[0] == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  assert(c[0] == 0);
+  c.clear();
+  assert(c[0] == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
new file mode 100644
index 0000000000000..551fc1b0733cf
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Index vector out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  assert(c[0] == 0);
+  c.clear();
+  assert(c[0] == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
new file mode 100644
index 0000000000000..c49cd8c34e755
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Subtract iterators from 
diff erent containers.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c1;
+  C c2;
+  int i = c1.begin() - c2.begin();
+  (void)i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
new file mode 100644
index 0000000000000..98d7cecaf60dd
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Index iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  C::iterator i = c.begin();
+  assert(i[0] == 0);
+  assert(i[1] == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
new file mode 100644
index 0000000000000..0cb183f49d728
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Add to iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  C::iterator i = c.begin();
+  i += 1;
+  assert(i == c.end());
+  i = c.begin();
+  i += 2;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
new file mode 100644
index 0000000000000..dddf1776b310d
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Decrement iterator prior to begin.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  C::iterator i = c.end();
+  --i;
+  assert(i == c.begin());
+  --i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
new file mode 100644
index 0000000000000..8b66949666461
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<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/sequences/vector/db_iterators_15.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
new file mode 100644
index 0000000000000..07508dac24d84
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c(1);
+  C::iterator i = c.end();
+  T j = *i;
+  (void)j;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
index 91d7f75fcb196..50fdfbb8f1f9d 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
@@ -22,26 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c1;
-    C c2;
-    bool b = c1.begin() < c2.begin(); (void)b;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c1;
-    C c2;
-    bool b = c1.begin() < c2.begin(); (void)b;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c1;
+  C c2;
+  bool b = c1.begin() < c2.begin();
+  (void)b;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
index 24effa7cef1f6..7577bbc5b8675 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
@@ -22,26 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c1;
-    C c2;
-    int i = c1.begin() - c2.begin(); (void)i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c1;
-    C c2;
-    int i = c1.begin() - c2.begin(); (void)i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c1;
+  C c2;
+  int i = c1.begin() - c2.begin();
+  (void)i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
index 4b89b0b2cde50..b8c9c3faf0020 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    C::iterator i = c.begin();
-    assert(i[0] == 0);
-    assert(i[1] == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    assert(i[0] == 0);
-    assert(i[1] == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  C::iterator i = c.begin();
+  assert(i[0] == 0);
+  assert(i[1] == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
index 33445fd64807a..ad3dcd5657459 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
@@ -22,32 +22,17 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    C::iterator i = c.begin();
-    i += 1;
-    assert(i == c.end());
-    i = c.begin();
-    i += 2;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    i += 1;
-    assert(i == c.end());
-    i = c.begin();
-    i += 2;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  C::iterator i = c.begin();
+  i += 1;
+  assert(i == c.end());
+  i = c.begin();
+  i += 2;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
index faa065ba315e9..94607573443d4 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
@@ -22,30 +22,16 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  C::iterator i = c.end();
+  --i;
+  assert(i == c.begin());
+  --i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
index 3ad9cf0ab1b51..f93fab3ea12e5 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
@@ -22,30 +22,16 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<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/sequences/vector/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
index 2d4bf20180d81..ab4f76cc7a1e3 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
@@ -22,26 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef int T;
-    typedef std::vector<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    T j = *i; (void)j;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef int T;
-    typedef std::vector<T, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    T j = *i; (void)j;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T> C;
+  C c(1);
+  C::iterator i = c.end();
+  T j = *i;
+  (void)j;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
new file mode 100644
index 0000000000000..384fdb25d1f4a
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Compare iterators from 
diff erent containers with <.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <vector>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef int T;
+  typedef std::vector<T, min_allocator<T> > C;
+  C c1;
+  C c2;
+  bool b = c1.begin() < c2.begin();
+  (void)b;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
index 1332657841afb..f5be358a2848f 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
@@ -22,26 +22,14 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    S s(1, '\0');
-    assert(s.back() == 0);
-    s.clear();
-    assert(s.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    S s(1, '\0');
-    assert(s.back() == 0);
-    s.clear();
-    assert(s.back() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  S s(1, '\0');
+  assert(s.back() == 0);
+  s.clear();
+  assert(s.back() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
new file mode 100644
index 0000000000000..a200b21e84ade
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call back() on empty container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  S s(1, '\0');
+  assert(s.back() == 0);
+  s.clear();
+  assert(s.back() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
index 5b8037244536a..3a68ad26d931e 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
@@ -22,22 +22,12 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    const S s;
-    assert(s.back() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    const S s;
-    assert(s.back() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  const S s;
+  assert(s.back() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
new file mode 100644
index 0000000000000..8c3b344742ced
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call back() on empty const container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  const S s;
+  assert(s.back() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
index f646bf4fafe4b..fd6aa9a937d40 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
@@ -22,22 +22,12 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    const S s;
-    assert(s.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    const S s;
-    assert(s.front() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  const S s;
+  assert(s.front() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
new file mode 100644
index 0000000000000..0138e1750b977
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call front() on empty const container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  const S s;
+  assert(s.front() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
index dfe2c5ef13d23..16ac79c4cf086 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
@@ -22,24 +22,13 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    const S s;
-    assert(s[0] == 0);
-    assert(s[1] == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    const S s;
-    assert(s[0] == 0);
-    assert(s[1] == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  const S s;
+  assert(s[0] == 0);
+  assert(s[1] == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
new file mode 100644
index 0000000000000..a8e2dfd065327
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Index const string out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  const S s;
+  assert(s[0] == 0);
+  assert(s[1] == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
index cd47e27ce09f1..9147775effb25 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
@@ -22,26 +22,14 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    S s(1, '\0');
-    assert(s.front() == 0);
-    s.clear();
-    assert(s.front() == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    S s(1, '\0');
-    assert(s.front() == 0);
-    s.clear();
-    assert(s.front() == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  S s(1, '\0');
+  assert(s.front() == 0);
+  s.clear();
+  assert(s.front() == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
new file mode 100644
index 0000000000000..be2232dc0ff19
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call front() on empty container.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  S s(1, '\0');
+  assert(s.front() == 0);
+  s.clear();
+  assert(s.front() == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
index 9b1c79b22442f..b64d901374873 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
@@ -22,24 +22,13 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    S s;
-    assert(s[0] == 0);
-    assert(s[1] == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    S s;
-    assert(s[0] == 0);
-    assert(s[1] == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  S s;
+  assert(s[0] == 0);
+  assert(s[1] == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
new file mode 100644
index 0000000000000..2b64b368b53c2
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Index string out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  S s;
+  assert(s[0] == 0);
+  assert(s[1] == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
new file mode 100644
index 0000000000000..c81631019ad33
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Subtract iterators from 
diff erent containers with <.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  S s1;
+  S s2;
+  int i = s1.begin() - s2.begin();
+  (void)i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
new file mode 100644
index 0000000000000..79eec3c36b700
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Index iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  assert(i[0] == 0);
+  assert(i[1] == 0);
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
new file mode 100644
index 0000000000000..56966edd3cbdc
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Add to iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  i += 1;
+  assert(i == c.end());
+  i = c.begin();
+  i += 2;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
new file mode 100644
index 0000000000000..25f470c8650e1
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Decrement iterator prior to begin.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+  C c(1, '\0');
+  C::iterator i = c.end();
+  --i;
+  assert(i == c.begin());
+  --i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
new file mode 100644
index 0000000000000..77df2ee8c48c5
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  ++i;
+  assert(i == c.end());
+  ++i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
new file mode 100644
index 0000000000000..e6cb93b43d4a6
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+  C c(1, '\0');
+  C::iterator i = c.end();
+  (void)*i;
+  assert(false);
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
index 598eb75f3a0c0..8fcc75053e8f1 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
@@ -22,26 +22,14 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    S s1;
-    S s2;
-    bool b = s1.begin() < s2.begin();
-    (void) b;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    S s1;
-    S s2;
-    bool b = s1.begin() < s2.begin();
-    (void) b;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  S s1;
+  S s2;
+  bool b = s1.begin() < s2.begin();
+  (void)b;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
index 2bdedf8d2a2c3..aad00ff7836a4 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
@@ -22,26 +22,14 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string S;
-    S s1;
-    S s2;
-    int i = s1.begin() - s2.begin();
-    (void) i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
-    S s1;
-    S s2;
-    int i = s1.begin() - s2.begin();
-    (void) i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string S;
+  S s1;
+  S s2;
+  int i = s1.begin() - s2.begin();
+  (void)i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
index 643d9cd7154d8..2fa74544d9d3c 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
@@ -22,26 +22,14 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    assert(i[0] == 0);
-    assert(i[1] == 0);
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    assert(i[0] == 0);
-    assert(i[1] == 0);
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  assert(i[0] == 0);
+  assert(i[1] == 0);
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
index 84daee0f332b2..4a1ed9d66c59d 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
@@ -22,30 +22,16 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    i += 1;
-    assert(i == c.end());
-    i = c.begin();
-    i += 2;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    i += 1;
-    assert(i == c.end());
-    i = c.begin();
-    i += 2;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  i += 1;
+  assert(i == c.end());
+  i = c.begin();
+  i += 2;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
index dfa7e659d51a7..2e2a9b30c499c 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string C;
-    C c(1, '\0');
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> C;
-    C c(1, '\0');
-    C::iterator i = c.end();
-    --i;
-    assert(i == c.begin());
-    --i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string C;
+  C c(1, '\0');
+  C::iterator i = c.end();
+  --i;
+  assert(i == c.begin());
+  --i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
index aad7f7463b4df..678c483f42c4e 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
@@ -22,28 +22,15 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> C;
-    C c(1, '\0');
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    ++i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string C;
+  C c(1, '\0');
+  C::iterator i = c.begin();
+  ++i;
+  assert(i == c.end());
+  ++i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
index 13e344b9bbdd4..e0bc7a441a8c1 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
@@ -22,24 +22,13 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**)
-{
-    {
-    typedef std::string C;
-    C c(1, '\0');
-    C::iterator i = c.end();
-    (void) *i;
-    assert(false);
-    }
-#if TEST_STD_VER >= 11
-    {
-    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> C;
-    C c(1, '\0');
-    C::iterator i = c.end();
-    (void) *i;
-    assert(false);
-    }
-#endif
+
+int main(int, char**) {
+  typedef std::string C;
+  C c(1, '\0');
+  C::iterator i = c.end();
+  (void)*i;
+  assert(false);
+
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
new file mode 100644
index 0000000000000..27d6d35391875
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Compare iterators from 
diff erent containers with <.
+
+// UNSUPPORTED: libcxx-no-debug-mode
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+
+#include <string>
+#include <cassert>
+#include <iterator>
+#include <exception>
+#include <cstdlib>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+  S s1;
+  S s2;
+  bool b = s1.begin() < s2.begin();
+  (void)b;
+  assert(false);
+
+  return 0;
+}


        


More information about the libcxx-commits mailing list