diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-12-02 16:45:21 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-12-02 16:45:21 +0000 |
commit | 1596c4531b3950f4c883013cb51182ad40884633 (patch) | |
tree | 969833db70ead1f9cf8f6d0ec88590ab60858fbe /libcxx/test/language.support/support.exception | |
parent | cdae9242fa11b0bb9a575dc4632fc3008c662339 (diff) | |
download | bcm5719-llvm-1596c4531b3950f4c883013cb51182ad40884633.tar.gz bcm5719-llvm-1596c4531b3950f4c883013cb51182ad40884633.zip |
N3189 Observers for the three handler functions
llvm-svn: 120712
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); +} |