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