summaryrefslogtreecommitdiff
path: root/test/test_vector1.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_vector1.pass.cpp')
-rw-r--r--test/test_vector1.pass.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/test_vector1.pass.cpp b/test/test_vector1.pass.cpp
index 6790cb5..978ed3c 100644
--- a/test/test_vector1.pass.cpp
+++ b/test/test_vector1.pass.cpp
@@ -47,8 +47,19 @@ int gConstructorCounter;
int gConstructorThrowTarget;
int gDestructorCounter;
int gDestructorThrowTarget;
-void throw_construct ( void *p ) { if ( gConstructorCounter == gConstructorThrowTarget ) throw 1; ++gConstructorCounter; }
-void throw_destruct ( void *p ) { if ( ++gDestructorCounter == gDestructorThrowTarget ) throw 2; }
+void throw_construct ( void *p ) {
+#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
+ if ( gConstructorCounter == gConstructorThrowTarget )
+ throw 1;
+ ++gConstructorCounter;
+#endif
+}
+void throw_destruct ( void *p ) {
+#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
+ if ( ++gDestructorCounter == gDestructorThrowTarget )
+ throw 2;
+#endif
+}
#if __cplusplus >= 201103L
# define CAN_THROW noexcept(false)
@@ -146,6 +157,7 @@ int test_counted ( ) {
return retVal;
}
+#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
// Make sure the constructors and destructors are matched
int test_exception_in_constructor ( ) {
int retVal = 0;
@@ -202,7 +214,9 @@ int test_exception_in_constructor ( ) {
return retVal;
}
+#endif
+#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
// Make sure the constructors and destructors are matched
int test_exception_in_destructor ( ) {
int retVal = 0;
@@ -253,12 +267,15 @@ int test_exception_in_destructor ( ) {
return retVal;
}
+#endif
int main ( int argc, char *argv [] ) {
int retVal = 0;
retVal += test_empty ();
retVal += test_counted ();
+#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
retVal += test_exception_in_constructor ();
retVal += test_exception_in_destructor ();
+#endif
return retVal;
}