summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc')
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
index b0de25c27ec..f027d0eae38 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
@@ -18,8 +18,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+#include <array>
#include <compare>
#include <iostream>
+#include <memory>
+#include <span>
struct X
{
@@ -54,6 +57,23 @@ main()
auto c10 = 0.0 <=> __builtin_nan("");
// { dg-final { note-test c10 "std::partial_ordering::unordered" } }
+ auto il = {1, 2};
+ auto s1 = std::span(il);
+ static_assert(s1.extent == std::size_t(-1));
+// { dg-final { note-test s1 {std::span of length 2 = {1, 2}} } }
+ auto a = std::array{3, 4};
+ auto s2 = std::span(a);
+ static_assert(s2.extent == std::size_t(2));
+// { dg-final { note-test s2 {std::span of length 2 = {3, 4}} } }
+
+ std::atomic<std::shared_ptr<int>> spe;
+// { dg-final { note-test spe {std::atomic<std::shared_ptr<int>> (empty) = {get() = 0x0}} } }
+ std::atomic<std::shared_ptr<int>> sp1 = std::make_shared<int>(1);
+ std::atomic<std::shared_ptr<int>> sp2 = sp1.load();
+ std::atomic<std::weak_ptr<int>> wp{sp2.load()};
+// { dg-final { regexp-test sp1 {std::atomic.std::shared_ptr.int.. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
+// { dg-final { regexp-test wp {std::atomic.std::weak_ptr.int.. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
+
std::cout << "\n";
return 0; // Mark SPOT
}