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 get_new_handler
10 
11 // XFAIL: LIBCXX-WINDOWS-FIXME
12 
13 #include <new>
14 #include <cassert>
15 
16 #include "test_macros.h"
17 
f1()18 void f1() {}
f2()19 void f2() {}
20 
main(int,char **)21 int main(int, char**)
22 {
23     assert(std::get_new_handler() == 0);
24     std::set_new_handler(f1);
25     assert(std::get_new_handler() == f1);
26     std::set_new_handler(f2);
27     assert(std::get_new_handler() == f2);
28 
29   return 0;
30 }
31