Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | 5b08a8a | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
Howard Hinnant | 412dbeb | 2010-11-16 22:09:02 +0000 | [diff] [blame^] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 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 | |
| 51 | int main() |
| 52 | { |
| 53 | sig_atomic_t sig; |
| 54 | 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 | } |