summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-07-18 23:51:25 +0000
committerAlexis Hunt <alercah@gmail.com>2011-07-18 23:51:25 +0000
commit2405470f01358edef4c112678d298231d86f982e (patch)
treea7a05a9459d26d1727f08923f3837b744f47d2a0 /libcxx/test
parent483cf2454756d623ea202c8ae733d9a954b9a8d7 (diff)
downloadbcm5719-llvm-2405470f01358edef4c112678d298231d86f982e.tar.gz
bcm5719-llvm-2405470f01358edef4c112678d298231d86f982e.zip
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. llvm-svn: 135445
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp2
-rw-r--r--libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp2
-rw-r--r--libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp8
-rw-r--r--libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp6
4 files changed, 18 insertions, 0 deletions
diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
index b670dde6333..93956bcae66 100644
--- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
+++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
@@ -42,6 +42,7 @@ int A::count = 0;
int main()
{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::shared_ptr<A> pA(new A);
A* ptrA = pA.get();
@@ -118,4 +119,5 @@ int main()
}
assert(B::count == 0);
assert(A::count == 0);
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
index 50a15b470fa..4194890dda2 100644
--- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
+++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
@@ -42,6 +42,7 @@ int A::count = 0;
int main()
{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::shared_ptr<A> pA(new A);
A* ptrA = pA.get();
@@ -118,4 +119,5 @@ int main()
}
assert(B::count == 0);
assert(A::count == 0);
+#endif // _LIBCXX_HAS_NO_RVALUE_REFERENCES
}
diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
index a4729434756..27046cf5ca7 100644
--- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
+++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
@@ -85,9 +85,17 @@ int main()
}
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);
diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
index 46ac22d4aa0..b8418338beb 100644
--- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
@@ -77,9 +77,15 @@ int main()
}
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);
OpenPOWER on IntegriCloud