This revision was automatically updated to reflect the committed changes.
Closed by commit rL286809: Protect smart-pointer tests under no exceptions
(authored by rogfer01).
Changed prior to commit:
https://reviews.llvm.org/D26457?vs=77361&id=77778#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26457
Files:
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
Index:
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
===================================================================
---
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
+++
libcxx/trunk/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 main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::weak_ptr<A> wp;
try
@@ -54,6 +56,7 @@
}
assert(A::count == 0);
}
+#endif
{
std::shared_ptr<A> sp0(new A);
std::weak_ptr<A> wp(sp0);
@@ -63,6 +66,7 @@
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 @@
}
}
assert(A::count == 0);
+#endif
}
Index:
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
===================================================================
---
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++
libcxx/trunk/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 @@
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 @@
#endif
}
}
+#endif
assert(A::count == 0);
{ // LWG 2399
fn(std::unique_ptr<int>(new int));
Index: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
===================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
+++ libcxx/trunk/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 main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::weak_ptr<A> wp;
try
@@ -54,6 +56,7 @@
}
assert(A::count == 0);
}
+#endif
{
std::shared_ptr<A> sp0(new A);
std::weak_ptr<A> wp(sp0);
@@ -63,6 +66,7 @@
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 @@
}
}
assert(A::count == 0);
+#endif
}
Index: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
===================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ libcxx/trunk/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 @@
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 @@
#endif
}
}
+#endif
assert(A::count == 0);
{ // LWG 2399
fn(std::unique_ptr<int>(new int));
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits