#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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 different 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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 different 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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 different 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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;
+}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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 different 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;
+}