[compiler-rt] r261049 - [msan] Extend prlimit test.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 17:34:56 PST 2016


Author: eugenis
Date: Tue Feb 16 19:34:56 2016
New Revision: 261049

URL: http://llvm.org/viewvc/llvm-project?rev=261049&view=rev
Log:
[msan] Extend prlimit test.

Modified:
    compiler-rt/trunk/lib/msan/tests/msan_test.cc

Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=261049&r1=261048&r2=261049&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Tue Feb 16 19:34:56 2016
@@ -2814,10 +2814,19 @@ TEST(MemorySanitizer, getrlimit) {
 
   struct rlimit limit2;
   __msan_poison(&limit2, sizeof(limit2));
-  int result2 = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2);
-  ASSERT_EQ(result2, 0);
+  result = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2);
+  ASSERT_EQ(result, 0);
   EXPECT_NOT_POISONED(limit2.rlim_cur);
   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) {




More information about the llvm-commits mailing list