diff options
Diffstat (limited to 'libstdc++-v3/testsuite')
5 files changed, 226 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/20_util/pair/cons/noexcept_move_construct.cc b/libstdc++-v3/testsuite/20_util/pair/cons/noexcept_move_construct.cc new file mode 100644 index 0000000..911bb92 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/pair/cons/noexcept_move_construct.cc @@ -0,0 +1,42 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2011-05-20 Paolo Carlini <paolo.carlini@oracle.com> +// +// 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 <utility> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +typedef std::pair<int, int> tt1; +typedef std::pair<int, double> tt2; +typedef std::pair<NoexceptMoveConsClass, + NoexceptMoveConsClass> tt3; +typedef std::pair<ExceptMoveConsClass, ExceptMoveConsClass> tt4; +typedef std::pair<ExceptMoveConsClass, double> tt5; +typedef std::pair<NoexceptMoveConsClass, + ExceptMoveConsClass> tt6; + +static_assert(std::is_nothrow_move_constructible<tt1>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt2>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt3>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt4>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt5>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt6>::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/pair/noexcept_move_assign.cc b/libstdc++-v3/testsuite/20_util/pair/noexcept_move_assign.cc new file mode 100644 index 0000000..ee8edca --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/pair/noexcept_move_assign.cc @@ -0,0 +1,42 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2011-05-20 Paolo Carlini <paolo.carlini@oracle.com> +// +// 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 <utility> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +typedef std::pair<int, int> tt1; +typedef std::pair<int, double> tt2; +typedef std::pair<NoexceptMoveAssignClass, + NoexceptMoveAssignClass> tt3; +typedef std::pair<ExceptMoveAssignClass, ExceptMoveAssignClass> tt4; +typedef std::pair<ExceptMoveAssignClass, double> tt5; +typedef std::pair<NoexceptMoveAssignClass, + ExceptMoveAssignClass> tt6; + +static_assert(std::is_nothrow_move_assignable<tt1>::value, "Error"); +static_assert(std::is_nothrow_move_assignable<tt2>::value, "Error"); +static_assert(std::is_nothrow_move_assignable<tt3>::value, "Error"); +static_assert(!std::is_nothrow_move_assignable<tt4>::value, "Error"); +static_assert(!std::is_nothrow_move_assignable<tt5>::value, "Error"); +static_assert(!std::is_nothrow_move_assignable<tt6>::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/pair/noexcept_swap.cc b/libstdc++-v3/testsuite/20_util/pair/noexcept_swap.cc new file mode 100644 index 0000000..e82b616 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/pair/noexcept_swap.cc @@ -0,0 +1,81 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2011-05-20 Paolo Carlini <paolo.carlini@oracle.com> +// +// 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 <utility> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +typedef std::pair<int, int> tt1; +typedef std::pair<int, double> tt2; +typedef std::pair<short, NoexceptMoveAssignClass> tt4; +typedef std::pair<ExceptMoveAssignClass, double> tt6; +typedef std::pair<int, ExceptMoveConsClass> tt9; +typedef std::pair<ExceptMoveAssignClass, short> tt10; +typedef std::pair<short, NoexceptMoveConsClass> tt11; +typedef std::pair<NoexceptMoveConsClass, + NoexceptMoveConsClass> tt12; +typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, + NoexceptMoveConsNoexceptMoveAssignClass> tt13; +typedef std::pair<ExceptMoveConsNoexceptMoveAssignClass, + ExceptMoveConsNoexceptMoveAssignClass> tt14; +typedef std::pair<NoexceptMoveConsExceptMoveAssignClass, + NoexceptMoveConsExceptMoveAssignClass> tt15; +typedef std::pair<ExceptMoveConsExceptMoveAssignClass, + ExceptMoveConsExceptMoveAssignClass> tt16; +typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, + double> tt17; +typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, + NoexceptMoveConsNoexceptMoveAssignClass> tt19; +typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, + ExceptMoveConsNoexceptMoveAssignClass> tt21; + +static_assert(noexcept(std::declval<tt1&>().swap(std::declval<tt1&>())), + "Error"); +static_assert(noexcept(std::declval<tt2&>().swap(std::declval<tt2&>())), + "Error"); +static_assert(noexcept(std::declval<tt4&>().swap(std::declval<tt4&>())), + "Error"); +static_assert(!noexcept(std::declval<tt6&>().swap(std::declval<tt6&>())), + "Error"); +static_assert(!noexcept(std::declval<tt9&>().swap(std::declval<tt9&>())), + "Error"); +static_assert(!noexcept(std::declval<tt10&>().swap(std::declval<tt10&>())), + "Error"); +static_assert(noexcept(std::declval<tt11&>().swap(std::declval<tt11&>())), + "Error"); +static_assert(noexcept(std::declval<tt12&>().swap(std::declval<tt12&>())), + "Error"); +static_assert(noexcept(std::declval<tt13&>().swap(std::declval<tt13&>())), + "Error"); +static_assert(!noexcept(std::declval<tt14&>().swap(std::declval<tt14&>())), + "Error"); +static_assert(!noexcept(std::declval<tt15&>().swap(std::declval<tt15&>())), + "Error"); +static_assert(!noexcept(std::declval<tt16&>().swap(std::declval<tt16&>())), + "Error"); +static_assert(noexcept(std::declval<tt17&>().swap(std::declval<tt17&>())), + "Error"); +static_assert(noexcept(std::declval<tt19&>().swap(std::declval<tt19&>())), + "Error"); +static_assert(!noexcept(std::declval<tt21&>().swap(std::declval<tt21&>())), + "Error"); diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/noexcept_move_construct.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/noexcept_move_construct.cc new file mode 100644 index 0000000..801b5fa --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/noexcept_move_construct.cc @@ -0,0 +1,59 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2011-05-20 Paolo Carlini <paolo.carlini@oracle.com> +// +// 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 <tuple> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +typedef std::tuple<int> tt1; +typedef std::tuple<int, double> tt2; +typedef std::tuple<short, double, int> tt3; +typedef std::tuple<short, NoexceptMoveConsClass, double> tt4; +typedef std::tuple<NoexceptMoveConsClass, + NoexceptMoveConsClass, double> tt5; +typedef std::tuple<NoexceptMoveConsClass, + NoexceptMoveConsClass, + NoexceptMoveConsClass> tt6; +typedef std::tuple<ExceptMoveConsClass> tt7; +typedef std::tuple<ExceptMoveConsClass, double> tt8; +typedef std::tuple<short, double, ExceptMoveConsClass> tt9; +typedef std::tuple<ExceptMoveConsClass, double, + ExceptMoveConsClass> tt10; +typedef std::tuple<NoexceptMoveConsClass, + ExceptMoveConsClass> tt11; +typedef std::tuple<int, + NoexceptMoveConsClass, + ExceptMoveConsClass> tt12; + +static_assert(std::is_nothrow_move_constructible<tt1>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt2>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt3>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt4>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt5>::value, "Error"); +static_assert(std::is_nothrow_move_constructible<tt6>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt7>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt8>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt9>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt10>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt11>::value, "Error"); +static_assert(!std::is_nothrow_move_constructible<tt12>::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc index d449be3..9db39d2 100644 --- a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc +++ b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc @@ -51,9 +51,9 @@ main() // { dg-warning "note" "" { target *-*-* } 485 } // { dg-warning "note" "" { target *-*-* } 479 } // { dg-warning "note" "" { target *-*-* } 469 } -// { dg-warning "note" "" { target *-*-* } 637 } +// { dg-warning "note" "" { target *-*-* } 633 } // { dg-warning "note" "" { target *-*-* } 1056 } // { dg-warning "note" "" { target *-*-* } 1050 } // { dg-warning "note" "" { target *-*-* } 342 } // { dg-warning "note" "" { target *-*-* } 292 } -// { dg-warning "note" "" { target *-*-* } 212 } +// { dg-warning "note" "" { target *-*-* } 214 } |