diff options
Diffstat (limited to 'libcxx/test/language.support/support.exception')
-rw-r--r-- | libcxx/test/language.support/support.exception/exception.terminate/set.terminate/get_terminate.pass.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libcxx/test/language.support/support.exception/exception.terminate/set.terminate/get_terminate.pass.cpp b/libcxx/test/language.support/support.exception/exception.terminate/set.terminate/get_terminate.pass.cpp new file mode 100644 index 00000000000..82ae4aaa88d --- /dev/null +++ b/libcxx/test/language.support/support.exception/exception.terminate/set.terminate/get_terminate.pass.cpp @@ -0,0 +1,25 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// test get_terminate + +#include <exception> +#include <cstdlib> +#include <cassert> + +void f1() {} +void f2() {} + +int main() +{ + std::set_terminate(f1); + assert(std::get_terminate() == f1); + std::set_terminate(f2); + assert(std::get_terminate() == f2); +} |