xref: /llvm-project/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp (revision 9dfb142ce0bfa11ea7cd9176c27b6c0fca7243e0)
1dafeb97aSLouis Dionne //===----------------------------------------------------------------------===//
2dafeb97aSLouis Dionne //
3dafeb97aSLouis Dionne // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4dafeb97aSLouis Dionne // See https://llvm.org/LICENSE.txt for license information.
5dafeb97aSLouis Dionne // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6dafeb97aSLouis Dionne //
7dafeb97aSLouis Dionne //===----------------------------------------------------------------------===//
8dafeb97aSLouis Dionne 
9dafeb97aSLouis Dionne // test <signal.h>
10dafeb97aSLouis Dionne 
11dafeb97aSLouis Dionne #include <signal.h>
12*9dfb142cSLouis Dionne 
13*9dfb142cSLouis Dionne #include "test_macros.h"
14dafeb97aSLouis Dionne 
15dafeb97aSLouis Dionne #ifndef SIG_DFL
16dafeb97aSLouis Dionne #error SIG_DFL not defined
17dafeb97aSLouis Dionne #endif
18dafeb97aSLouis Dionne 
19dafeb97aSLouis Dionne #ifndef SIG_ERR
20dafeb97aSLouis Dionne #error SIG_ERR not defined
21dafeb97aSLouis Dionne #endif
22dafeb97aSLouis Dionne 
23dafeb97aSLouis Dionne #ifndef SIG_IGN
24dafeb97aSLouis Dionne #error SIG_IGN not defined
25dafeb97aSLouis Dionne #endif
26dafeb97aSLouis Dionne 
27dafeb97aSLouis Dionne #ifndef SIGABRT
28dafeb97aSLouis Dionne #error SIGABRT not defined
29dafeb97aSLouis Dionne #endif
30dafeb97aSLouis Dionne 
31dafeb97aSLouis Dionne #ifndef SIGFPE
32dafeb97aSLouis Dionne #error SIGFPE not defined
33dafeb97aSLouis Dionne #endif
34dafeb97aSLouis Dionne 
35dafeb97aSLouis Dionne #ifndef SIGILL
36dafeb97aSLouis Dionne #error SIGILL not defined
37dafeb97aSLouis Dionne #endif
38dafeb97aSLouis Dionne 
39dafeb97aSLouis Dionne #ifndef SIGINT
40dafeb97aSLouis Dionne #error SIGINT not defined
41dafeb97aSLouis Dionne #endif
42dafeb97aSLouis Dionne 
43dafeb97aSLouis Dionne #ifndef SIGSEGV
44dafeb97aSLouis Dionne #error SIGSEGV not defined
45dafeb97aSLouis Dionne #endif
46dafeb97aSLouis Dionne 
47dafeb97aSLouis Dionne #ifndef SIGTERM
48dafeb97aSLouis Dionne #error SIGTERM not defined
49dafeb97aSLouis Dionne #endif
50dafeb97aSLouis Dionne 
51dafeb97aSLouis Dionne sig_atomic_t sig;
52dafeb97aSLouis Dionne typedef void (*func)(int);
53*9dfb142cSLouis Dionne ASSERT_SAME_TYPE(func, decltype(signal(0, (func)0)));
54*9dfb142cSLouis Dionne ASSERT_SAME_TYPE(int,  decltype(raise(0)));
55