]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/options.cc
Fix incorrect assertion when deallocating big block
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / unsynchronized_pool_resource / options.cc
CommitLineData
852a971c
JW
1// Copyright (C) 2018 Free Software Foundation, Inc.
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
6// Free Software Foundation; either version 3, or (at your option)
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
17
18// { dg-options "-std=gnu++17" }
19// { dg-do run { target c++17 } }
20
21#include <memory_resource>
22#include <testsuite_hooks.h>
23
24void
25test01()
26{
27 std::pmr::unsynchronized_pool_resource r0;
28 const std::pmr::pool_options opts = r0.options();
29 VERIFY( opts.max_blocks_per_chunk != 0 );
30 VERIFY( opts.largest_required_pool_block != 0 );
31
32 std::pmr::unsynchronized_pool_resource r1(opts);
33 auto [max_blocks_per_chunk, largest_required_pool_block ] = r1.options();
34 VERIFY( max_blocks_per_chunk == opts.max_blocks_per_chunk );
35 VERIFY( largest_required_pool_block == opts.largest_required_pool_block );
36}
37
38int
39main()
40{
41 test01();
42}