]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/25_algorithms/iota/1.cc
libstdc++: Remove dg-options "-std=gnu++23" from remaining tests
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 25_algorithms / iota / 1.cc
CommitLineData
28752bcb
PP
1// { dg-do run { target c++23 } }
2
3#include <algorithm>
4#include <testsuite_hooks.h>
5#include <testsuite_iterators.h>
6
7namespace ranges = std::ranges;
8
9void
10test01()
11{
12 int x[3] = {};
13 __gnu_test::test_output_range<int> rx(x);
14 auto r0 = ranges::iota(rx, 0);
15 VERIFY( r0.out.ptr == x+3 );
16 VERIFY( r0.value == 3 );
17 VERIFY( ranges::equal(x, (int[]){0,1,2}) );
18 auto r1 = ranges::iota(x, x+2, 5);
19 VERIFY( r1.out == x+2 );
20 VERIFY( r1.value == 7 );
21 VERIFY( ranges::equal(x, (int[]){5,6,2}) );
22}
23
24int
25main()
26{
27 test01();
28}