aboutsummaryrefslogtreecommitdiff
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.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
index 76023df..f027d0e 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx20.cc
@@ -21,6 +21,7 @@
#include <array>
#include <compare>
#include <iostream>
+#include <memory>
#include <span>
struct X
@@ -65,6 +66,14 @@ main()
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
}