Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / libc / test / src / signal / raise_test.cpp
bloba114ac5e8379c8677f38b9fa2c825d0724d005bd
1 //===-- Unittests for raise -----------------------------------------------===//
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 #include "src/signal/raise.h"
11 #include "test/UnitTest/Test.h"
13 #include <signal.h>
15 TEST(LlvmLibcSignalTest, Raise) {
16 // SIGCONT is ingored unless stopped, so we can use it to check the return
17 // value of raise without needing to block.
18 EXPECT_EQ(LIBC_NAMESPACE::raise(SIGCONT), 0);
20 // SIGKILL is chosen because other fatal signals could be caught by sanitizers
21 // for example and incorrectly report test failure.
22 EXPECT_DEATH([] { LIBC_NAMESPACE::raise(SIGKILL); }, WITH_SIGNAL(SIGKILL));