diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp new file mode 100644 index 00000000..68ba20db --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator position) with end() + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list::const_iterator i = l1.end(); + l1.erase(i); + assert(false); +} + +#else + +int main() +{ +} + +#endif diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp new file mode 100644 index 00000000..8026878c --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp @@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator position) with iterator from another container + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list l2(a1, a1+3); + std::list::const_iterator i = l2.begin(); + l1.erase(i); + assert(false); +} + +#else + +int main() +{ +} + +#endif diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp new file mode 100644 index 00000000..d9d901dd --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator first, const_iterator last); with first iterator from another container + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list l2(a1, a1+3); + std::list::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin())); + assert(false); +} + +#else + +int main() +{ +} + +#endif diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp new file mode 100644 index 00000000..dc9a0fea --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator first, const_iterator last); with second iterator from another container + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list l2(a1, a1+3); + std::list::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin())); + assert(false); +} + +#else + +int main() +{ +} + +#endif diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp new file mode 100644 index 00000000..acfc90ec --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator first, const_iterator last); with both iterators from another container + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list l2(a1, a1+3); + std::list::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin())); + assert(false); +} + +#else + +int main() +{ +} + +#endif diff --git a/test/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp new file mode 100644 index 00000000..bf69657b --- /dev/null +++ b/test/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// Call erase(const_iterator first, const_iterator last); with a bad range + +#if _LIBCPP_DEBUG2 >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include +#include +#include +#include + +int main() +{ + int a1[] = {1, 2, 3}; + std::list l1(a1, a1+3); + std::list::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin()); + assert(false); +} + +#else + +int main() +{ +} + +#endif