diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-07-24 03:51:39 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-07-24 03:51:39 +0000 |
commit | e4d9c316d2e7add22fb6640000f2f3a30ed31fc0 (patch) | |
tree | c596c395ab7336ea5b430c920c553cbb209fec2e /libcxx/test/support | |
parent | 8a9bb7baeb40fff34c8ddd664bde351e7aa3ea0b (diff) | |
download | bcm5719-llvm-e4d9c316d2e7add22fb6640000f2f3a30ed31fc0.tar.gz bcm5719-llvm-e4d9c316d2e7add22fb6640000f2f3a30ed31fc0.zip |
Implement P0040r3: Extending memory management tools
llvm-svn: 276544
Diffstat (limited to 'libcxx/test/support')
-rw-r--r-- | libcxx/test/support/test_throw.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxx/test/support/test_throw.h b/libcxx/test/support/test_throw.h new file mode 100644 index 00000000000..805cb049de8 --- /dev/null +++ b/libcxx/test/support/test_throw.h @@ -0,0 +1,27 @@ +// -*- 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 |