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 <signal.h>
10 
11 #include <signal.h>
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 
main(int,char **)52 int main(int, char**)
53 {
54     sig_atomic_t sig; ((void)sig);
55     typedef void (*func)(int);
56     static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
57     static_assert((std::is_same<decltype(raise(0)), int>::value), "");
58 
59   return 0;
60 }
61