aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-09-16 16:28:31 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-09-16 16:28:31 +0000
commit71743a68ece25642e8f00467bc2e0ac58fb0b970 (patch)
tree32b1d4298414ff85e9a71edc3abc043770b3148f /libstdc++-v3
parentadb0401dac41c81571722312d4586b2693f95aa6 (diff)
downloadgcc-71743a68ece25642e8f00467bc2e0ac58fb0b970.zip
gcc-71743a68ece25642e8f00467bc2e0ac58fb0b970.tar.gz
gcc-71743a68ece25642e8f00467bc2e0ac58fb0b970.tar.bz2
less_or_equal.cc: New.
2011-09-16 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/23_containers/array/comparison_operators/ less_or_equal.cc: New. * testsuite/23_containers/array/comparison_operators/ greater_or_equal.cc: Likewise. * testsuite/23_containers/array/comparison_operators/less.cc: Likewise. * testsuite/23_containers/array/comparison_operators/equal.cc: Likewise. * testsuite/23_containers/array/comparison_operators/not_equal.cc: Likewise. * testsuite/23_containers/array/comparison_operators/greater.cc: Likewise. * testsuite/23_containers/array/iterators/end_is_one_past.cc: Likewise. * testsuite/23_containers/array/capacity/empty.cc: Likewise. * testsuite/23_containers/array/capacity/max_size.cc: Likewise. * testsuite/23_containers/array/capacity/size.cc: Likewise. * testsuite/23_containers/array/tuple_interface/tuple_element.cc: Likewise. * testsuite/23_containers/array/tuple_interface/tuple_size.cc: Likewise. * testsuite/23_containers/array/element_access/at_out_of_range.cc: Likewise. * testsuite/23_containers/array/element_access/back.cc: Likewise. * testsuite/23_containers/array/element_access/front.cc: Likewise. * testsuite/23_containers/array/element_access/data.cc: Likewise. * testsuite/23_containers/array/cons/aggregate_initialization.cc: Likewise. * testsuite/23_containers/array/requirements/zero_sized_arrays.cc: Likewise. * testsuite/23_containers/array/requirements/contiguous.cc: Likewise. * testsuite/23_containers/array/requirements/member_swap.cc: Likewise. * testsuite/23_containers/array/specialized_algorithms/swap.cc: Likewise. * testsuite/23_containers/array/constexpr_get.cc: Move... * testsuite/23_containers/array/tuple_interface/constexpr_get.cc: ... here. * testsuite/23_containers/array/requirements/get.cc: Move... * testsuite/23_containers/array/tuple_interface/get: ... here. * testsuite/23_containers/array/at_neg.cc: Move... * testsuite/23_containers/array/element_access: ... here. * testsuite/23_containers/array/requirements/constexpr_functions.cc: Move... * testsuite/23_containers/array/capacity: ... here. * testsuite/23_containers/array/requirements/ constexpr_element_access.cc: Move... * testsuite/23_containers/array/element_access: ... here. * testsuite/20_util/duration/cons/1_neg.cc: Avoid -Wall warnings. * testsuite/20_util/tuple/creation_functions/constexpr.cc: Likewise. * testsuite/20_util/pair/make_pair/constexpr.cc: Likewise. * testsuite/20_util/time_point/nonmember/constexpr.cc: Likewise. * testsuite/23_containers/bitset/operations/constexpr.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Discard bogus warning. * testsuite/20_util/forward/1_neg.cc: Likewise. From-SVN: r178911
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog56
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/forward/1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/pair/make_pair/constexpr.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc14
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/capacity/constexpr_functions.cc (renamed from libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc51
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc51
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/capacity/size.cc51
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/equal.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater_or_equal.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/less.cc42
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/less_or_equal.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/comparison_operators/not_equal.cc41
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/cons/aggregate_initialization.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/at_neg.cc (renamed from libstdc++-v3/testsuite/23_containers/array/at_neg.cc)2
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/at_out_of_range.cc54
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/back.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/constexpr_element_access.cc (renamed from libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc)6
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/data.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/element_access/front.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/iterators/end_is_one_past.cc42
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/requirements/contiguous.cc43
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/requirements/member_swap.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/requirements/zero_sized_arrays.cc59
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/constexpr_get.cc (renamed from libstdc++-v3/testsuite/23_containers/array/constexpr_get.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/get.cc (renamed from libstdc++-v3/testsuite/23_containers/array/requirements/get.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc49
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc8
33 files changed, 1052 insertions, 20 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 9b33457..910fafc 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,59 @@
+2011-09-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/23_containers/array/comparison_operators/
+ less_or_equal.cc: New.
+ * testsuite/23_containers/array/comparison_operators/
+ greater_or_equal.cc: Likewise.
+ * testsuite/23_containers/array/comparison_operators/less.cc: Likewise.
+ * testsuite/23_containers/array/comparison_operators/equal.cc: Likewise.
+ * testsuite/23_containers/array/comparison_operators/not_equal.cc:
+ Likewise.
+ * testsuite/23_containers/array/comparison_operators/greater.cc:
+ Likewise.
+ * testsuite/23_containers/array/iterators/end_is_one_past.cc: Likewise.
+ * testsuite/23_containers/array/capacity/empty.cc: Likewise.
+ * testsuite/23_containers/array/capacity/max_size.cc: Likewise.
+ * testsuite/23_containers/array/capacity/size.cc: Likewise.
+ * testsuite/23_containers/array/tuple_interface/tuple_element.cc:
+ Likewise.
+ * testsuite/23_containers/array/tuple_interface/tuple_size.cc:
+ Likewise.
+ * testsuite/23_containers/array/element_access/at_out_of_range.cc:
+ Likewise.
+ * testsuite/23_containers/array/element_access/back.cc: Likewise.
+ * testsuite/23_containers/array/element_access/front.cc: Likewise.
+ * testsuite/23_containers/array/element_access/data.cc: Likewise.
+ * testsuite/23_containers/array/cons/aggregate_initialization.cc:
+ Likewise.
+ * testsuite/23_containers/array/requirements/zero_sized_arrays.cc:
+ Likewise.
+ * testsuite/23_containers/array/requirements/contiguous.cc: Likewise.
+ * testsuite/23_containers/array/requirements/member_swap.cc: Likewise.
+ * testsuite/23_containers/array/specialized_algorithms/swap.cc:
+ Likewise.
+ * testsuite/23_containers/array/constexpr_get.cc: Move...
+ * testsuite/23_containers/array/tuple_interface/constexpr_get.cc:
+ ... here.
+ * testsuite/23_containers/array/requirements/get.cc: Move...
+ * testsuite/23_containers/array/tuple_interface/get: ... here.
+ * testsuite/23_containers/array/at_neg.cc: Move...
+ * testsuite/23_containers/array/element_access: ... here.
+ * testsuite/23_containers/array/requirements/constexpr_functions.cc:
+ Move...
+ * testsuite/23_containers/array/capacity: ... here.
+ * testsuite/23_containers/array/requirements/
+ constexpr_element_access.cc: Move...
+ * testsuite/23_containers/array/element_access: ... here.
+
+ * testsuite/20_util/duration/cons/1_neg.cc: Avoid -Wall warnings.
+ * testsuite/20_util/tuple/creation_functions/constexpr.cc: Likewise.
+ * testsuite/20_util/pair/make_pair/constexpr.cc: Likewise.
+ * testsuite/20_util/time_point/nonmember/constexpr.cc: Likewise.
+ * testsuite/23_containers/bitset/operations/constexpr.cc: Likewise.
+
+ * testsuite/20_util/duration/cons/1_neg.cc: Discard bogus warning.
+ * testsuite/20_util/forward/1_neg.cc: Likewise.
+
2011-09-15 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/tuple (make_tuple, forward_as_tuple): Declare constexpr.
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
index 97f4ef1..b6dd874 100644
--- a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
@@ -2,7 +2,7 @@
// { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2008, 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
@@ -38,3 +38,7 @@ test02()
duration<int, std::milli> d2_copy(d2); // { dg-error "no matching|no type" }
}
+// { dg-prune-output "include" }
+
+// Discard a bogus warning showing up with -Wall.
+// { dg-prune-output "suggest parentheses around" }
diff --git a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
index 7f16bf35..dbcaa66 100644
--- a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
@@ -41,3 +41,5 @@ void g()
std::shared_ptr<A> sp1 = factory<A>(2, 1.414); // { dg-error "required from here" }
}
+// Discard a bogus warning showing up with -Wall.
+// { dg-prune-output "control reaches end of" }
diff --git a/libstdc++-v3/testsuite/20_util/pair/make_pair/constexpr.cc b/libstdc++-v3/testsuite/20_util/pair/make_pair/constexpr.cc
index 4d26f50..749c61b 100644
--- a/libstdc++-v3/testsuite/20_util/pair/make_pair/constexpr.cc
+++ b/libstdc++-v3/testsuite/20_util/pair/make_pair/constexpr.cc
@@ -18,7 +18,6 @@
// 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 pair, and also vector. If the implementation
// changes this test may begin to fail.
@@ -31,7 +30,7 @@ test1()
{
bool test __attribute__((unused)) = true;
typedef std::pair<int, float> pair_type;
- constexpr pair_type p1 = std::make_pair(22, 22.222);
+ constexpr pair_type p1 __attribute__((unused)) = std::make_pair(22, 22.222);
}
int
diff --git a/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc b/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc
index 37b39f4..5c50909 100644
--- a/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc
+++ b/libstdc++-v3/testsuite/20_util/time_point/nonmember/constexpr.cc
@@ -35,11 +35,11 @@ int main()
constexpr duration<int> d0(12);
constexpr duration<int> d1(3);
- constexpr auto r1 = t1 + d0;
- constexpr auto r2 = d1 + t2;
+ constexpr auto r1 __attribute__((unused)) = t1 + d0;
+ constexpr auto r2 __attribute__((unused)) = d1 + t2;
- constexpr auto r3 = t1 - d0;
- constexpr auto r4 = t2 - t3;
+ constexpr auto r3 __attribute__((unused)) = t1 - d0;
+ constexpr auto r4 __attribute__((unused)) = t2 - t3;
return 0;
}
diff --git a/libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc
index dcf6fe7d4..bf2a857 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc
@@ -34,12 +34,14 @@ test_make_tuple()
{
{
typedef std::tuple<int, float> tuple_type;
- constexpr tuple_type p1 = std::make_tuple(22, 22.222);
+ constexpr tuple_type p1 __attribute__((unused))
+ = std::make_tuple(22, 22.222);
}
{
typedef std::tuple<int, float, int> tuple_type;
- constexpr tuple_type p1 = std::make_tuple(22, 22.222, 77799);
+ constexpr tuple_type p1 __attribute__((unused))
+ = std::make_tuple(22, 22.222, 77799);
}
}
@@ -50,13 +52,15 @@ test_get()
{
typedef std::tuple<int, float> tuple_type;
constexpr tuple_type t1 { 55, 77.77 };
- constexpr auto var = std::get<1>(t1);
+ constexpr auto var __attribute__((unused))
+ = std::get<1>(t1);
}
{
typedef std::tuple<int, float, int> tuple_type;
constexpr tuple_type t1 { 55, 77.77, 99 };
- constexpr auto var = std::get<2>(t1);
+ constexpr auto var __attribute__((unused))
+ = std::get<2>(t1);
}
}
@@ -69,7 +73,7 @@ test_tuple_cat()
constexpr tuple_type1 t1 { 55, 77.77 };
constexpr tuple_type2 t2 { 55, 99, 77.77 };
- constexpr auto cat1 = std::tuple_cat(t1, t2);
+ constexpr auto cat1 __attribute__((unused)) = std::tuple_cat(t1, t2);
}
int
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/23_containers/array/capacity/constexpr_functions.cc
index 3dcb296..3dcb296 100644
--- a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/constexpr_functions.cc
diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc b/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
new file mode 100644
index 0000000..534c223
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ VERIFY( a.empty() == false );
+ }
+
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 0;
+ typedef std::array<int, len> array_type;
+ array_type a;
+
+ VERIFY( a.empty() == true );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc b/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
new file mode 100644
index 0000000..a9edb8a
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ VERIFY( a.max_size() == len );
+ }
+
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 0;
+ typedef std::array<int, len> array_type;
+ array_type a;
+
+ VERIFY( a.max_size() == len );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc b/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
new file mode 100644
index 0000000..adfe43b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ VERIFY( a.size() == len );
+ }
+
+ {
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 0;
+ typedef std::array<int, len> array_type;
+ array_type a;
+
+ VERIFY( a.size() == len );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/equal.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/equal.cc
new file mode 100644
index 0000000..2bc4174
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/equal.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3 } };
+
+ VERIFY( a == b );
+ VERIFY( !(a == c) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater.cc
new file mode 100644
index 0000000..dc30102
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3, 7 } };
+
+ VERIFY( !(a > b) );
+ VERIFY( c > a );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater_or_equal.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater_or_equal.cc
new file mode 100644
index 0000000..96a4e42
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/greater_or_equal.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3, 7 } };
+
+ VERIFY( a >= b );
+ VERIFY( c >= a );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less.cc
new file mode 100644
index 0000000..bd64e03
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less.cc
@@ -0,0 +1,42 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2004, 2005, 2006, 2007, 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/>.
+
+#include <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3, 7 } };
+
+ VERIFY( !(a < b) );
+ VERIFY( a < c );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less_or_equal.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less_or_equal.cc
new file mode 100644
index 0000000..2644948
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/less_or_equal.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3, 7 } };
+
+ VERIFY( a <= b );
+ VERIFY( a <= c );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/comparison_operators/not_equal.cc b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/not_equal.cc
new file mode 100644
index 0000000..81d3e0e
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/comparison_operators/not_equal.cc
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ bool test __attribute__((unused)) = true;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3, 4 } };
+ array_type c = { { 0, 1, 2, 3 } };
+
+ VERIFY( !(a != b) );
+ VERIFY( a != c );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/cons/aggregate_initialization.cc b/libstdc++-v3/testsuite/23_containers/array/cons/aggregate_initialization.cc
new file mode 100644
index 0000000..04959dc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/cons/aggregate_initialization.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+//
+// Copyright (C) 2011 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 <array>
+
+void
+test01()
+{
+ typedef std::array<int, 5> array_type;
+
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ array_type b = { { 0, 1, 2, 3 } };
+
+ a = b;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/at_neg.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/at_neg.cc
index 4493952..4b3814f 100644
--- a/libstdc++-v3/testsuite/23_containers/array/at_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/at_neg.cc
@@ -26,6 +26,6 @@ int main()
// exception end up in a terminate handler which eventually exits,
// or abort. (Depending on -fno-exceptions.)
constexpr std::array<int, 3> a{{1, 2, 3}};
- auto i = a.at(4);
+ auto i __attribute__((unused)) = a.at(4);
return 0;
}
diff --git a/libstdc++-v3/testsuite/23_containers/array/element_access/at_out_of_range.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/at_out_of_range.cc
new file mode 100644
index 0000000..4508fe2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/at_out_of_range.cc
@@ -0,0 +1,54 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ try
+ {
+ a.at(len);
+ VERIFY( false );
+ }
+ catch(std::out_of_range& obj)
+ {
+ // Expected.
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ // Failed.
+ VERIFY( false );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/element_access/back.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/back.cc
new file mode 100644
index 0000000..ac916f4
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/back.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+
+ {
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ int& ri = a.back();
+ VERIFY( ri == 4 );
+ }
+
+ {
+ const array_type ca = { { 4, 3, 2, 1, 0 } };
+ const int& cri = ca.back();
+ VERIFY( cri == 0 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/constexpr_element_access.cc
index 23bc104..c2f301a 100644
--- a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_element_access.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/constexpr_element_access.cc
@@ -24,8 +24,8 @@ int main()
{
// array
typedef std::array<std::size_t, 6> array_type;
- constexpr array_type a = { 0, 55, 66, 99, 4115, 2 };
- constexpr auto v1 = a[1];
- constexpr auto v2 = a.at(2);
+ constexpr array_type a = { { 0, 55, 66, 99, 4115, 2 } };
+ constexpr auto v1 __attribute__((unused)) = a[1];
+ constexpr auto v2 __attribute__((unused)) = a.at(2);
return 0;
}
diff --git a/libstdc++-v3/testsuite/23_containers/array/element_access/data.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/data.cc
new file mode 100644
index 0000000..2387b46
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/data.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+
+ {
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ int* pi = a.data();
+ VERIFY( *pi == 0 );
+ }
+
+ {
+ const array_type ca = { { 4, 3, 2, 1, 0 } };
+ const int* pci = ca.data();
+ VERIFY( *pci == 4 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/element_access/front.cc b/libstdc++-v3/testsuite/23_containers/array/element_access/front.cc
new file mode 100644
index 0000000..5b2c022
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/element_access/front.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+
+ {
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ int& ri = a.front();
+ VERIFY( ri == 0 );
+ }
+
+ {
+ const array_type ca = { { 4, 3, 2, 1, 0 } };
+ const int& cri = ca.front();
+ VERIFY( cri == 4 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/iterators/end_is_one_past.cc b/libstdc++-v3/testsuite/23_containers/array/iterators/end_is_one_past.cc
new file mode 100644
index 0000000..fcc482a
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/iterators/end_is_one_past.cc
@@ -0,0 +1,42 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ array_type::iterator b = a.begin();
+ array_type::iterator e = a.end();
+
+ VERIFY( e != (b + a.size() - 1) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/contiguous.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/contiguous.cc
new file mode 100644
index 0000000..b6c970b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/requirements/contiguous.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+ array_type a = { { 0, 1, 2, 3, 4 } };
+
+ // &a[n] == &a[0] + n for all 0 <= n < N.
+ for (size_t i = 0; i < len; ++i)
+ {
+ VERIFY( &a[i] == &a[0] + i );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/member_swap.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/member_swap.cc
new file mode 100644
index 0000000..1f6d0e8
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/requirements/member_swap.cc
@@ -0,0 +1,46 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ const array_type a_ref = a;
+
+ array_type b = { { 4, 3, 2, 1, 0 } };
+ const array_type b_ref = b;
+
+ a.swap(b);
+ VERIFY( a == b_ref );
+ VERIFY( b == a_ref );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/zero_sized_arrays.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/zero_sized_arrays.cc
new file mode 100644
index 0000000..ed29e2a
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/requirements/zero_sized_arrays.cc
@@ -0,0 +1,59 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 0;
+ typedef std::array<int, len> array_type;
+
+ // 1: ?
+ array_type a = { };
+
+ // 2
+ array_type b;
+
+ // 3
+ // begin() == end()
+ VERIFY( a.begin() == a.end() );
+ VERIFY( b.begin() == b.end() );
+
+ // 4: ?
+ // begin() == end() == unique value.
+ {
+ typedef std::array<long, len> array_type1;
+ typedef std::array<char, len> array_type2;
+ array_type1 one;
+ array_type2 two;
+ void* v1 = one.begin();
+ void* v2 = two.begin();
+ VERIFY( v1 != v2 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap.cc b/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap.cc
new file mode 100644
index 0000000..8bf77ee
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap.cc
@@ -0,0 +1,46 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ const size_t len = 5;
+ typedef std::array<int, len> array_type;
+
+ array_type a = { { 0, 1, 2, 3, 4 } };
+ const array_type a_ref = a;
+
+ array_type b = { { 4, 3, 2, 1, 0 } };
+ const array_type b_ref = b;
+
+ std::swap(a, b);
+ VERIFY( a == b_ref );
+ VERIFY( b == a_ref );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/constexpr_get.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/constexpr_get.cc
index 3346ffd..3346ffd 100644
--- a/libstdc++-v3/testsuite/23_containers/array/constexpr_get.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/constexpr_get.cc
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/get.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get.cc
index 1919aad..1919aad 100644
--- a/libstdc++-v3/testsuite/23_containers/array/requirements/get.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get.cc
diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
new file mode 100644
index 0000000..fac21a1
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
@@ -0,0 +1,49 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <type_traits>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ {
+ const size_t len = 3;
+ typedef array<int, len> array_type;
+ VERIFY( (is_same<tuple_element<0, array_type>::type, int>::value == true) );
+ VERIFY( (is_same<tuple_element<1, array_type>::type, int>::value == true) );
+ VERIFY( (is_same<tuple_element<2, array_type>::type, int>::value == true) );
+ }
+
+ {
+ const size_t len = 0;
+ typedef array<int, len> array_type;
+ VERIFY( (is_same<tuple_element<0, array_type>::type, int>::value == true) );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
new file mode 100644
index 0000000..f69dcea
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
@@ -0,0 +1,46 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 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 <array>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ {
+ const size_t len = 5;
+ typedef array<int, len> array_type;
+ VERIFY( tuple_size<array_type>::value == 5 );
+ }
+
+ {
+ const size_t len = 0;
+ typedef array<float, len> array_type;
+ VERIFY( tuple_size<array_type>::value == 0 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc b/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc
index 9f0fa3d..fc171c8 100644
--- a/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc
+++ b/libstdc++-v3/testsuite/23_containers/bitset/operations/constexpr.cc
@@ -26,15 +26,15 @@ int main()
typedef std::_Base_bitset<6> bitset_base;
constexpr bitset_base base = bitset_base();
- constexpr auto r1 = base._M_getword(2);
+ constexpr auto r1 __attribute__((unused)) = base._M_getword(2);
// constexpr auto r2 = base._M_getdata(); // error, pointer to this
- auto r2 = base._M_getdata();
- constexpr auto r3 = base._M_hiword();
+ auto r2 __attribute__((unused)) = base._M_getdata();
+ constexpr auto r3 __attribute__((unused)) = base._M_hiword();
// bitset operators
typedef std::bitset<6> bitset_type;
constexpr bitset_type a = bitset_type();
- constexpr auto v = a[0];
+ constexpr auto v __attribute__((unused)) = a[0];
return 0;
}