diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-14 10:27:56 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-14 10:27:56 +0000 |
commit | 4a152f147f73f5283686e25d1d2adcfb8776090c (patch) | |
tree | ec6942b766b020737475c0537c26838ae4a3e416 | |
parent | bda72761207e2f8e7ffdfb8da0ddb1439d71faee (diff) | |
download | bcm5719-llvm-4a152f147f73f5283686e25d1d2adcfb8776090c.tar.gz bcm5719-llvm-4a152f147f73f5283686e25d1d2adcfb8776090c.zip |
Protect smart-pointer tests under no exceptions
Skip tests that expect an exception be thrown under no-exceptions.
Differential Revision: https://reviews.llvm.org/D26457
llvm-svn: 286809
2 files changed, 8 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp index 5c424f5c742..877577c9ce5 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: sanitizer-new-delete // <memory> @@ -63,6 +62,7 @@ int main() assert(p.get() == raw_ptr); assert(ptr.get() == 0); } +#ifndef TEST_HAS_NO_EXCEPTIONS assert(A::count == 0); { std::unique_ptr<A> ptr(new A); @@ -86,6 +86,7 @@ int main() #endif } } +#endif assert(A::count == 0); { // LWG 2399 fn(std::unique_ptr<int>(new int)); diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp index 35a7d077b42..830aa5bbca4 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // <memory> // shared_ptr @@ -17,6 +16,8 @@ #include <memory> #include <cassert> +#include "test_macros.h" + struct B { static int count; @@ -42,6 +43,7 @@ int A::count = 0; int main() { +#ifndef TEST_HAS_NO_EXCEPTIONS { std::weak_ptr<A> wp; try @@ -54,6 +56,7 @@ int main() } assert(A::count == 0); } +#endif { std::shared_ptr<A> sp0(new A); std::weak_ptr<A> wp(sp0); @@ -63,6 +66,7 @@ int main() assert(A::count == 1); } assert(A::count == 0); +#ifndef TEST_HAS_NO_EXCEPTIONS { std::shared_ptr<A> sp0(new A); std::weak_ptr<A> wp(sp0); @@ -77,4 +81,5 @@ int main() } } assert(A::count == 0); +#endif } |