[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / sys / wait / waitpid_test.cpp
blob136946c4e0fe389fee15bafb9ecb8cced544a7f2
1 //===-- Unittests for waitpid ---------------------------------------------===//
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/sys/wait/waitpid.h"
10 #include "test/ErrnoSetterMatcher.h"
11 #include "test/UnitTest/Test.h"
13 #include <errno.h>
14 #include <sys/wait.h>
16 // The test here is a simpl test for WNOHANG functionality. For a more
17 // involved test, look at fork_test.
19 TEST(LlvmLibcWaitPidTest, NoHangTest) {
20 using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
21 int status;
22 ASSERT_THAT(__llvm_libc::waitpid(-1, &status, WNOHANG), Fails(ECHILD));