Skip to content

Commit 6649b3d

Browse files
authored
Merge branch 'main' into main
2 parents c9184c7 + 0368e76 commit 6649b3d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,15 +753,24 @@ TEST_F(RtsanOpenedFileTest, RewindDieWhenRealtime) {
753753
#endif
754754

755755
TEST_F(RtsanOpenedFileTest, IoctlDiesWhenRealtime) {
756-
auto Func = [this]() { ioctl(GetOpenFd(), FIONREAD); };
756+
auto Func = [this]() {
757+
int arg{};
758+
ioctl(GetOpenFd(), FIONREAD, &arg);
759+
EXPECT_THAT(arg, Ge(0));
760+
};
757761
ExpectRealtimeDeath(Func, "ioctl");
758762
ExpectNonRealtimeSurvival(Func);
759763
}
760764

765+
TEST_F(RtsanOpenedFileTest, IoctlBehavesWithoutOutputArg) {
766+
const int result = ioctl(GetOpenFd(), FIONCLEX);
767+
EXPECT_THAT(result, Ne(-1));
768+
}
769+
761770
TEST_F(RtsanOpenedFileTest, IoctlBehavesWithOutputArg) {
762771
int arg{};
763-
ioctl(GetOpenFd(), FIONREAD, &arg);
764-
772+
const int result = ioctl(GetOpenFd(), FIONREAD, &arg);
773+
ASSERT_THAT(result, Ne(-1));
765774
EXPECT_THAT(arg, Ge(0));
766775
}
767776

0 commit comments

Comments
 (0)