| 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 <csignal> |
| 10 | |
| 11 | #include <csignal> |
| 12 | #include <type_traits> |
| 13 | |
| 14 | #include "test_macros.h" |
| 15 | |
| 16 | #ifndef SIG_DFL |
| 17 | #error SIG_DFL not defined |
| 18 | #endif |
| 19 | |
| 20 | #ifndef SIG_ERR |
| 21 | #error SIG_ERR not defined |
| 22 | #endif |
| 23 | |
| 24 | #ifndef SIG_IGN |
| 25 | #error SIG_IGN not defined |
| 26 | #endif |
| 27 | |
| 28 | #ifndef SIGABRT |
| 29 | #error SIGABRT not defined |
| 30 | #endif |
| 31 | |
| 32 | #ifndef SIGFPE |
| 33 | #error SIGFPE not defined |
| 34 | #endif |
| 35 | |
| 36 | #ifndef SIGILL |
| 37 | #error SIGILL not defined |
| 38 | #endif |
| 39 | |
| 40 | #ifndef SIGINT |
| 41 | #error SIGINT not defined |
| 42 | #endif |
| 43 | |
| 44 | #ifndef SIGSEGV |
| 45 | #error SIGSEGV not defined |
| 46 | #endif |
| 47 | |
| 48 | #ifndef SIGTERM |
| 49 | #error SIGTERM not defined |
| 50 | #endif |
| 51 | |
| 52 | int 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 | |