blob: 83f45c9b142ea53b081e87b193a78d82d2e2846f [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
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{
Eric Fiselier203f6872015-07-18 22:51:51 +000053 sig_atomic_t sig; ((void)sig);
Howard Hinnant3e519522010-05-11 19:42:16 +000054 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}