summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/testsuite/25_algorithms
diff options
context:
space:
mode:
authorfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 19:29:29 +0000
committerfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 19:29:29 +0000
commit4f35afbe281947e2234f43fe1b642fd32ee48afd (patch)
tree20cc48a0922808ae480fbbbb9538bf415ad69ca0 /libstdc++-v3/testsuite/25_algorithms
parent12c17795aa79c9b23f9565d7ca3b42ca6530f6c4 (diff)
downloadppe42-gcc-4f35afbe281947e2234f43fe1b642fd32ee48afd.tar.gz
ppe42-gcc-4f35afbe281947e2234f43fe1b642fd32ee48afd.zip
2012-05-29 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tempbuf.h (__uninitialized_construct_buf) (__uninitialized_construct_buf_dispatch<>::__ucr): Fix to work with iterator returning rvalue. * testsuite/25_algorithms/stable_sort/3.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/25_algorithms')
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/stable_sort/3.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_sort/3.cc b/libstdc++-v3/testsuite/25_algorithms/stable_sort/3.cc
new file mode 100644
index 00000000000..31834d94e95
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/stable_sort/3.cc
@@ -0,0 +1,42 @@
+// Copyright (C) 2012 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/>.
+
+// 25.3.1.2 [lib.stable.sort]
+
+#include <vector>
+#include <algorithm>
+#include <testsuite_hooks.h>
+
+void
+test1()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<bool> bools;
+ bools.push_back(true);
+ bools.push_back(false);
+ bools.push_back(true);
+ bools.push_back(false);
+ std::stable_sort(bools.begin(), bools.end());
+ VERIFY( !bools[0] && !bools[1] && bools[2] && bools[3] );
+}
+
+int
+main()
+{
+ test1();
+}
OpenPOWER on IntegriCloud