[libcxx-commits] [libcxx] [libcxx] Add span includes to some mdspan tests (PR #142693)
Aiden Grossman via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 3 16:35:13 PDT 2025
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/142693
This is needed to get these tests to pass in the following
configuration:
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DLIBCXX_TEST_PARAMS="enable_modules=clang" \
-DLIBCXXABI_TEST_PARAMS="enable_modules=clang" \
../llvm
ninja check-cxx
Not exactly sure why these are needed. If there is some other way this
should be fixed, I am perfectly fine going with that.
Interestingly enough this does not fail when using a standalone runtimes
build (after installing clang/appropriate headers). I have not dug into
why that is the case.
This seems to be related to 5e19fd172063c8957a35c7fa3596620f79ebba97 which
added in some similar includes.
>From 4efb38f53103745708f6a858651c22cfdc328d46 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 3 Jun 2025 23:35:03 +0000
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
=?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
.../containers/views/mdspan/extents/assert.conversion.pass.cpp | 1 +
.../views/mdspan/extents/assert.ctor_from_array.pass.cpp | 1 +
.../views/mdspan/extents/assert.ctor_from_integral.pass.cpp | 1 +
.../views/mdspan/extents/assert.ctor_from_span.pass.cpp | 1 +
.../libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp | 1 +
.../views/mdspan/layout_left/assert.conversion.pass.cpp | 1 +
.../views/mdspan/layout_left/assert.ctor.extents.pass.cpp | 1 +
.../views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp | 1 +
.../views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp | 1 +
.../views/mdspan/layout_right/assert.conversion.pass.cpp | 1 +
.../views/mdspan/layout_right/assert.ctor.extents.pass.cpp | 1 +
.../views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp | 1 +
.../views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp | 1 +
.../mdspan/layout_stride/assert.ctor.extents_array.pass.cpp | 1 +
.../views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp | 1 +
15 files changed, 15 insertions(+)
diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp
index 31766e4c51c3b..6ac70d9bd63df 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp
@@ -30,6 +30,7 @@
// (((Extents != dynamic_extent) && (OtherExtents == dynamic_extent)) || ... ) ||
// (numeric_limits<index_type>::max() < numeric_limits<OtherIndexType>::max())
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp
index 90cb0c84a063b..fc52424eacdf2 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp
@@ -30,6 +30,7 @@
// for every rank index r.
//
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp
index 37e79aabf8532..2fc57a35dacad 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp
@@ -32,6 +32,7 @@
// - each element of exts is nonnegative and is representable as a value of type index_type.
//
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp
index 5bf5143590180..4c3f0a7c5cc70 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp
@@ -28,6 +28,7 @@
// for every rank index r.
//
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp
index c473879d87b71..980d9889187a6 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp
@@ -24,6 +24,7 @@
//
// Returns: Di.
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
index 7b6616f19d724..bf7a4fd398bcd 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
@@ -21,6 +21,7 @@
//
// Preconditions: other.required_span_size() is representable as a value of type index_type.
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
index 7c96f8ec9353f..8a1cf24221f8e 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
@@ -19,6 +19,7 @@
//
// Effects: Direct-non-list-initializes extents_ with e.
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp
index e578bac2103b0..310b91e593cd8 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp
@@ -23,6 +23,7 @@
//
// Preconditions: other.required_span_size() is representable as a value of type index_type
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp
index cec8df8aba8d6..5e9c4f15133c9 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_stride.pass.cpp
@@ -32,6 +32,7 @@
//
// Effects: Direct-non-list-initializes extents_ with other.extents().
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
index df16edb925407..5fa6cc949e571 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
@@ -21,6 +21,7 @@
//
// Preconditions: other.required_span_size() is representable as a value of type index_type.
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
index 52095691f6d24..a2aa0be0102ca 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
@@ -19,6 +19,7 @@
//
// Effects: Direct-non-list-initializes extents_ with e.
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp
index 1757ddb286b9c..79ee49e7a925c 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp
@@ -23,6 +23,7 @@
//
// Preconditions: other.required_span_size() is representable as a value of type index_type
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp
index b77d964540f9d..fa83d6087ec85 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_stride.pass.cpp
@@ -32,6 +32,7 @@
//
// Effects: Direct-non-list-initializes extents_ with other.extents().
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
index 6782a9789f89f..0ba5ffb47c7ea 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
@@ -30,6 +30,7 @@
//
// Effects: Direct-non-list-initializes extents_ with e, and for all d in the range [0, rank_), direct-non-list-initializes strides_[d] with as_const(s[d]).
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
index 74e4793c91372..f8e7ddc8b5770 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
@@ -30,6 +30,7 @@
//
// Effects: Direct-non-list-initializes extents_ with e, and for all d in the range [0, rank_), direct-non-list-initializes strides_[d] with as_const(s[d]).
+#include <span> // dynamic_extent
#include <mdspan>
#include <cassert>
More information about the libcxx-commits
mailing list