150703Swpaul// { dg-options "-std=gnu++11" }
250703Swpaul
350703Swpaul// 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
450703Swpaul
551443Sobrien// Copyright (C) 2007-2015 Free Software Foundation, Inc.
650703Swpaul//
750703Swpaul// This file is part of the GNU ISO C++ Library.  This library is free
850703Swpaul// software; you can redistribute it and/or modify it under the
950703Swpaul// terms of the GNU General Public License as published by the
1051443Sobrien// Free Software Foundation; either version 3, or (at your option)
1150703Swpaul// any later version.
1250703Swpaul//
1350703Swpaul// This library is distributed in the hope that it will be useful,
1450703Swpaul// but WITHOUT ANY WARRANTY; without even the implied warranty of
1550703Swpaul// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1650703Swpaul// GNU General Public License for more details.
1750703Swpaul//
1850703Swpaul// You should have received a copy of the GNU General Public License along
1950703Swpaul// with this library; see the file COPYING3.  If not see
2050703Swpaul// <http://www.gnu.org/licenses/>.
2150703Swpaul
2250703Swpaul// { dg-require-time "" }
2350703Swpaul
2450703Swpaul#include <ext/throw_allocator.h>
2550703Swpaul#include <utility>
2650703Swpaul#include <testsuite_hooks.h>
2750703Swpaul
2850703Swpaulvoid test01()
2950703Swpaul{
3050703Swpaul  bool test __attribute__((unused)) = true;
3150703Swpaul  typedef std::pair<int, char> pair_type;
3250703Swpaul  __gnu_cxx::throw_allocator_random<pair_type> alloc1;
3350703Swpaul
3450703Swpaul  pair_type* ptp1 = alloc1.allocate(1);
3550703Swpaul  alloc1.construct(ptp1, 3, 'a');
36
37  VERIFY( ptp1->first == 3 );
38  VERIFY( ptp1->second == 'a' );
39
40  alloc1.deallocate(ptp1, 1);
41}
42
43int main()
44{
45  test01();
46  return 0;
47}
48