OpenMP: Fix typo in atomic directive error message
[gcc.git] / libstdc++-v3 / testsuite / 25_algorithms / fill / 94017.cc
blob234854d62a0c644d4892b2117248781bf0eff41e
1 // Copyright (C) 2020-2025 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.
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.
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/>.
18 // { dg-do run { target c++20 } }
20 #include <algorithm>
21 #include <testsuite_hooks.h>
22 #include <testsuite_iterators.h>
24 using __gnu_test::test_output_range;
26 namespace ranges = std::ranges;
28 template<typename Out, auto value>
29 void
30 test01()
33 Out x[5];
34 ranges::fill(x, value);
35 VERIFY( ranges::count(x, static_cast<Out>(value)) == ranges::size(x) );
39 Out x[5];
40 test_output_range<Out> rx(x);
41 ranges::fill(x, value);
42 VERIFY( ranges::count(x, static_cast<Out>(value)) == ranges::size(x) );
46 int
47 main()
49 test01<char, 'a'>();
50 test01<char, 100>();
51 test01<char, 150>();
52 test01<char, 300>();
53 test01<char, 1000>();
54 test01<char, -10000L>();
56 test01<signed char, 'a'>();
57 test01<signed char, 100>();
58 test01<signed char, 150>();
59 test01<signed char, 300>();
61 test01<unsigned char, 'a'>();
62 test01<unsigned char, 100>();
63 test01<unsigned char, 150>();
64 test01<unsigned char, 300>();
66 test01<int, 'a'>();
67 test01<int, u8'a'>();
68 test01<int, (signed char)'a'>();
69 test01<int, (unsigned char)'a'>();
71 test01<volatile int, 'a'>();
72 test01<volatile int, 'a'>();
73 test01<volatile int, 500>();
74 test01<volatile char, 500>();