diff options
author | Rong Xu <xur@google.com> | 2014-07-21 16:47:22 -0700 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2014-07-29 15:31:03 -0700 |
commit | 38a8aecfb882072900434499696b5c32a2274515 (patch) | |
tree | 2aac97f0ae24b03cd98c1a06e989c031c173f889 /gcc-4.9/libstdc++-v3/testsuite/23_containers | |
parent | c231900e5dcc14d8296bd9f62b45997a49d4d5e7 (diff) | |
download | toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.gz toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.bz2 toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.zip |
[4.9] Switch gcc-4.9 to use google/gcc-4_9 branch.
This source drop uses svn version r212828 of google/gcc-4.9 branch.
We also cherry-picked r213062, r213063 and r213064 to fix windows
build issues.
All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9.
The following prior commits has not been merged to google branch yet.
(They are included in this commit).
e7af147f979e657fe2df00808e5b4319b0e088c6,
baf87df3cb2683649ba7e9872362a7e721117c23, and
c231900e5dcc14d8296bd9f62b45997a49d4d5e7.
Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b
Diffstat (limited to 'gcc-4.9/libstdc++-v3/testsuite/23_containers')
11 files changed, 167 insertions, 8 deletions
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc index 4de8f2d0f..b91c8f271 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1764 } +// { dg-error "no matching" "" { target *-*-* } 1810 } #include <deque> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc index 41f290561..5bc384780 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1697 } +// { dg-error "no matching" "" { target *-*-* } 1743 } #include <deque> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc index f77b12678..27d34e015 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1697 } +// { dg-error "no matching" "" { target *-*-* } 1743 } #include <deque> #include <utility> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc index e7d5b1ee6..72fca0968 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1848 } +// { dg-error "no matching" "" { target *-*-* } 1894 } #include <deque> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc new file mode 100644 index 000000000..087b9cc18 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc @@ -0,0 +1,56 @@ +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2014 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 <set> +#include <stdexcept> + +struct Comparator +{ + Comparator() : valid(false) { } + explicit Comparator(bool) : valid(true) { } + + bool operator()(int i, int j) const + { + if (!valid) + throw std::logic_error("Comparator is invalid"); + return i < j; + } + +private: + bool valid; +}; + +int main() +{ + using test_type = std::set<int, Comparator>; + + Comparator cmp{true}; + + test_type good{cmp}; + + test_type s1; + s1 = good; // copy-assign + s1.insert(1); + s1.insert(2); + + test_type s2; + s2 = std::move(good); // move-assign + s2.insert(1); + s2.insert(2); +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc new file mode 100644 index 000000000..b9464254f --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2014 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/>. + +// libstdc++/61143 + +#include <unordered_set> + +void test01() +{ + std::unordered_set<int> us1, us2; + us1.insert(1); + + us2 = std::move(us1); + + us1.insert(1); +} + +int main() +{ + test01(); + return 0; +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc new file mode 100644 index 000000000..d03fd1dc3 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc @@ -0,0 +1,65 @@ +// Copyright (C) 2014 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/>. + +// { dg-options "-std=gnu++11" } + +#include <unordered_set> +#include <testsuite_hooks.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + std::unordered_set<int> us1 { 0, 1 }; + { + std::unordered_set<int> us2(std::move(us1)); + + us1.swap(us2); + + VERIFY( us1.find(0) != us1.end() ); + + us1.insert(2); + + VERIFY( us1.size() == 3 ); + + us2.swap(us1); + + VERIFY( us2.size() == 3 ); + VERIFY( us2.find(2) != us2.end() ); + + us1 = { 3, 4, 5 }; + + VERIFY( us1.size() == 3 ); + VERIFY( us1.bucket_count() >= 3 ); + + std::unordered_set<int> us3(std::move(us1)); + us3 = std::move(us2); + + us1.swap(us2); + + VERIFY( us1.empty() ); + VERIFY( us2.empty() ); + } + + us1 = { 0, 1 }; + VERIFY( us1.size() == 2 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc index 655c7e8ad..369881ddb 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1326 } +// { dg-error "no matching" "" { target *-*-* } 1486 } #include <vector> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc index d938aa21b..fb7a6d4c0 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1252 } +// { dg-error "no matching" "" { target *-*-* } 1412 } #include <vector> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc index f88828562..1ed760f52 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1252 } +// { dg-error "no matching" "" { target *-*-* } 1412 } #include <vector> #include <utility> diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc index 316249b01..2fa2002d1 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1367 } +// { dg-error "no matching" "" { target *-*-* } 1527 } #include <vector> |