From 4de6f9c38bf9833ca961bd7a7d870d88c38a7d3c Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 24 Dec 2007 16:25:49 +0000 Subject: [PATCH] 2007-12-24 Paolo Carlini * testsuite/20_util/tuple/cons/big_tuples.cc: New. * testsuite/20_util/tuple/cons/constructor.cc: Likewise. * testsuite/20_util/tuple/cons/assignment.cc: Likewise. * testsuite/20_util/tuple/tuple_element.cc: Likewise. * testsuite/20_util/tuple/tuple_size.cc: Likewise. * testsuite/20_util/tuple/comparison_operators/comparisons.cc: Likewise. * testsuite/20_util/tuple/element_access/get.cc: Likewise. * testsuite/20_util/tuple/creation_functions/23978.cc: Likewise. * testsuite/20_util/tuple/creation_functions/tie.cc: Likewise. * testsuite/20_util/tuple/creation_functions/make_tuple.cc: Likewise. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Fix header file and namespace. * testsuite/tr1/6_containers/tuple/cons/big_tuples.cc: Minor tweaks. * testsuite/tr1/6_containers/tuple/cons/constructor.cc: Likewise. * testsuite/tr1/6_containers/tuple/cons/assignment.cc: Likewise. * testsuite/tr1/6_containers/tuple/tuple_element.cc: Likewise. * testsuite/tr1/6_containers/tuple/tuple_size.cc: Likewise. * testsuite/tr1/6_containers/tuple/comparison_operators/ comparisons.cc: Likewise. * testsuite/tr1/6_containers/tuple/element_access/get.cc: Likewise. * testsuite/tr1/6_containers/tuple/creation_functions/tie.cc: Likewise. * testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131159 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 29 ++++++ .../tuple/comparison_operators/comparisons.cc | 50 ++++++++++ .../testsuite/20_util/tuple/cons/assignment.cc | 53 +++++++++++ .../testsuite/20_util/tuple/cons/big_tuples.cc | 105 +++++++++++++++++++++ .../testsuite/20_util/tuple/cons/constructor.cc | 65 +++++++++++++ .../20_util/tuple/creation_functions/23978.cc | 46 +++++++++ .../20_util/tuple/creation_functions/make_tuple.cc | 38 ++++++++ .../20_util/tuple/creation_functions/tie.cc | 43 +++++++++ .../testsuite/20_util/tuple/element_access/get.cc | 45 +++++++++ .../tuple/requirements/explicit_instantiation.cc | 4 +- .../testsuite/20_util/tuple/tuple_element.cc | 38 ++++++++ libstdc++-v3/testsuite/20_util/tuple/tuple_size.cc | 39 ++++++++ .../tuple/comparison_operators/comparisons.cc | 4 +- .../tr1/6_containers/tuple/cons/assignment.cc | 4 +- .../tr1/6_containers/tuple/cons/big_tuples.cc | 4 +- .../tr1/6_containers/tuple/cons/constructor.cc | 4 +- .../tuple/creation_functions/make_tuple.cc | 2 + .../6_containers/tuple/creation_functions/tie.cc | 4 +- .../tr1/6_containers/tuple/element_access/get.cc | 4 +- .../tr1/6_containers/tuple/tuple_element.cc | 4 +- .../testsuite/tr1/6_containers/tuple/tuple_size.cc | 4 +- 21 files changed, 578 insertions(+), 11 deletions(-) create mode 100644 libstdc++-v3/testsuite/20_util/tuple/comparison_operators/comparisons.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/cons/assignment.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/cons/big_tuples.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/cons/constructor.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/creation_functions/23978.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/creation_functions/make_tuple.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/creation_functions/tie.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/element_access/get.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/tuple_element.cc create mode 100644 libstdc++-v3/testsuite/20_util/tuple/tuple_size.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4a342a1..f88476a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,32 @@ +2007-12-24 Paolo Carlini + + * testsuite/20_util/tuple/cons/big_tuples.cc: New. + * testsuite/20_util/tuple/cons/constructor.cc: Likewise. + * testsuite/20_util/tuple/cons/assignment.cc: Likewise. + * testsuite/20_util/tuple/tuple_element.cc: Likewise. + * testsuite/20_util/tuple/tuple_size.cc: Likewise. + * testsuite/20_util/tuple/comparison_operators/comparisons.cc: + Likewise. + * testsuite/20_util/tuple/element_access/get.cc: Likewise. + * testsuite/20_util/tuple/creation_functions/23978.cc: Likewise. + * testsuite/20_util/tuple/creation_functions/tie.cc: Likewise. + * testsuite/20_util/tuple/creation_functions/make_tuple.cc: Likewise. + + * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: + Fix header file and namespace. + + * testsuite/tr1/6_containers/tuple/cons/big_tuples.cc: Minor tweaks. + * testsuite/tr1/6_containers/tuple/cons/constructor.cc: Likewise. + * testsuite/tr1/6_containers/tuple/cons/assignment.cc: Likewise. + * testsuite/tr1/6_containers/tuple/tuple_element.cc: Likewise. + * testsuite/tr1/6_containers/tuple/tuple_size.cc: Likewise. + * testsuite/tr1/6_containers/tuple/comparison_operators/ + comparisons.cc: Likewise. + * testsuite/tr1/6_containers/tuple/element_access/get.cc: Likewise. + * testsuite/tr1/6_containers/tuple/creation_functions/tie.cc: Likewise. + * testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc: + Likewise. + 2007-12-24 Jonathan Wakely * testsuite/tr1/2_general_utilities/shared_ptr/thread/ diff --git a/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/comparisons.cc b/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/comparisons.cc new file mode 100644 index 0000000..847785c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/comparisons.cc @@ -0,0 +1,50 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +bool test __attribute__((unused)) = true; + +#define TEST1(x) VERIFY( x == x && !(x != x) && x <= x && !(x < x) ) + +int +main() +{ + int i=0; + int j=0; + int k=2; + tuple a(0, 0, 0); + tuple b(0, 0, 1); + tuple c(i,j,k); + tuple d(c); + TEST1(a); + TEST1(b); + TEST1(c); + TEST1(d); + VERIFY(!(a > a) && !(b > b)); + VERIFY(a >= a && b >= b); + VERIFY(a < b && !(b < a) && a <= b && !(b <= a)); + VERIFY(b > a && !(a > b) && b >= a && !(a >= b)); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/assignment.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/assignment.cc new file mode 100644 index 0000000..86defac --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/assignment.cc @@ -0,0 +1,53 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + tuple<> ta; + tuple<> tb; + ta = tb; + + tuple tc(1); + tuple td(0); + td = tc; + VERIFY(get<0>(td) == 1); + + int i=0; + tuple te(i); + te = tc; + VERIFY(i == 1); + + tuple tf(tc); + + get<0>(tc) = 2; + VERIFY(get<0>(tf) == 2); + tuple tg; + tg = tc; +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/big_tuples.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/big_tuples.cc new file mode 100644 index 0000000..938e4cb --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/big_tuples.cc @@ -0,0 +1,105 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +// A simple class without conversions to check some things +struct foo +{ }; + +void +test_constructors() +{ + bool test __attribute__((unused)) = true; + + int x1=0,x2=0; + const int &z1=x1; + + // Test empty constructor + tuple<> ta; + tuple tb; + // Test construction from values + tuple tc(x1,x2); + tuple td(x1,x2); + tuple te(z1); + x1=1; + x2=1; + VERIFY(get<0>(td) == 0 && get<1>(td) == 1 && get<0>(te) == 1); + + // Test identical tuple copy constructor + tuple tf(tc); + tuple tg(td); + tuple th(te); + // Test different tuple copy constructor + tuple ti(tc); + tuple tj(td); + // Test constructing from a pair + pair pair1(1,1); + const pair pair2(pair1); + tuple tl(pair1); + tuple tm(pair1); + tuple tn(pair2); + tuple to(pair2); +} + +int +main(void) +{ + //test construction + typedef tuple type1; + type1 a(0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + type1 b(0, 0, 0, 0, 0, 0, 0, 0, 0, 2); + type1 c(a); + typedef tuple type2; + type2 d(0, 0, 0, 0, 0, 0, 0, 0, 0, 3); + type1 e(d); + typedef tuple type3; + // get + VERIFY(get<9>(a)==1 && get<9>(b)==2); + // comparisons + VERIFY(a==a && !(a!=a) && a<=a && a>=a && !(aa)); + VERIFY(!(a==b) && a!=b && a<=b && a=b) && !(a>b)); + //tie + { + int i = 0; + tie(ignore, ignore, ignore, ignore, ignore, ignore, ignore, ignore, + ignore, i) = a; + VERIFY(i == 1); + } + //test_assignment + a=d; + a=b; + //make_tuple + make_tuple(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //tuple_size + VERIFY(tuple_size::value == 10); + //tuple_element + { + foo q1; + tuple_element<0,type3>::type q2(q1); + tuple_element<9,type3>::type q3(q1); + } +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/constructor.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/constructor.cc new file mode 100644 index 0000000..8440413 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/constructor.cc @@ -0,0 +1,65 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int x1=0,x2=0; + const int &z1=x1; + + // Test empty constructor + tuple<> ta; + tuple tb; + // Test construction from values + tuple tc(x1,x2); + tuple td(x1,x2); + tuple te(z1); + x1=1; + x2=1; + VERIFY(get<0>(td) == 0 && get<1>(td) == 1 && get<0>(te) == 1); + + // Test identical tuple copy constructor + tuple tf(tc); + tuple tg(td); + tuple th(te); + // Test different tuple copy constructor + tuple ti(tc); + tuple tj(td); + //tuple tk(tc); + tuple tl(tc); + tuple tm(tl); + // Test constructing from a pair + pair pair1(1,1); + const pair pair2(pair1); + tuple tn(pair1); + tuple to(pair1); + tuple tp(pair2); + tuple tq(pair2); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/creation_functions/23978.cc b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/23978.cc new file mode 100644 index 0000000..edb4aef --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/23978.cc @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include +#include + +using namespace std; + +// libstdc++/23978 +void test01() +{ + bool test __attribute__((unused)) = true; + + pair p(1, 2); + int x = 0; + int y = 0; + tie(x, y) = p; + VERIFY( x == 1 && y == 2 ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/creation_functions/make_tuple.cc b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/make_tuple.cc new file mode 100644 index 0000000..a6eba6d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/make_tuple.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int i=0; + make_tuple(1,2,4.0); + make_tuple(ref(i)) = tuple(1); + VERIFY(i == 1); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/creation_functions/tie.cc b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/tie.cc new file mode 100644 index 0000000..e7f5c05 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/creation_functions/tie.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int x1 = 0; + int x2 = 0; + int y1 = 0; + int y2 = 0; + tuple ta(1,1); + tuple tc(x1,x2); + tie(y1,y2)=ta; + VERIFY(y1 == 1 && y2 == 1); + tie(y1,y2)=tc; + VERIFY(y1 == 0 && y2 == 0); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/element_access/get.cc b/libstdc++-v3/testsuite/20_util/tuple/element_access/get.cc new file mode 100644 index 0000000..32015ee --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/element_access/get.cc @@ -0,0 +1,45 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int j=1; + const int k=2; + tuple a(0,j,k); + const tuple b(1,j,k); + VERIFY(get<0>(a)==0 && get<1>(a)==1 && get<2>(a)==2); + get<0>(a)=3; + get<1>(a)=4; + VERIFY(get<0>(a)==3 && get<1>(a)==4); + VERIFY(j==4); + get<1>(b)=5; + VERIFY(get<0>(b)==1 && get<1>(b)==5 && get<2>(b)==2); + VERIFY(j==5); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/tuple/requirements/explicit_instantiation.cc index 55afcc8..29b886d 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/requirements/explicit_instantiation.cc @@ -28,6 +28,6 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include -template class std::tr1::tuple; +template class std::tuple; diff --git a/libstdc++-v3/testsuite/20_util/tuple/tuple_element.cc b/libstdc++-v3/testsuite/20_util/tuple/tuple_element.cc new file mode 100644 index 0000000..1b78a5c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/tuple_element.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include + +using namespace std; + +struct foo +{ }; + +int +main() +{ + // As foo isn't constructible from anything else, this + // lets us check if type is returning foo when it should + foo q1; + tuple_element<0,tuple >::type q2(q1); + tuple_element<2,tuple >::type q3(q1); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/tuple_size.cc b/libstdc++-v3/testsuite/20_util/tuple/tuple_size.cc new file mode 100644 index 0000000..f5f398c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/tuple_size.cc @@ -0,0 +1,39 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// Tuple + +#include +#include + +using namespace std; + +int +main() +{ + bool test __attribute__((unused)) = true; + + VERIFY(tuple_size >::value == 0); + VERIFY(tuple_size >::value == 1); + VERIFY(tuple_size >::value == 1); + typedef tuple test_tuple1; + VERIFY(tuple_size::value == 3); + VERIFY(tuple_size > >::value == 1); +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc index f22d975..7eee7a8 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -25,6 +25,8 @@ using namespace std::tr1; +bool test __attribute__((unused)) = true; + #define TEST1(x) VERIFY( x == x && !(x != x) && x <= x && !(x < x) ) int diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc index 6207b41..973b5f0 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -28,6 +28,8 @@ using namespace std::tr1; int main() { + bool test __attribute__((unused)) = true; + tuple<> ta; tuple<> tb; ta = tb; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc index a23ad8d..2af47e5 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -33,6 +33,8 @@ struct foo void test_constructors() { + bool test __attribute__((unused)) = true; + int x1=0,x2=0; const int &z1=x1; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc index 89e9a11..de34ba4 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -29,6 +29,8 @@ using std::pair; int main() { + bool test __attribute__((unused)) = true; + int x1=0,x2=0; const int &z1=x1; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc index ca69be2..9a0fc6f 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc @@ -29,6 +29,8 @@ using namespace std::tr1; int main() { + bool test __attribute__((unused)) = true; + int i=0; make_tuple(1,2,4.0); make_tuple(ref(i)) = tuple(1); diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc index ea63a5d..d8389be 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -28,6 +28,8 @@ using namespace std::tr1; int main() { + bool test __attribute__((unused)) = true; + int x1 = 0; int x2 = 0; int y1 = 0; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc index 85ec6cb..5cfda14 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -28,6 +28,8 @@ using namespace std::tr1; int main() { + bool test __attribute__((unused)) = true; + int j=1; const int k=2; tuple a(0,j,k); diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc index 44a9317..6178e56 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -31,7 +31,7 @@ struct foo int main() { - // As foo isn't constructable from anything else, this + // As foo isn't constructible from anything else, this // lets us check if type is returning foo when it should foo q1; tuple_element<0,tuple >::type q2(q1); diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc index 967cb43..7338937 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc @@ -1,6 +1,6 @@ // 2004-09-23 Chris Jefferson -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -28,6 +28,8 @@ using namespace std::tr1; int main() { + bool test __attribute__((unused)) = true; + VERIFY(tuple_size >::value == 0); VERIFY(tuple_size >::value == 1); VERIFY(tuple_size >::value == 1); -- 2.7.4