summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support/test_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/support/test_macros.h')
-rw-r--r--libcxx/test/support/test_macros.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index affd26ba033..534c13a2fe0 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -140,4 +140,15 @@ struct is_same<T, T> { enum {value = 1}; };
static_assert(test_macros_detail::is_same<__VA_ARGS__>::value, \
"Types differ uexpectedly")
+#ifndef TEST_HAS_NO_EXCEPTIONS
+#define TEST_THROW(...) throw __VA_ARGS__
+#else
+#if defined(__GNUC__)
+#define TEST_THROW(...) __builtin_abort()
+#else
+#include <stdlib.h>
+#define TEST_THROW(...) ::abort()
+#endif
+#endif
+
#endif // SUPPORT_TEST_MACROS_HPP
OpenPOWER on IntegriCloud