]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add tests for std::extents.
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Tue, 29 Apr 2025 12:46:10 +0000 (14:46 +0200)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 7 May 2025 10:47:39 +0000 (11:47 +0100)
commit0deefb9300043fc096e958154813ddf77b943fb3
tree1bc371036ea025e0076cc81b1cb45517eede9564
parenta33b5db97c4e87bd02f1af1a75b2d84376442fa0
libstdc++: Add tests for std::extents.

A prior commit added std::extents, this commit adds the tests. The bulk
is focussed on testing the constructors. These are split into three
groups:

1. the ctor from other extents and the copy ctor,
2. the ctor from a pack of integer-like objects,
3. the ctor from shapes, i.e. span and array.

For each group check that the ctor:
* produces an object with the expected values for extent,
* is implicit if and only if required,
* is constexpr,
* doesn't change the rank of the extent.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/mdspan/extents/class_mandates_neg.cc: New test.
* testsuite/23_containers/mdspan/extents/ctor_copy.cc: New test.
* testsuite/23_containers/mdspan/extents/ctor_ints.cc: New test.
* testsuite/23_containers/mdspan/extents/ctor_shape.cc: New test.
* testsuite/23_containers/mdspan/extents/custom_integer.cc: New test.
* testsuite/23_containers/mdspan/extents/misc.cc: New test.

Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
libstdc++-v3/testsuite/23_containers/mdspan/extents/class_mandates_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/mdspan/extents/custom_integer.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/mdspan/extents/misc.cc [new file with mode: 0644]