diff options
author | Tom Tromey <tromey@redhat.com> | 2012-08-15 18:37:30 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2012-08-15 18:37:30 +0000 |
commit | c4269a634c6c7a1a3308d0530804623e34f05651 (patch) | |
tree | 81401eaa7a7d0a2b21796664fe48f0466bbb3ccd /libstdc++-v3/testsuite | |
parent | 5dfe1ad49692530846e53ed49823fa3bf10e4371 (diff) | |
download | gcc-c4269a634c6c7a1a3308d0530804623e34f05651.zip gcc-c4269a634c6c7a1a3308d0530804623e34f05651.tar.gz gcc-c4269a634c6c7a1a3308d0530804623e34f05651.tar.bz2 |
cxx11.cc (struct datum): New.
* testsuite/libstdc++-prettyprinters/cxx11.cc (struct datum):
New.
(global): New global.
(main): Add test for unique_ptr.
* python/libstdcxx/v6/printers.py
(UniquePointerPrinter.to_string): Extract the pointer and also
print its type.
From-SVN: r190417
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r-- | libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc index 54b3275..0d01558 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc @@ -48,6 +48,14 @@ use(const T &container) placeholder(*i); } +struct datum +{ + std::string s; + int i; +}; + +std::unique_ptr<datum> global; + int main() { @@ -86,6 +94,11 @@ main() uoms.insert(5); // { dg-final { note-test uoms {std::unordered_multiset with 1 elements = {[0] = 5}} } } + std::unique_ptr<datum> uptr (new datum); + uptr->s = "hi bob"; + uptr->i = 23; +// { dg-final { regexp-test uptr {std::unique_ptr.datum. containing 0x.*} } } + placeholder(""); // Mark SPOT use(efl); use(fl); @@ -93,6 +106,8 @@ main() use(eumm); use(eus); use(eums); + use(uoms); + use(uptr->s); return 0; } |