xref: /llvm-project/libcxx/test/std/depr/exception.unexpected/unexpected/unexpected.pass.cpp (revision 31cbe0f240f660f15602c96b787c58a26f17e179)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // REQUIRES: c++03 || c++11 || c++14
10 
11 // test unexpected
12 
13 #include <exception>
14 #include <cstdlib>
15 #include <cassert>
16 
17 #include "test_macros.h"
18 
f1()19 void f1()
20 {
21     std::exit(0);
22 }
23 
main(int,char **)24 int main(int, char**)
25 {
26     std::set_unexpected(f1);
27     std::unexpected();
28     assert(false);
29 
30   return 0;
31 }
32