1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// test <signal.h>
11
12#include <signal.h>
13#include <type_traits>
14
15#ifndef SIG_DFL
16#error SIG_DFL not defined
17#endif
18
19#ifndef SIG_ERR
20#error SIG_ERR not defined
21#endif
22
23#ifndef SIG_IGN
24#error SIG_IGN not defined
25#endif
26
27#ifndef SIGABRT
28#error SIGABRT not defined
29#endif
30
31#ifndef SIGFPE
32#error SIGFPE not defined
33#endif
34
35#ifndef SIGILL
36#error SIGILL not defined
37#endif
38
39#ifndef SIGINT
40#error SIGINT not defined
41#endif
42
43#ifndef SIGSEGV
44#error SIGSEGV not defined
45#endif
46
47#ifndef SIGTERM
48#error SIGTERM not defined
49#endif
50
51int main()
52{
53    sig_atomic_t sig;
54    typedef void (*func)(int);
55    static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
56    static_assert((std::is_same<decltype(raise(0)), int>::value), "");
57}
58