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 //===----------------------------------------------------------------------===//
8 
9 #include "include/signal.h"
10 #include "src/signal/raise.h"
11 
12 #include "utils/UnitTest/Test.h"
13 
TEST(SignalTest,Raise)14 TEST(SignalTest, Raise) {
15   // SIGCONT is ingored unless stopped, so we can use it to check the return
16   // value of raise without needing to block.
17   EXPECT_EQ(__llvm_libc::raise(SIGCONT), 0);
18 
19   // SIGKILL is chosen because other fatal signals could be caught by sanitizers
20   // for example and incorrectly report test failure.
21   EXPECT_DEATH([] { __llvm_libc::raise(SIGKILL); }, SIGKILL);
22 }
23