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

source code of libcxx/test/std/language.support/support.dynamic/alloc.errors/set.new.handler/set_new_handler.pass.cpp