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 #ifndef SIG_DFL 15 #error SIG_DFL not defined 16 #endif 17 18 #ifndef SIG_ERR 19 #error SIG_ERR not defined 20 #endif 21 22 #ifndef SIG_IGN 23 #error SIG_IGN not defined 24 #endif 25 26 #ifndef SIGABRT 27 #error SIGABRT not defined 28 #endif 29 30 #ifndef SIGFPE 31 #error SIGFPE not defined 32 #endif 33 34 #ifndef SIGILL 35 #error SIGILL not defined 36 #endif 37 38 #ifndef SIGINT 39 #error SIGINT not defined 40 #endif 41 42 #ifndef SIGSEGV 43 #error SIGSEGV not defined 44 #endif 45 46 #ifndef SIGTERM 47 #error SIGTERM not defined 48 #endif 49 50 int main(int, char**) 51 { 52 std::sig_atomic_t sig = 0; 53 ((void)sig); 54 typedef void (*func)(int); 55 static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), ""); 56 static_assert((std::is_same<decltype(std::raise(0)), int>::value), ""); 57 58 return 0; 59 } 60