xref: /llvm-project/libcxx/test/std/language.support/support.runtime/csignal.pass.cpp (revision 7fc6a55688c816f5fc1a5481ae7af25be7500356)
15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier 
95a83710eSEric Fiselier // test <csignal>
105a83710eSEric Fiselier 
115a83710eSEric Fiselier #include <csignal>
125a83710eSEric Fiselier #include <type_traits>
135a83710eSEric Fiselier 
14*7fc6a556SMarshall Clow #include "test_macros.h"
15*7fc6a556SMarshall Clow 
165a83710eSEric Fiselier #ifndef SIG_DFL
175a83710eSEric Fiselier #error SIG_DFL not defined
185a83710eSEric Fiselier #endif
195a83710eSEric Fiselier 
205a83710eSEric Fiselier #ifndef SIG_ERR
215a83710eSEric Fiselier #error SIG_ERR not defined
225a83710eSEric Fiselier #endif
235a83710eSEric Fiselier 
245a83710eSEric Fiselier #ifndef SIG_IGN
255a83710eSEric Fiselier #error SIG_IGN not defined
265a83710eSEric Fiselier #endif
275a83710eSEric Fiselier 
285a83710eSEric Fiselier #ifndef SIGABRT
295a83710eSEric Fiselier #error SIGABRT not defined
305a83710eSEric Fiselier #endif
315a83710eSEric Fiselier 
325a83710eSEric Fiselier #ifndef SIGFPE
335a83710eSEric Fiselier #error SIGFPE not defined
345a83710eSEric Fiselier #endif
355a83710eSEric Fiselier 
365a83710eSEric Fiselier #ifndef SIGILL
375a83710eSEric Fiselier #error SIGILL not defined
385a83710eSEric Fiselier #endif
395a83710eSEric Fiselier 
405a83710eSEric Fiselier #ifndef SIGINT
415a83710eSEric Fiselier #error SIGINT not defined
425a83710eSEric Fiselier #endif
435a83710eSEric Fiselier 
445a83710eSEric Fiselier #ifndef SIGSEGV
455a83710eSEric Fiselier #error SIGSEGV not defined
465a83710eSEric Fiselier #endif
475a83710eSEric Fiselier 
485a83710eSEric Fiselier #ifndef SIGTERM
495a83710eSEric Fiselier #error SIGTERM not defined
505a83710eSEric Fiselier #endif
515a83710eSEric Fiselier 
main(int,char **)522df59c50SJF Bastien int main(int, char**)
535a83710eSEric Fiselier {
545fd30897SEric Fiselier     std::sig_atomic_t sig = 0;
555fd30897SEric Fiselier     ((void)sig);
565a83710eSEric Fiselier     typedef void (*func)(int);
575a83710eSEric Fiselier     static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), "");
585a83710eSEric Fiselier     static_assert((std::is_same<decltype(std::raise(0)), int>::value), "");
592df59c50SJF Bastien 
602df59c50SJF Bastien   return 0;
615a83710eSEric Fiselier }
62