Protect nested-exceptions tests under no-exceptions
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>
Mon, 14 Nov 2016 11:00:28 +0000 (11:00 +0000)
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>
Mon, 14 Nov 2016 11:00:28 +0000 (11:00 +0000)
Differential Revision: https://reviews.llvm.org/D26458

llvm-svn: 286813

libcxx/test/std/language.support/support.exception/except.nested/assign.pass.cpp
libcxx/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
libcxx/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp

index a5508d1..6338c8a 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <exception>
 
 // class nested_exception;
@@ -17,6 +16,8 @@
 #include <exception>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     int data_;
@@ -34,6 +35,7 @@ int main()
         e = e0;
         assert(e.nested_ptr() == nullptr);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         try
         {
@@ -57,4 +59,5 @@ int main()
             }
         }
     }
+#endif
 }
index f9f2933..4cbdbb2 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <exception>
 
 // class nested_exception;
@@ -17,6 +16,8 @@
 #include <exception>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     int data_;
@@ -33,6 +34,7 @@ int main()
         std::nested_exception e = e0;
         assert(e.nested_ptr() == nullptr);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         try
         {
@@ -55,4 +57,5 @@ int main()
             }
         }
     }
+#endif
 }
index 67766aa..18ca996 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <exception>
 
 // class nested_exception;
@@ -17,6 +16,8 @@
 #include <exception>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     int data_;
@@ -32,6 +33,7 @@ int main()
         std::nested_exception e;
         assert(e.nested_ptr() == nullptr);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         try
         {
@@ -53,4 +55,5 @@ int main()
             }
         }
     }
+#endif
 }