1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // test terminate
11 
12 #include <exception>
13 #include <cstdlib>
14 #include <cassert>
15 
f1()16 void f1()
17 {
18     std::exit(0);
19 }
20 
main()21 int main()
22 {
23     std::set_terminate(f1);
24     std::terminate();
25     assert(false);
26 }
27