brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4548d34 Raw
62 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// test <csignal>10 11#include <csignal>12#include <type_traits>13 14#include "test_macros.h"15 16#ifndef SIG_DFL17#error SIG_DFL not defined18#endif19 20#ifndef SIG_ERR21#error SIG_ERR not defined22#endif23 24#ifndef SIG_IGN25#error SIG_IGN not defined26#endif27 28#ifndef SIGABRT29#error SIGABRT not defined30#endif31 32#ifndef SIGFPE33#error SIGFPE not defined34#endif35 36#ifndef SIGILL37#error SIGILL not defined38#endif39 40#ifndef SIGINT41#error SIGINT not defined42#endif43 44#ifndef SIGSEGV45#error SIGSEGV not defined46#endif47 48#ifndef SIGTERM49#error SIGTERM not defined50#endif51 52int main(int, char**)53{54    std::sig_atomic_t sig = 0;55    ((void)sig);56    typedef void (*func)(int);57    static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), "");58    static_assert((std::is_same<decltype(std::raise(0)), int>::value), "");59 60  return 0;61}62