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 // test set_terminate
10 
11 #include <exception>
12 #include <cstdlib>
13 #include <cassert>
14 
15 #include "test_macros.h"
16 
f1()17 void f1() {}
f2()18 void f2() {}
19 
main(int,char **)20 int main(int, char**)
21 {
22     std::set_terminate(f1);
23     assert(std::set_terminate(f2) == f1);
24 
25   return 0;
26 }
27