diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2008-03-16 17:13:04 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-03-16 17:13:04 +0000 |
commit | 5ae8cf8c41d66578dab190e910a8b1c951eb615a (patch) | |
tree | 16dd08f7b64f9ca7e023c3f9e3ad1bceaddae04b /libstdc++-v3/testsuite | |
parent | fcb9237b9cc863b563f4b82e04611c98a77dbb67 (diff) | |
download | gcc-5ae8cf8c41d66578dab190e910a8b1c951eb615a.tar.gz |
[multiple changes]
2008-03-16 Paolo Carlini <pcarlini@suse.de>
* testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc:
Update.
* testsuite/17_intro/headers/c++200x/all.cc: Likewise.
* include/precompiled/stdc++.h: Likewise.
2008-03-16 Pedro LamarĂ£o <pedro.lamarao@gmail.com>
* include/std/date_time: New file.
* src/date_time.cc: New file.
* config/abi/pre/gnu.ver: Added <date_time> symbols in version
GLIBCXX_3.4.11 and changed two patterns in version GLIBCXX_3.4
that matched new symbols.
* include/Makefile.am: Add date_time in std headers.
* src/Makefile.am: Add date_time.cc to source files.
* include/Makefile.in: Regenerate.
* src/Makefile.in: Likewise.
2008-03-16 Pedro LamarĂ£o <pedro.lamarao@gmail.com>
* testsuite/31_date_time/headers/date_time/types_std.cc: New.
* testsuite/31_date_time/headers/date_time/std_c++0x_neg.cc: Likewise.
* testsuite/31_date_time/headers/date_time/functions_std.cc: Likewise.
* testsuite/31_date_time/headers/date_time/synopsis.cc: Likewise.
* testsuite/31_date_time/nanoseconds/requirements/traits.cc: Likewise.
* testsuite/31_date_time/nanoseconds/requirements/duration.cc: Likewise.
* testsuite/31_date_time/system_time/requirements: Likewise.
* testsuite/31_date_time/system_time/requirements/traits.cc: Likewise.
2008-03-16 Paolo Carlini <pcarlini@suse.de>
* config.h.in: Regenerate.
From-SVN: r133276
Diffstat (limited to 'libstdc++-v3/testsuite')
9 files changed, 275 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc index f1ed7cf38b5..1bc1e6acd7a 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 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 @@ -94,6 +94,7 @@ #include <array> #include <bitset> #include <complex> +#include <date_time> #include <deque> #include <exception> #include <fstream> diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc index 9aa802c7041..869fa02675c 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 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 @@ -94,6 +94,7 @@ #include <array> #include <bitset> #include <complex> +#include <date_time> #include <deque> #include <exception> #include <fstream> @@ -204,6 +205,7 @@ #include <array> #include <bitset> #include <complex> +#include <date_time> #include <deque> #include <exception> #include <fstream> diff --git a/libstdc++-v3/testsuite/31_date_time/headers/date_time/functions_std.cc b/libstdc++-v3/testsuite/31_date_time/headers/date_time/functions_std.cc new file mode 100644 index 00000000000..49b4ecac83b --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/headers/date_time/functions_std.cc @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace gnu +{ + using std::get_system_time; +} diff --git a/libstdc++-v3/testsuite/31_date_time/headers/date_time/std_c++0x_neg.cc b/libstdc++-v3/testsuite/31_date_time/headers/date_time/std_c++0x_neg.cc new file mode 100644 index 00000000000..9b98b628c77 --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/headers/date_time/std_c++0x_neg.cc @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +// Copyright (C) 2008 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. + +#include <date_time> // { dg-excess-errors "In file included from" } + +// { dg-error "upcoming ISO" "" { target *-*-* } 36 } diff --git a/libstdc++-v3/testsuite/31_date_time/headers/date_time/synopsis.cc b/libstdc++-v3/testsuite/31_date_time/headers/date_time/synopsis.cc new file mode 100644 index 00000000000..e86c9b784bf --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/headers/date_time/synopsis.cc @@ -0,0 +1,70 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace std { + // duration types + class nanoseconds; + class microseconds; + class milliseconds; + class seconds; + class minutes; + class hours; + + // timepoint type + class system_time; + + // non-member functions + system_time get_system_time(); + + template<typename Duration> + system_time operator+(const Duration& td, const system_time& rhs); + + template <class LhsDuration, class RhsDuration> + bool operator==(const LhsDuration& lhs, const RhsDuration& rhs); + template <class LhsDuration, class RhsDuration> + bool operator!=(const LhsDuration& lhs, const RhsDuration& rhs); + + template <class LhsDuration, class RhsDuration> + bool operator< (const LhsDuration& lhs, const RhsDuration& rhs); + template <class LhsDuration, class RhsDuration> + bool operator<=(const LhsDuration& lhs, const RhsDuration& rhs); + template <class LhsDuration, class RhsDuration> + bool operator> (const LhsDuration& lhs, const RhsDuration& rhs); + template <class LhsDuration, class RhsDuration> + bool operator>=(const LhsDuration& lhs, const RhsDuration& rhs); + +/* + template <class LhsDuration, class RhsDuration> + FinestDuration operator+(const LhsDuration& lhs, const RhsDuration& rhs); + template <class LhsDuration, class RhsDuration> + FinestDuration operator-(const LhsDuration& lhs, const RhsDuration& rhs); +*/ + + template <class Duration> + Duration operator*(Duration lhs, long rhs); + template <class Duration> + Duration operator*(long lhs, Duration rhs); + + template <class Duration> + Duration operator/(Duration lhs, long rhs); +} diff --git a/libstdc++-v3/testsuite/31_date_time/headers/date_time/types_std.cc b/libstdc++-v3/testsuite/31_date_time/headers/date_time/types_std.cc new file mode 100644 index 00000000000..f8fc5953c5b --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/headers/date_time/types_std.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace gnu +{ + typedef std::nanoseconds t1; + typedef std::microseconds t2; + typedef std::milliseconds t3; + typedef std::seconds t4; + typedef std::minutes t5; + typedef std::hours t6; + typedef std::system_time t7; +} diff --git a/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/duration.cc b/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/duration.cc new file mode 100644 index 00000000000..ca6e2cf374a --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/duration.cc @@ -0,0 +1,50 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace gnu +{ + bool + test_nanoseconds_is_duration() + { + typedef std::nanoseconds D; + D d; + D e(d); + d == e; + d < e; + d = e; + + typedef D::tick_type tick_type; + tick_type t1 = D::ticks_per_second; + tick_type t2 = D::seconds_per_tick; + bool b1 = D::is_subsecond; + tick_type t3 = d.count(); + -d; + + d += e; + d -= e; + d *= static_cast<long>(1); + d /= static_cast<long>(1); + + return b1 || t1 || t2 || t3; + } +} diff --git a/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/traits.cc b/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/traits.cc new file mode 100644 index 00000000000..53f36180ea4 --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/nanoseconds/requirements/traits.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace gnu +{ + void + test_nanoseconds_traits() + { + static_assert(std::nanoseconds::ticks_per_second == 1000L * 1000 * 1000, "FIXME"); + static_assert(std::nanoseconds::seconds_per_tick == 0, "FIXME"); + static_assert(std::nanoseconds::is_subsecond == true, "FIXME"); + } +} diff --git a/libstdc++-v3/testsuite/31_date_time/system_time/requirements/traits.cc b/libstdc++-v3/testsuite/31_date_time/system_time/requirements/traits.cc new file mode 100644 index 00000000000..0310333a620 --- /dev/null +++ b/libstdc++-v3/testsuite/31_date_time/system_time/requirements/traits.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 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. + +#include <date_time> + +namespace gnu +{ + void + test_system_time_traits() + { + static_assert(std::nanoseconds::ticks_per_second == std::nanoseconds::ticks_per_second, "FIXME"); + static_assert(std::system_time::seconds_per_tick == 0, "FIXME"); + static_assert(std::system_time::is_subsecond == true, "FIXME"); + } +} |