32 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// REQUIRES: c++03 || c++11 || c++1410 11// test unexpected12 13#include <exception>14#include <cstdlib>15#include <cassert>16 17#include "test_macros.h"18 19void f1()20{21 std::exit(0);22}23 24int main(int, char**)25{26 std::set_unexpected(f1);27 std::unexpected();28 assert(false);29 30 return 0;31}32