[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / sys / select / select_failure_test.cpp
blob242e93ca4cfbce14b694568c5ce53d38927d4f87
1 //===-- Failure unittests for select --------------------------------------===//
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/select/select.h"
10 #include "src/unistd/read.h"
11 #include "test/ErrnoSetterMatcher.h"
12 #include "test/UnitTest/Test.h"
14 #include <errno.h>
15 #include <sys/select.h>
16 #include <unistd.h>
18 using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
20 TEST(LlvmLibcSelectTest, SelectInvalidFD) {
21 fd_set set;
22 FD_ZERO(&set);
23 struct timeval timeout {
24 0, 0
26 ASSERT_THAT(__llvm_libc::select(-1, &set, nullptr, nullptr, &timeout),
27 Fails(EINVAL));