diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp index 26a3b252d3b6b..9b684e36e3b35 100644 --- a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp +++ b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp @@ -752,8 +752,8 @@ TEST_F(RtsanOpenedFileTest, RewindDieWhenRealtime) { } #endif -TEST(TestRtsanInterceptors, IoctlDiesWhenRealtime) { - auto Func = []() { ioctl(0, FIONREAD); }; +TEST_F(RtsanOpenedFileTest, IoctlDiesWhenRealtime) { + auto Func = [this]() { ioctl(GetOpenFd(), FIONREAD); }; ExpectRealtimeDeath(Func, "ioctl"); ExpectNonRealtimeSurvival(Func); }