From: Siva Chandra Reddy Date: Tue, 11 Nov 2014 22:10:21 +0000 (+0000) Subject: associative-containers.cc: Add new file missed from earlier commit. X-Git-Tag: upstream/12.2.0~59071 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=059e92fd1aec76aab5d1c92238c78823cdf90ad1;p=platform%2Fupstream%2Fgcc.git associative-containers.cc: Add new file missed from earlier commit. 2014-11-11 Siva Chandra Reddy * testsuite/libstdc++-xmethods/associative-containers.cc: Add new file missed from earlier commit. From-SVN: r217378 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b5229f4..4641278 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2014-11-11 Siva Chandra Reddy + + * testsuite/libstdc++-xmethods/associative-containers.cc: Add new + file missed from earlier commit. + 2014-11-11 François Dumont PR libstdc++/61107 diff --git a/libstdc++-v3/testsuite/libstdc++-xmethods/associative-containers.cc b/libstdc++-v3/testsuite/libstdc++-xmethods/associative-containers.cc new file mode 100644 index 0000000..7949f22 --- /dev/null +++ b/libstdc++-v3/testsuite/libstdc++-xmethods/associative-containers.cc @@ -0,0 +1,79 @@ +// { dg-do run } +// { dg-options "-std=gnu++11 -g -O0" } + +// 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 +// . + +#include +#include +#include +#include + +int +main () +{ + std::set s, s1; + std::multiset ms, ms1; + std::unordered_set us, us1; + std::unordered_multiset ums, ums1; + std::map m, m1; + std::multimap mm, mm1; + std::unordered_map um, um1; + std::unordered_multimap umm, umm1; + + for (int i = 0; i < 100; i++) + { + s.insert (i % 5); + ms.insert (i % 5); + us.insert (i % 7); + ums.insert (i % 7); + + m.insert(std::pair ('a' + i % 5, i)); + mm.insert(std::pair ('a' + i % 5, i)); + um.insert(std::pair ('a' + i % 7, i)); + umm.insert(std::pair ('a' + i % 7, i)); + } + +// { dg-final { note-test s.size() 5 } } +// { dg-final { note-test s.empty() false } } +// { dg-final { note-test s1.empty() true } } +// { dg-final { note-test ms.size() 100 } } +// { dg-final { note-test ms.empty() false } } +// { dg-final { note-test ms1.empty() true } } +// { dg-final { note-test us.size() 7 } } +// { dg-final { note-test us.empty() false } } +// { dg-final { note-test us1.empty() true } } +// { dg-final { note-test ums.size() 100 } } +// { dg-final { note-test ums.empty() false } } +// { dg-final { note-test ums1.empty() true } } +// { dg-final { note-test m.size() 5 } } +// { dg-final { note-test m.empty() false } } +// { dg-final { note-test m1.empty() true } } +// { dg-final { note-test mm.size() 100 } } +// { dg-final { note-test mm.empty() false } } +// { dg-final { note-test mm1.empty() true } } +// { dg-final { note-test um.size() 7 } } +// { dg-final { note-test um.empty() false } } +// { dg-final { note-test um1.empty() true } } +// { dg-final { note-test umm.size() 100 } } +// { dg-final { note-test umm.empty() false } } +// { dg-final { note-test umm1.empty() true } } + + return 0; // Mark SPOT +} + +// { dg-final { gdb-test SPOT {} 1 } }