Skip to content

Commit 4b3f147

Browse files
authored
[rtsan][compiler-rt] Add missing calloc unit test (#106159)
1 parent 58eec85 commit 4b3f147

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ TEST(TestRtsanInterceptors, MallocDiesWhenRealtime) {
7171
ExpectNonRealtimeSurvival(Func);
7272
}
7373

74+
TEST(TestRtsanInterceptors, CallocDiesWhenRealtime) {
75+
auto Func = []() { EXPECT_NE(nullptr, calloc(2, 4)); };
76+
ExpectRealtimeDeath(Func, "calloc");
77+
ExpectNonRealtimeSurvival(Func);
78+
}
79+
7480
TEST(TestRtsanInterceptors, ReallocDiesWhenRealtime) {
7581
void *ptr_1 = malloc(1);
7682
auto Func = [ptr_1]() { EXPECT_NE(nullptr, realloc(ptr_1, 8)); };

0 commit comments

Comments
 (0)