summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support/test_throw.h
blob: 805cb049de8215a8f7631951f42a37016fc6e3a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
OpenPOWER on IntegriCloud