aboutsummaryrefslogtreecommitdiff
path: root/test/std/language.support/support.dynamic/alloc.errors/set.new.handler/set_new_handler.pass.cpp
blob: 349bf440e0dc4b8d863be4bff97692e03a9fa835 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// test set_new_handler

#include <new>
#include <cassert>

void f1() {}
void f2() {}

int main()
{
    assert(std::set_new_handler(f1) == 0);
    assert(std::set_new_handler(f2) == f1);
}