Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / language.support / support.runtime / csignal.pass.cpp
blob4548d3417ec4302af032f4f646fabe8db8e4bd24
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 //===----------------------------------------------------------------------===//
9 // test <csignal>
11 #include <csignal>
12 #include <type_traits>
14 #include "test_macros.h"
16 #ifndef SIG_DFL
17 #error SIG_DFL not defined
18 #endif
20 #ifndef SIG_ERR
21 #error SIG_ERR not defined
22 #endif
24 #ifndef SIG_IGN
25 #error SIG_IGN not defined
26 #endif
28 #ifndef SIGABRT
29 #error SIGABRT not defined
30 #endif
32 #ifndef SIGFPE
33 #error SIGFPE not defined
34 #endif
36 #ifndef SIGILL
37 #error SIGILL not defined
38 #endif
40 #ifndef SIGINT
41 #error SIGINT not defined
42 #endif
44 #ifndef SIGSEGV
45 #error SIGSEGV not defined
46 #endif
48 #ifndef SIGTERM
49 #error SIGTERM not defined
50 #endif
52 int main(int, char**)
54 std::sig_atomic_t sig = 0;
55 ((void)sig);
56 typedef void (*func)(int);
57 static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), "");
58 static_assert((std::is_same<decltype(std::raise(0)), int>::value), "");
60 return 0;