1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // 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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // test <signal.h> |
10 | |
11 | #include <signal.h> |
12 | |
13 | #include "test_macros.h" |
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 | |
51 | sig_atomic_t sig; |
52 | typedef void (*func)(int); |
53 | ASSERT_SAME_TYPE(func, decltype(signal(sig: 0, handler: (func)0))); |
54 | ASSERT_SAME_TYPE(int, decltype(raise(sig: 0))); |
55 | |