1 // { dg-options "-std=gnu++0x" }
3 // 2010-03-25 Paolo Carlini <paolo.carlini@oracle.com>
5 // Copyright (C) 2010 Free Software Foundation, Inc.
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
22 #include <unordered_map>
24 #include <testsuite_hooks.h>
28 bool test
__attribute__((unused
)) = true;
30 typedef std::pair
<const int, int> Pair
;
31 std::unordered_multimap
<int, int> umm1
, umm2
;
32 VERIFY( umm1
== umm2
);
33 VERIFY( !(umm1
!= umm2
) );
35 int second1
[] = { -1, -2, -3, -4, -5 };
36 int second2
[] = { -1, -2, -3, -4, -5 };
37 const unsigned size
= sizeof(second1
) / sizeof(int);
39 for (unsigned perm1
= 0; perm1
< 120; ++perm1
)
42 std::next_permutation(second1
, second1
+ size
);
43 for (unsigned i1
= 0; i1
< size
; ++i1
)
44 umm1
.insert(Pair(0, second1
[i1
]));
46 for (unsigned perm2
= 0; perm2
< 120; ++perm2
)
49 std::next_permutation(second2
, second2
+ size
);
50 for (unsigned i2
= 0; i2
< size
; ++i2
)
51 umm2
.insert(Pair(0, second2
[i2
]));
53 VERIFY( umm1
== umm2
);
54 VERIFY( !(umm1
!= umm2
) );