summaryrefslogtreecommitdiffstats
path: root/libcxxabi/test/test_vector1.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-01-31 20:10:33 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-01-31 20:10:33 +0000
commit3d97931a8601b47301f07e60e1d61f4a865d8b1d (patch)
tree3e056dd7a5f559d8c7e38ecb85175f379b5ea680 /libcxxabi/test/test_vector1.cpp
parentf8d292eb08ed7acca651f2ff5b56fb489e1c7505 (diff)
downloadbcm5719-llvm-3d97931a8601b47301f07e60e1d61f4a865d8b1d.tar.gz
bcm5719-llvm-3d97931a8601b47301f07e60e1d61f4a865d8b1d.zip
Drop the stress a notch on dynamic_cast_stress.cpp. Otherwise it occasionally causes clang to crash. Put a noexcept(false) on a throwing destructor in test_vector1.cpp. The test now passes for both C++03 and C++11 modes. Add testit script. All tests are now PASSING :-)
llvm-svn: 149413
Diffstat (limited to 'libcxxabi/test/test_vector1.cpp')
-rw-r--r--libcxxabi/test/test_vector1.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxxabi/test/test_vector1.cpp b/libcxxabi/test/test_vector1.cpp
index f2c9e18ad45..29d39db5361 100644
--- a/libcxxabi/test/test_vector1.cpp
+++ b/libcxxabi/test/test_vector1.cpp
@@ -49,10 +49,16 @@ int gDestructorThrowTarget;
void throw_construct ( void *p ) { if ( gConstructorCounter == gConstructorThrowTarget ) throw 1; ++gConstructorCounter; }
void throw_destruct ( void *p ) { if ( ++gDestructorCounter == gDestructorThrowTarget ) throw 2; }
+#if __has_feature(cxx_noexcept)
+# define CAN_THROW noexcept(false)
+#else
+# define CAN_THROW
+#endif
+
struct vec_on_stack {
void *storage;
vec_on_stack () : storage ( __cxxabiv1::__cxa_vec_new ( 10, 40, 8, throw_construct, throw_destruct )) {}
- ~vec_on_stack () { __cxxabiv1::__cxa_vec_delete ( storage, 40, 8, throw_destruct ); }
+ ~vec_on_stack () CAN_THROW {__cxxabiv1::__cxa_vec_delete ( storage, 40, 8, throw_destruct ); }
};
// Test calls with empty constructors and destructors
OpenPOWER on IntegriCloud