[cfe-commits] [libcxx] r135445 - in /libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared: util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp util.smartptr.shared.assign/shared_ptr_rv.pass.cpp util.smartptr.shared.const/auto_ptr.pass.cpp util.smartptr.shared.const/unique_ptr.pass.cpp

Sean Hunt scshunt at csclub.uwaterloo.ca
Mon Jul 18 16:51:25 PDT 2011


Author: coppro
Date: Mon Jul 18 18:51:25 2011
New Revision: 135445

URL: http://llvm.org/viewvc/llvm-project?rev=135445&view=rev
Log:
Adjust two tests to account for a nasty change in copying behavior
between C++03 and C++0x and its effect on exceptions, and another two to
not test move construction when rvalue references are not available.

Modified:
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp?rev=135445&r1=135444&r2=135445&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp Mon Jul 18 18:51:25 2011
@@ -42,6 +42,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::shared_ptr<A> pA(new A);
         A* ptrA = pA.get();
@@ -118,4 +119,5 @@
     }
     assert(B::count == 0);
     assert(A::count == 0);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp?rev=135445&r1=135444&r2=135445&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp Mon Jul 18 18:51:25 2011
@@ -42,6 +42,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::shared_ptr<A> pA(new A);
         A* ptrA = pA.get();
@@ -118,4 +119,5 @@
     }
     assert(B::count == 0);
     assert(A::count == 0);
+#endif // _LIBCXX_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp?rev=135445&r1=135444&r2=135445&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp Mon Jul 18 18:51:25 2011
@@ -85,9 +85,17 @@
     }
     catch (...)
     {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
         assert(A::count == 1);
         assert(B::count == 1);
         assert(ptr.get() == raw_ptr);
+#else
+        // Without rvalue references, ptr got copied into
+        // the shared_ptr destructor and the copy was
+        // destroyed during unwinding.
+        assert(A::count == 0);
+        assert(B::count == 0);
+#endif
     }
     }
     assert(A::count == 0);

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp?rev=135445&r1=135444&r2=135445&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp Mon Jul 18 18:51:25 2011
@@ -77,9 +77,15 @@
     }
     catch (...)
     {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
         assert(A::count == 1);
         assert(B::count == 1);
         assert(ptr.get() == raw_ptr);
+#else
+        assert(A::count == 0);
+        assert(B::count == 0);
+        assert(ptr.get() == 0);
+#endif
     }
     }
     assert(A::count == 0);





More information about the cfe-commits mailing list