[PATCH] D26611: Protect test for dynarray under libcpp-no-exceptions

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 08:37:50 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL288155: Protect test for dynarray under libcpp-no-exceptions (authored by rogfer01).

Changed prior to commit:
  https://reviews.llvm.org/D26611?vs=77809&id=79580#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26611

Files:
  libcxx/trunk/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp


Index: libcxx/trunk/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
===================================================================
--- libcxx/trunk/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
+++ libcxx/trunk/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: c++98, c++03, c++11
 
 // dynarray.cons
@@ -29,6 +28,8 @@
 #include <new>
 #include <string>
 
+#include "test_macros.h"
+
 
 using std::experimental::dynarray;
 
@@ -61,12 +62,14 @@
     assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } ));
     }
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
 void test_bad_length () {
     try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) + 1 ); }
     catch ( std::bad_array_length & ) { return ; }
     catch (...) { assert(false); }
     assert ( false );
 }
+#endif
 
 
 int main()
@@ -87,5 +90,7 @@
     assert ( d1.size() == 20 );
     assert ( std::all_of ( d1.begin (), d1.end (), []( long item ){ return item == 3L; } ));
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
     test_bad_length ();
+#endif
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26611.79580.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161129/2c2a8fa3/attachment.bin>


More information about the cfe-commits mailing list