blob: e2fc456e44ca4ac4247c3cdf34034400cd4220b9 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Chandler Carruth57b08b02019-01-19 10:56:40 +00003// 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
Howard Hinnant3e519522010-05-11 19:42:16 +00006//
7//===----------------------------------------------------------------------===//
8
9// test <signal.h>
10
11#include <signal.h>
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
50int main()
51{
Eric Fiselier203f6872015-07-18 22:51:51 +000052 sig_atomic_t sig; ((void)sig);
Howard Hinnant3e519522010-05-11 19:42:16 +000053 typedef void (*func)(int);
54 static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
55 static_assert((std::is_same<decltype(raise(0)), int>::value), "");
56}