aboutsummaryrefslogtreecommitdiff
path: root/test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp')
-rw-r--r--test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp b/test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp
new file mode 100644
index 000000000000..3199d9b9ea90
--- /dev/null
+++ b/test/std/language.support/support.exception/exception.terminate/terminate/terminate.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 terminate
+
+#include <exception>
+#include <cstdlib>
+#include <cassert>
+
+void f1()
+{
+ std::exit(0);
+}
+
+int main()
+{
+ std::set_terminate(f1);
+ std::terminate();
+ assert(false);
+}