[compiler-rt] [compiler-rt][rtsan] intercept fflush. (PR #121643)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 4 05:36:40 PST 2025


================
@@ -654,6 +654,19 @@ TEST_F(RtsanOpenedFileTest, FputsDiesWhenRealtime) {
   ExpectNonRealtimeSurvival(Func);
 }
 
+TEST_F(RtsanFileTest, FflushDiesWhenRealtime) {
+  FILE *f = fopen(GetTemporaryFilePath(), "w");
+  EXPECT_THAT(f, Ne(nullptr));
+  int r = fwrite("abc", 1, 3, f);
----------------
cjappl wrote:

nit: Could have a more descriptive name `bytes_written`/`num_written`/`written` or similar

https://github.com/llvm/llvm-project/pull/121643


More information about the llvm-commits mailing list