[msan] Extend prlimit test.

llvm-svn: 261049
This commit is contained in:
Evgeniy Stepanov 2016-02-17 01:34:56 +00:00
parent d308f92d02
commit f55ebf0e39
1 changed files with 11 additions and 2 deletions

View File

@ -2814,10 +2814,19 @@ TEST(MemorySanitizer, getrlimit) {
struct rlimit limit2; struct rlimit limit2;
__msan_poison(&limit2, sizeof(limit2)); __msan_poison(&limit2, sizeof(limit2));
int result2 = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2); result = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2);
ASSERT_EQ(result2, 0); ASSERT_EQ(result, 0);
EXPECT_NOT_POISONED(limit2.rlim_cur); EXPECT_NOT_POISONED(limit2.rlim_cur);
EXPECT_NOT_POISONED(limit2.rlim_max); EXPECT_NOT_POISONED(limit2.rlim_max);
__msan_poison(&limit, sizeof(limit));
result = prlimit(getpid(), RLIMIT_DATA, nullptr, &limit);
ASSERT_EQ(result, 0);
EXPECT_NOT_POISONED(limit.rlim_cur);
EXPECT_NOT_POISONED(limit.rlim_max);
result = prlimit(getpid(), RLIMIT_DATA, &limit, nullptr);
ASSERT_EQ(result, 0);
} }
TEST(MemorySanitizer, getrusage) { TEST(MemorySanitizer, getrusage) {