From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../containers/sequences/vector/db_index.pass.cpp | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 test/std/containers/sequences/vector/db_index.pass.cpp (limited to 'test/std/containers/sequences/vector/db_index.pass.cpp') diff --git a/test/std/containers/sequences/vector/db_index.pass.cpp b/test/std/containers/sequences/vector/db_index.pass.cpp new file mode 100644 index 0000000000000..1daf076da67c1 --- /dev/null +++ b/test/std/containers/sequences/vector/db_index.pass.cpp @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Index vector out of bounds. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include +#include + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector C; + C c(1); + assert(c[0] == 0); + c.clear(); + assert(c[0] == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector> C; + C c(1); + assert(c[0] == 0); + c.clear(); + assert(c[0] == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif -- cgit v1.2.3