summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/forward_list
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/23_containers/forward_list
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/forward_list')
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc54
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/capacity/resize_size.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/comparable.cc50
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/1.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/2.cc45
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/3.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/4.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/5.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/6.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/7.cc44
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/8.cc44
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/9.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/cons_size.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/moveable.cc47
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/clear.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after1_neg.cc45
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after2_neg.cc36
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after3_neg.cc36
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after4_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after5_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after6_neg.cc37
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after7_neg.cc37
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after8_neg.cc37
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after9_neg.cc39
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after1_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after2_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after3_neg.cc37
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/move_constructor.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc44
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after1_neg.cc36
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after2_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after3_neg.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after4_neg.cc39
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc79
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/1.cc72
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc154
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/3.cc97
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/4.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/5.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc106
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/2.cc50
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/3.cc47
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/4.cc77
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/5.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/6.cc83
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/7.cc54
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/operations/remove_freed.cc94
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/range_access.cc31
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc27
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc29
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc30
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc34
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/1.cc27
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc28
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/4.cc32
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc25
61 files changed, 2851 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc
new file mode 100644
index 000000000..702acfe34
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc
@@ -0,0 +1,54 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list capacity [lib.forward_list.capacity]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<double> fld;
+ VERIFY(fld.empty() == true);
+
+ fld.push_front(1.0);
+ VERIFY(fld.empty() == false);
+
+ fld.resize(0);
+ VERIFY(fld.empty() == true);
+
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
+ using std::_GLIBCXX_STD_C::_Fwd_list_node;
+#else
+ using std::_Fwd_list_node;
+#endif
+
+ VERIFY( (fld.max_size()
+ == std::allocator<_Fwd_list_node<double> >().max_size()) );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/capacity/resize_size.cc b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/resize_size.cc
new file mode 100644
index 000000000..e22af3cbc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/resize_size.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<__gnu_test::NonCopyConstructible> fl;
+ VERIFY( std::distance(fl.begin(), fl.end()) == 0 );
+
+ fl.resize(1000);
+ VERIFY( std::distance(fl.begin(), fl.end()) == 1000 );
+ for(auto it = fl.begin(); it != fl.end(); ++it)
+ VERIFY( *it == -1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/comparable.cc b/libstdc++-v3/testsuite/23_containers/forward_list/comparable.cc
new file mode 100644
index 000000000..d05461917
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/comparable.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on list (via swap). If the implementation changed
+// this test may begin to fail.
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+int main()
+{
+ std::forward_list<double> a = {0.0, 1.0, 2.0, 3.0, 4.0};
+ std::forward_list<double> b = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
+
+ VERIFY((a == b) == false);
+ VERIFY((a < b) == true);
+ VERIFY((a != b) == true);
+ VERIFY((a > b) == false);
+ VERIFY((a >= b) == false);
+ VERIFY((a <= b) == true);
+
+ VERIFY((b == a) == false);
+ VERIFY((b < a) == false);
+ VERIFY((b != a) == true);
+ VERIFY((b > a) == true);
+ VERIFY((b >= a) == true);
+ VERIFY((b <= a) == false);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/1.cc
new file mode 100644
index 000000000..7dec2a4b4
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/1.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Default construction
+void
+test01()
+{
+ std::forward_list<double> fld;
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/2.cc
new file mode 100644
index 000000000..eb447274b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/2.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Construction from iterator range
+// Copy construction with allocator
+void
+test01()
+{
+ const int ni = 10;
+ int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ std::forward_list<int> flccin(i, i+ni);
+ std::forward_list<int> flcc(flccin, std::allocator<int>());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/3.cc
new file mode 100644
index 000000000..6197731cb
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/3.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Move construction with allocator
+void
+test01()
+{
+ const int ni = 10;
+ int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ std::forward_list<int> flmc(std::forward_list<int>(i, i+ni), std::allocator<int>());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/4.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/4.cc
new file mode 100644
index 000000000..3d23719ca
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/4.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Construction from given number of default item
+void
+test01()
+{
+ std::forward_list<double> flvd(10);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/5.cc
new file mode 100644
index 000000000..ca7b5f7e6
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/5.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Construction from given number of given item
+void
+test01()
+{
+ std::forward_list<float> flv(10, 5.0F);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/6.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/6.cc
new file mode 100644
index 000000000..f385661f2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/6.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Construction from iterator range
+void
+test01()
+{
+ const int ni = 10;
+ int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ std::forward_list<int> fl(i, i+ni);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/7.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/7.cc
new file mode 100644
index 000000000..f03779134
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/7.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Copy construction
+void
+test01()
+{
+ const int ni = 10;
+ int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ std::forward_list<int> fl(i, i+ni);
+ std::forward_list<int> flc(fl);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/8.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/8.cc
new file mode 100644
index 000000000..3cf4288f4
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/8.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// Move construction
+void
+test01()
+{
+ const int ni = 10;
+ int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ std::forward_list<int> fl(i, i+ni);
+ std::forward_list<int> flm(std::move(fl));
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/9.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/9.cc
new file mode 100644
index 000000000..ce7bb8597
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/9.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following.
+// Construction from initializer list
+void
+test01()
+{
+ std::forward_list<double> flil({1.0, 2.0, 3.0, 4.0, 5.0});
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/cons_size.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/cons_size.cc
new file mode 100644
index 000000000..3d07f6720
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/cons_size.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<__gnu_test::NonCopyConstructible> fl(1000);
+ VERIFY( std::distance(fl.begin(), fl.end()) == 1000 );
+ for(auto it = fl.begin(); it != fl.end(); ++it)
+ VERIFY( *it == -1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/moveable.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/moveable.cc
new file mode 100644
index 000000000..e680d3c8e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/moveable.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on list (via swap). If the implementation changed
+// this test may begin to fail.
+
+#include <forward_list>
+#include <utility>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+int main()
+{
+ std::forward_list<int> a, b;
+ a.push_front(1);
+
+ b = std::move(a);
+ VERIFY(b.empty() == false);
+ VERIFY(*b.begin() == 1);
+ VERIFY(a.empty() == true);
+
+ std::forward_list<int> c(std::move(b));
+ VERIFY(c.empty() == false);
+ (*c.begin() == 1 );
+ VERIFY( b.empty() == true );
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/clear.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/clear.cc
new file mode 100644
index 000000000..57e0e2f53
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/clear.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// Check that iterators ownership is correctly manage on swap.
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::forward_list<int> fl{1, 2, 3};
+
+ auto before = fl.before_begin();
+ auto end = fl.end();
+ fl.clear();
+
+ VERIFY( end == fl.end() );
+ VERIFY( before == fl.before_begin() );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after1_neg.cc
new file mode 100644
index 000000000..8f3607619
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after1_neg.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<int> fl1{1, 2, 3};
+
+ auto it = fl1.begin();
+ VERIFY( *it == 1 );
+
+ fl1.erase_after(fl1.before_begin());
+
+ VERIFY( *it == 1 );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after2_neg.cc
new file mode 100644
index 000000000..2efaa74ca
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after2_neg.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ fl1.erase_after(fl1.end());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after3_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after3_neg.cc
new file mode 100644
index 000000000..b17707e61
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after3_neg.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1};
+ fl1.erase_after(fl1.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after4_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after4_neg.cc
new file mode 100644
index 000000000..087abcecd
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after4_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.erase_after(fl1.before_begin(), fl2.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after5_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after5_neg.cc
new file mode 100644
index 000000000..46a74da5f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after5_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.erase_after(fl2.before_begin(), fl2.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after6_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after6_neg.cc
new file mode 100644
index 000000000..a057c9cfa
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after6_neg.cc
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+
+ fl1.erase_after(fl1.before_begin(), fl1.before_begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after7_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after7_neg.cc
new file mode 100644
index 000000000..49a48f74d
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after7_neg.cc
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+
+ fl1.erase_after(fl1.end(), fl1.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after8_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after8_neg.cc
new file mode 100644
index 000000000..a1ff667f5
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after8_neg.cc
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+
+ fl1.erase_after(fl1.begin(), fl1.before_begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after9_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after9_neg.cc
new file mode 100644
index 000000000..3d25787de
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/erase_after9_neg.cc
@@ -0,0 +1,39 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+
+ auto it = fl1.begin();
+ ++it;
+ fl1.erase_after(it, fl1.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after1_neg.cc
new file mode 100644
index 000000000..84d39ae99
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after1_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.insert_after(fl1.before_begin(), fl2.before_begin(), fl2.end());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after2_neg.cc
new file mode 100644
index 000000000..18e1670cc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after2_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{0};
+
+ fl1.insert_after(fl1.before_begin(), fl2.begin(), fl2.before_begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after3_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after3_neg.cc
new file mode 100644
index 000000000..325028c72
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/insert_after3_neg.cc
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+
+ fl1.insert_after(fl1.end(), 4);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/move_constructor.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/move_constructor.cc
new file mode 100644
index 000000000..6238f6f8f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/move_constructor.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// Check that iterators ownership is correctly manage on swap.
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::forward_list<int> fl1{1, 3, 5};
+
+ auto flit = fl1.before_begin();
+ std::forward_list<int> fl2(std::move(fl1));
+
+#if !_GLIBCXX_DEBUG
+ VERIFY( flit == fl1.before_begin() );
+#endif
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc
new file mode 100644
index 000000000..8a7d49f94
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// Check that iterators ownership is correctly manage on swap.
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{4, 5, 6};
+
+ auto before = fl1.before_begin();
+ auto end = fl1.end();
+ fl2.splice_after(fl2.before_begin(), std::move(fl1));
+
+ VERIFY( before == fl1.before_begin() );
+ VERIFY( end == fl1.end() );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after1_neg.cc
new file mode 100644
index 000000000..d0cee48b2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after1_neg.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ fl1.splice_after(fl1.begin(), std::move(fl1));
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after2_neg.cc
new file mode 100644
index 000000000..545562322
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after2_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.splice_after(fl1.before_begin(), std::move(fl2), fl1.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after3_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after3_neg.cc
new file mode 100644
index 000000000..1e63e90a5
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after3_neg.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.splice_after(fl1.before_begin(), std::move(fl2), fl2.end());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after4_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after4_neg.cc
new file mode 100644
index 000000000..9582a8b3e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after4_neg.cc
@@ -0,0 +1,39 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl1{1, 2, 3};
+ std::forward_list<int> fl2{1, 2, 3};
+
+ fl1.splice_after(fl1.before_begin(),
+ std::move(fl2), ++(++fl2.begin()), ++fl2.begin());
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc b/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc
new file mode 100644
index 000000000..85884c0af
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/debug/swap.cc
@@ -0,0 +1,79 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// Check that iterators ownership is correctly manage on swap.
+#include <vector>
+#include <forward_list>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::forward_list<int> fl1{1, 3, 5};
+ std::forward_list<int> fl2{2, 4, 6};
+
+ std::vector<std::forward_list<int>::iterator> fl1_its;
+ fl1_its.push_back(fl1.before_begin());
+ for (std::forward_list<int>::iterator it = fl1.begin();
+ it != fl1.end(); ++it)
+ {
+ fl1_its.push_back(it);
+ }
+ fl1_its.push_back(fl1.end());
+
+ std::vector<std::forward_list<int>::iterator> fl2_its;
+ fl2_its.push_back(fl2.before_begin());
+ for (std::forward_list<int>::iterator it = fl2.begin();
+ it != fl2.end(); ++it)
+ {
+ fl2_its.push_back(it);
+ }
+ fl2_its.push_back(fl2.end());
+
+ fl1.swap(fl2);
+
+ auto fit = fl1.before_begin();
+ // before-begin iterator is not transfered:
+ // TODO: Validate with LWG group how before begin should be
+ // treated.
+ VERIFY( fit == fl1_its[0] );
+ // All other iterators are, even paste-the-end ones:
+ for (size_t i = 1; i != fl2_its.size(); ++i)
+ {
+ VERIFY( ++fit == fl2_its[i] );
+ }
+
+ fit = fl2.before_begin();
+ // TODO: Validate with LWG group how before begin should be
+ // treated.
+ VERIFY( fit == fl2_its[0] );
+ for (size_t i = 1; i != fl1_its.size(); ++i)
+ {
+ VERIFY( ++fit == fl1_its[i] );
+ }
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/1.cc
new file mode 100644
index 000000000..09ad6aa6e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/1.cc
@@ -0,0 +1,72 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+#include <array>
+
+bool test __attribute__((unused)) = true;
+
+class PathPoint
+{
+public:
+ PathPoint(char t, std::array<double, 3> & c)
+ : type(t), coord(c) { }
+ char getType() const { return type; }
+private:
+ char type;
+ std::array<double, 3> coord;
+};
+
+// This test verifies the following.
+// emplace_front
+// pop_front
+// emplace_after
+void
+test01()
+{
+ std::forward_list<PathPoint> path;
+ std::array<double, 3> coord1 = { { 0.0, 1.0, 2.0 } };
+ path.emplace_front('a', coord1);
+
+ std::forward_list<PathPoint>::const_iterator pos = path.cbegin();
+
+ std::array<double, 3> coord2 = { { 3.0, 4.0, 5.0 } };
+ path.emplace_after(pos, 'b', coord2);
+
+ VERIFY(path.front().getType() == 'a');
+
+ path.pop_front();
+
+ VERIFY(path.front().getType() == 'b');
+
+ path.pop_front();
+
+ VERIFY(path.empty() == true);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc
new file mode 100644
index 000000000..b6c6e35eb
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc
@@ -0,0 +1,154 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+#include <string>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// insert_after single item
+// before_begin iterator
+void
+test01()
+{
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::iterator ret = fl.insert_after(fl.before_begin(),
+ 42);
+ VERIFY( ret == fl.begin() );
+ VERIFY( fl.front() == 42 );
+}
+
+// This test verifies the following:
+void
+test02()
+{
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == 1 );
+
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, 0, 42);
+ VERIFY( ret == pos );
+
+ ret = fl.insert_after(pos, 5, 42);
+ VERIFY( *pos == 1 );
+
+ ++pos;
+ VERIFY( *pos == 42 );
+ ++pos;
+ ++pos;
+ ++pos;
+ ++pos;
+ VERIFY( *pos == 42 );
+ VERIFY( ret == pos );
+ ++pos;
+ VERIFY( *pos == 2 );
+}
+
+// This test verifies the following:
+void
+test03()
+{
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == 1 );
+
+ int i[3] = {666, 777, 888};
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, i, i);
+ VERIFY( ret == pos );
+
+ ret = fl.insert_after(pos, i, i + 3);
+ VERIFY( *pos == 1 );
+
+ ++pos;
+ ++pos;
+ ++pos;
+ VERIFY( *pos == 888 );
+ VERIFY( ret == pos );
+ ++pos;
+ VERIFY( *pos == 2 );
+}
+
+// This test verifies the following:
+void
+test04()
+{
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == 1 );
+
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, { });
+ VERIFY( ret == pos);
+
+ ret = fl.insert_after(pos, {-1, -2, -3, -4, -5});
+ VERIFY( *pos == 1);
+
+ ++pos;
+ ++pos;
+ ++pos;
+ VERIFY( *pos == -3 );
+ ++pos;
+ ++pos;
+ VERIFY( ret == pos );
+ ++pos;
+ VERIFY( *pos == 2 );
+}
+
+// This test verifies the following:
+void
+test05()
+{
+ std::forward_list<std::string> fl({"AAA", "BBB", "CCC"});
+
+ std::forward_list<std::string>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == "BBB" );
+
+ std::string x( "XXX" );
+ std::forward_list<std::string>::iterator ret
+ = fl.insert_after(pos, std::move(x));
+ VERIFY( *pos == "BBB" );
+ ++pos;
+ VERIFY( ret == pos );
+ VERIFY( *pos == "XXX" );
+ ++pos;
+ VERIFY( *pos == "CCC" );
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ test05();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/3.cc
new file mode 100644
index 000000000..349be4c2e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/3.cc
@@ -0,0 +1,97 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+// This test verifies the following:
+// cbegin
+// erase_after one iterator
+// pos is useable and points to current element
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == 1 );
+
+ std::forward_list<int>::iterator pos2 = fl.erase_after(pos);
+
+ VERIFY( *pos == 1 );
+ ++pos;
+ VERIFY( *pos == 3 );
+ VERIFY( pos == pos2 );
+}
+
+// This test verifies the following:
+// cbegin
+// erase_after iterator range
+// pos is useable and points to current element
+void
+test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ ++pos;
+ VERIFY( *pos == 1 );
+
+ std::forward_list<int>::iterator stop = fl.begin();
+ ++stop;
+ ++stop;
+ ++stop;
+ ++stop;
+ VERIFY( *stop == 4 );
+
+ std::forward_list<int>::iterator pos2 = fl.erase_after(pos, stop);
+
+ VERIFY( pos2 == stop );
+ VERIFY( *pos == 1 );
+ ++pos;
+ VERIFY( *pos == 4 );
+ VERIFY( std::distance(fl.begin(), fl.end()) == 8 );
+
+ std::forward_list<int>::iterator pos3
+ = fl.erase_after(pos, fl.end());
+ VERIFY( pos3 == fl.end() );
+ VERIFY( ++pos == fl.end() );
+ VERIFY( std::distance(fl.begin(), fl.end()) == 3 );
+
+ std::forward_list<int>::iterator pos4
+ = fl.erase_after(fl.before_begin(), pos);
+ VERIFY( pos4 == pos );
+ VERIFY( std::distance(fl.begin(), fl.end()) == 0 );
+ VERIFY( fl.empty() );
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/4.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/4.cc
new file mode 100644
index 000000000..554ac030d
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/4.cc
@@ -0,0 +1,46 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// swap
+void
+test01()
+{
+ std::forward_list<int> fl1({0, 1, 2, 3, 4, 5});
+ std::forward_list<int> fl2({666, 777, 888});
+
+ fl1.swap(fl2);
+
+ VERIFY(fl1.front() == 666);
+ VERIFY(fl2.front() == 0);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/5.cc
new file mode 100644
index 000000000..26a422665
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/5.cc
@@ -0,0 +1,46 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// clear
+void
+test01()
+{
+ std::forward_list<int> fl({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
+
+ VERIFY(fl.empty() == false);
+
+ fl.clear();
+
+ VERIFY(fl.empty() == true);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc
new file mode 100644
index 000000000..c4794d358
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc
@@ -0,0 +1,106 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+//
+void
+test01()
+{
+ std::forward_list<double> a = {0.0, 1.0, 2.0, 3.0, 4.0};
+ std::forward_list<double>::const_iterator posa = a.cbefore_begin();
+
+ std::forward_list<double> x = {666.0, 777.0, 888.0};
+
+ a.splice_after(posa, std::move(x));
+
+ ++posa;
+ VERIFY(*posa == 666.0);
+
+ VERIFY(x.empty() == true);
+}
+
+// This test verifies the following:
+//
+void
+test02()
+{
+ std::forward_list<double> a = {0.0, 1.0, 2.0, 3.0, 4.0};
+ std::forward_list<double>::const_iterator posa = a.cbefore_begin();
+ ++posa;
+ VERIFY(*posa == 0.0);
+
+ std::forward_list<double> y = {10.0, 11.0, 12.0, 13.0, 14.0, 15.0};
+ std::forward_list<double>::const_iterator befy = y.cbefore_begin();
+ ++befy;
+ VERIFY(*befy == 10.0);
+ std::forward_list<double>::const_iterator endy = befy;
+ ++endy;
+ ++endy;
+ ++endy;
+ ++endy;
+ VERIFY(*endy == 14.0);
+
+ a.splice_after(posa, std::move(y), befy, endy);
+ VERIFY(*posa == 0.0);
+
+ VERIFY(*befy == 10.0);
+ ++befy;
+ VERIFY(*befy == 15.0);
+}
+
+// This test verifies the following:
+//
+void
+test03()
+{
+ std::forward_list<double> a = {0.0, 1.0, 2.0, 3.0, 4.0};
+ std::forward_list<double>::const_iterator posa = a.cbefore_begin();
+ ++posa;
+ ++posa;
+ VERIFY(*posa == 1.0);
+
+ std::forward_list<double> z = {42.0, 43.0, 44.0};
+ std::forward_list<double>::const_iterator posz = z.begin();
+ VERIFY(*posz == 42.0);
+
+ a.splice_after(posa, std::move(z), posz);
+ VERIFY(*posa == 1.0);
+ ++posa;
+ VERIFY(*posa == 43.0);
+
+ VERIFY(*posz == 42.0);
+ ++posz;
+ VERIFY(*posz == 44.0);
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/2.cc
new file mode 100644
index 000000000..fe12af9aa
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/2.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// remove
+void
+test01()
+{
+ std::forward_list<int> fl ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ fl.remove(7);
+
+ std::forward_list<int>::const_iterator pos = fl.cbefore_begin();
+ for (std::size_t i = 0; i < 7; ++i)
+ ++pos;
+ VERIFY(*pos == 6);
+
+ ++pos;
+ VERIFY(*pos == 8);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/3.cc
new file mode 100644
index 000000000..f112bc2d8
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/3.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+#include <algorithm>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// remove_if
+void
+test01()
+{
+ std::forward_list<int> fl ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+ fl.remove_if(std::bind2nd(std::less<int>(),5));
+
+ std::forward_list<int>::const_iterator pos = fl.cbegin();
+ VERIFY(*pos == 5);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/4.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/4.cc
new file mode 100644
index 000000000..6c09065e5
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/4.cc
@@ -0,0 +1,77 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+// unique
+void
+test01()
+{
+ std::forward_list<int> fl = {99, 5, 99, 6, -5, 666, 777, 888,
+ 42, 42, 42, 42, 42, 7, 0, 0, 0, 9, 9, 9};
+
+ fl.unique();
+
+ std::forward_list<int> fl2 = {99, 5, 99, 6, -5, 666, 777, 888, 42, 7, 0, 9};
+ VERIFY(fl == fl2);
+}
+
+// Test comparison predicate.
+template<typename Num>
+ class Mod
+ {
+ public:
+ Mod(const Num & mod)
+ {
+ m = mod;
+ }
+ bool operator()(const Num i, const Num j)
+ {
+ return i%m == j%m;
+ }
+ private:
+ Num m;
+ };
+
+// This test verifies the following:
+// unique with predicate
+void
+test02()
+{
+ std::forward_list<int> fl = {99, 5, 99, 6, -5, 666, 777, 888, 42, 7, 0, 9};
+
+ fl.unique(Mod<int>(111));
+
+ std::forward_list<int> fl2 = {99, 5, 99, 6, -5, 666, 42, 7, 0, 9};
+ VERIFY(fl == fl2);
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/5.cc
new file mode 100644
index 000000000..55d1634c4
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/5.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+//
+void
+test01()
+{
+ std::forward_list<double> a = {0.0, 1.0, 2.0, 3.0, 4.0};
+ std::forward_list<double> b = {1.0, 2.0, 3.0, 4.0, 4.0, 5.0};
+
+ a.merge(std::move(b));
+
+ std::forward_list<double> r = {0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0,
+ 4.0, 4.0, 4.0, 5.0};
+
+ VERIFY(a == r);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/6.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/6.cc
new file mode 100644
index 000000000..082d2adbb
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/6.cc
@@ -0,0 +1,83 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+// Comparison functor.
+template<typename Num>
+ class Comp
+ {
+ public:
+ Comp(const Num & num)
+ {
+ n = num;
+ }
+ bool operator()(const Num i, const Num j)
+ {
+ return (n * i) < (n * j);
+ }
+ private:
+ Num n;
+ };
+
+// This test verifies the following:
+//
+void
+test01()
+{
+ const unsigned int n = 13;
+ int order[][n] = {
+ { 0,1,2,3,4,5,6,7,8,9,10,11,12 },
+ { 6,2,8,4,11,1,12,7,3,9,5,0,10 },
+ { 12,11,10,9,8,7,6,5,4,3,2,1,0 },
+ };
+ std::forward_list<int> sorted(order[0], order[0] + n);
+
+ for (unsigned int i = 0; i < sizeof(order)/sizeof(*order); ++i)
+ {
+ std::forward_list<int> head(order[i], order[i] + n);
+
+ head.sort();
+
+ VERIFY(head == sorted);
+ }
+
+ std::forward_list<int> reversed(order[2], order[2] + n);
+ for (unsigned int i = 0; i < sizeof(order)/sizeof(*order); ++i)
+ {
+ std::forward_list<int> head(order[i], order[i] + n);
+
+ Comp<int> comp(-1);
+ head.sort( comp );
+
+ VERIFY(head == reversed);
+ }
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/7.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/7.cc
new file mode 100644
index 000000000..fd71cb631
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/7.cc
@@ -0,0 +1,54 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+#include <algorithm>
+
+bool test __attribute__((unused)) = true;
+
+// This test verifies the following:
+//
+void
+test01()
+{
+ const unsigned int n = 13;
+ int order[n] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
+
+ std::forward_list<int> fl(order, order + n);
+
+ std::forward_list<int> fl2;
+ for (std::size_t i = 0; i < n; ++i)
+ fl2.push_front(order[i]);
+
+ fl.reverse();
+
+ VERIFY(std::lexicographical_compare(fl.begin(), fl.end(),
+ fl2.begin(), fl2.end()) == false);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/operations/remove_freed.cc b/libstdc++-v3/testsuite/23_containers/forward_list/operations/remove_freed.cc
new file mode 100644
index 000000000..5b9592092
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/operations/remove_freed.cc
@@ -0,0 +1,94 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-08-11 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+// 23.3.3.5 forward_list operations [forwardlist.ops]
+
+// Used to cause many Valgrind errors: LWG 526-type situation.
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::forward_list<int> fl1;
+
+ fl1.push_front(1);
+ fl1.push_front(2);
+ fl1.push_front(3);
+ fl1.push_front(4);
+ fl1.push_front(1);
+
+ fl1.remove(*fl1.begin());
+
+ VERIFY( std::distance(fl1.begin(), fl1.end()) == 3 );
+
+ auto it1 = fl1.begin();
+
+ VERIFY( *it1 == 4 );
+ ++it1;
+ VERIFY( *it1 == 3 );
+ ++it1;
+ VERIFY( *it1 == 2 );
+
+ std::forward_list<int> fl2;
+
+ fl2.push_front(3);
+ fl2.push_front(3);
+ fl2.push_front(3);
+ fl2.push_front(3);
+ fl2.push_front(3);
+
+ auto it2 = fl2.begin();
+ ++it2;
+ ++it2;
+
+ fl2.remove(*it2);
+
+ VERIFY( std::distance(fl2.begin(), fl2.end()) == 0 );
+
+ std::forward_list<int> fl3;
+
+ fl3.push_front(1);
+ fl3.push_front(2);
+ fl3.push_front(3);
+ fl3.push_front(3);
+ fl3.push_front(3);
+
+ auto it3 = fl3.begin();
+ ++it3;
+ ++it3;
+
+ fl3.remove(*it3);
+
+ VERIFY( std::distance(fl3.begin(), fl3.end()) == 2 );
+
+ it3 = fl3.begin();
+ VERIFY( *it3 == 2 );
+ ++it3;
+ VERIFY( *it3 == 1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/range_access.cc b/libstdc++-v3/testsuite/23_containers/forward_list/range_access.cc
new file mode 100644
index 000000000..350b8286c
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/range_access.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 24.6.5, range access [iterator.range]
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int> fl{1, 2, 3};
+ std::begin(fl);
+ std::end(fl);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc
new file mode 100644
index 000000000..86fa26e31
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <testsuite_containers.h>
+
+namespace __gnu_test
+{
+ template<>
+ struct populate<std::forward_list<int>, true>
+ {
+ populate(std::forward_list<int>& container)
+ {
+ container.push_front(1);
+ container.push_front(2);
+ }
+ };
+}
+
+int main()
+{
+ typedef std::forward_list<int> test_type;
+ __gnu_test::citerator<test_type> test;
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
new file mode 100644
index 000000000..e87fa60c3
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1206 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009, 2010 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+struct A
+{
+ explicit A(int) { }
+};
+
+void f()
+{
+ typedef std::forward_list<A> test_type;
+ test_type l;
+ l.assign(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc
new file mode 100644
index 000000000..407d8d169
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void f()
+{
+ typedef std::forward_list<int> test_type;
+ test_type l(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
new file mode 100644
index 000000000..5da159c13
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1206 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+void f()
+{
+ typedef std::forward_list<std::forward_list<int> > test_type;
+ test_type l(10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
new file mode 100644
index 000000000..785fe5136
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1206 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <utility>
+
+void f()
+{
+ typedef std::forward_list<std::forward_list<std::pair<char, char> > > test_type;
+ test_type l('a', 'b');
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
new file mode 100644
index 000000000..aabc8b8f7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-error "no matching" "" { target *-*-* } 1206 }
+// { dg-excess-errors "" }
+
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+
+struct A
+{
+ explicit A(int) { }
+};
+
+void f()
+{
+ typedef std::forward_list<A> test_type;
+ test_type l;
+ l.insert_after(l.begin(), 10, 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc
new file mode 100644
index 000000000..672daf840
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-11-30 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <exception/safety.h>
+
+void
+value()
+{
+ typedef __gnu_cxx::throw_value_limit value_type;
+ typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::forward_list<value_type, allocator_type> test_type;
+ __gnu_test::basic_safety<test_type> test;
+}
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ value();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc
new file mode 100644
index 000000000..7d1764799
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc
@@ -0,0 +1,34 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-09-09 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <exception/safety.h>
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ typedef __gnu_cxx::throw_value_random value_type;
+ typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::forward_list<value_type, allocator_type> test_type;
+ __gnu_test::generation_prohibited<test_type> test;
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc
new file mode 100644
index 000000000..5c426c93c
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc
@@ -0,0 +1,34 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-09-09 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <forward_list>
+#include <exception/safety.h>
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ typedef __gnu_cxx::throw_value_limit value_type;
+ typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::forward_list<value_type, allocator_type> test_type;
+ __gnu_test::propagation_consistent<test_type> test;
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/1.cc
new file mode 100644
index 000000000..d2d89772c
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/1.cc
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <forward_list>
+
+// { dg-do compile }
+
+template class std::forward_list<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc
new file mode 100644
index 000000000..f16650ae9
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <forward_list>
+
+// { dg-do compile }
+
+// libstdc++/21770
+template class std::forward_list<int, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/4.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/4.cc
new file mode 100644
index 000000000..11f15248f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/4.cc
@@ -0,0 +1,32 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <forward_list>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+// { dg-do compile }
+
+// libstdc++/41792
+template class std::forward_list<__gnu_test::OverloadedAddress>;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc
new file mode 100644
index 000000000..3497b09de
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <forward_list>
+
+// Check container for required typedefs.
+__gnu_test::types<std::forward_list<int> > t;