summaryrefslogtreecommitdiffstats
path: root/libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp')
-rw-r--r--libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp b/libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp
new file mode 100644
index 00000000000..0f441e2b6e7
--- /dev/null
+++ b/libcxx/test/language.support/support.exception/exception.unexpected/unexpected/unexpected.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test unexpected
+
+#include <exception>
+#include <cstdlib>
+#include <cassert>
+
+void f1()
+{
+ std::exit(0);
+}
+
+int main()
+{
+ std::set_unexpected(f1);
+ std::unexpected();
+ assert(false);
+}
OpenPOWER on IntegriCloud