summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-01 10:34:13 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-01 10:34:13 +0000
commitf18891050b6934c2745874de38cdb125047a35ca (patch)
treec09a472ef4fe6b510be67150ea76dd242a082927 /libcxx/test/support
parent2b44936f6dcb2b68454af330a2fb69d51206d467 (diff)
downloadbcm5719-llvm-f18891050b6934c2745874de38cdb125047a35ca.tar.gz
bcm5719-llvm-f18891050b6934c2745874de38cdb125047a35ca.zip
Replace test_throw.h header with a single test macro
llvm-svn: 283030
Diffstat (limited to 'libcxx/test/support')
-rw-r--r--libcxx/test/support/test_macros.h11
-rw-r--r--libcxx/test/support/test_throw.h27
2 files changed, 11 insertions, 27 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
diff --git a/libcxx/test/support/test_throw.h b/libcxx/test/support/test_throw.h
deleted file mode 100644
index 805cb049de8..00000000000
--- a/libcxx/test/support/test_throw.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-//===---------------------------- test_macros.h ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUPPORT_TEST_THROW_H
-#define SUPPORT_TEST_THROW_H
-
-#include "test_macros.h"
-#include <cstdlib>
-
-template <class Ex>
-TEST_NORETURN
-inline void test_throw() {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- throw Ex();
-#else
- std::abort();
-#endif
-}
-
-#endif // SUPPORT_TEST_THROW_H
OpenPOWER on IntegriCloud