From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; 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. --- .../tr1/6_containers/array/requirements/assign.cc | 46 ++++++++++++++++ .../6_containers/array/requirements/contiguous.cc | 46 ++++++++++++++++ .../array/requirements/explicit_instantiation.cc | 27 ++++++++++ .../6_containers/array/requirements/member_swap.cc | 48 +++++++++++++++++ .../6_containers/array/requirements/typedefs.cc | 40 ++++++++++++++ .../array/requirements/zero_sized_arrays.cc | 61 ++++++++++++++++++++++ 6 files changed, 268 insertions(+) create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc (limited to 'libstdc++-v3/testsuite/tr1/6_containers/array/requirements') diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc new file mode 100644 index 000000000..5925cc796 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc @@ -0,0 +1,46 @@ +// 2006-02-24 Paolo Carlini +// +// Copyright (C) 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 +// . + +// 6.2.2 Class template array + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 3; + typedef std::tr1::array array_type; + + array_type a = { { 0, 1, 2 } }; + const int value = 5; + + a.assign(value); + VERIFY( a[0] == value ); + VERIFY( a[1] == value ); + VERIFY( a[2] == value ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc new file mode 100644 index 000000000..e22b96cbe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc @@ -0,0 +1,46 @@ +// 2004-10-20 Benjamin Kosnik +// +// 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 +// . + +// 6.2.2 Class template array + +#include +#include + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array array_type; + bool test __attribute__((unused)) = true; + 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/tr1/6_containers/array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0074de7cb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc @@ -0,0 +1,27 @@ +// { dg-do compile } + +// 2004-10-20 Benjamin Kosnik +// +// Copyright (C) 2004, 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 +// . + + +// 6.2.2 Class template array + +#include + +template class std::tr1::array; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc new file mode 100644 index 000000000..ea663bf71 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc @@ -0,0 +1,48 @@ +// 2006-02-24 Paolo Carlini +// +// Copyright (C) 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 +// . + +// 6.2.2 Class template array + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array 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/tr1/6_containers/array/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc new file mode 100644 index 000000000..9f616ee75 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc @@ -0,0 +1,40 @@ +// { dg-do compile } + +// 2004-10-20 Benjamin Kosnik +// +// Copyright (C) 2004, 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 +// . + + +// 6.2.2 Class template array + +#include + +void test01() +{ + // Check for required typedefs + typedef std::tr1::array test_type; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::value_type value_type; + typedef test_type::reverse_iterator reverse_iterator; + typedef test_type::const_reverse_iterator const_reverse_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc new file mode 100644 index 000000000..1ea4f8aee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc @@ -0,0 +1,61 @@ +// 2004-10-20 Benjamin Kosnik +// +// Copyright (C) 2004, 2005, 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 +// . + +// 6.2.2.4 Zero sized arrays + +#include +#include + +void +test01() +{ + const size_t len = 0; + typedef std::tr1::array array_type; + bool test __attribute__((unused)) = true; + + // 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::tr1::array array_type1; + typedef std::tr1::array array_type2; + array_type1 one; + array_type2 two; + void* v1 = one.begin(); + void* v2 = two.begin(); + VERIFY( v1 != v2 ); + } +} + +int main() +{ + test01(); + return 0; +} + -- cgit v1.2.3