[compiler-rt] r279352 - [msan] Disable prlimit test on glibc < 2.13.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 17:38:55 PDT 2016


Author: eugenis
Date: Fri Aug 19 19:38:55 2016
New Revision: 279352

URL: http://llvm.org/viewvc/llvm-project?rev=279352&view=rev
Log:
[msan] Disable prlimit test on glibc < 2.13.

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=279352&r1=279351&r2=279352&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Fri Aug 19 19:38:55 2016
@@ -2825,6 +2825,12 @@ TEST(MemorySanitizer, LongStruct) {
   EXPECT_POISONED(s2.a8);
 }
 
+#ifdef __GLIBC__
+#define MSAN_TEST_PRLIMIT __GLIBC_PREREQ(2, 13)
+#else
+#define MSAN_TEST_PRLIMIT 1
+#endif
+
 TEST(MemorySanitizer, getrlimit) {
   struct rlimit limit;
   __msan_poison(&limit, sizeof(limit));
@@ -2833,6 +2839,7 @@ TEST(MemorySanitizer, getrlimit) {
   EXPECT_NOT_POISONED(limit.rlim_cur);
   EXPECT_NOT_POISONED(limit.rlim_max);
 
+#if MSAN_TEST_PRLIMIT
   struct rlimit limit2;
   __msan_poison(&limit2, sizeof(limit2));
   result = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2);
@@ -2848,6 +2855,7 @@ TEST(MemorySanitizer, getrlimit) {
 
   result = prlimit(getpid(), RLIMIT_DATA, &limit, nullptr);
   ASSERT_EQ(result, 0);
+#endif
 }
 
 TEST(MemorySanitizer, getrusage) {




More information about the llvm-commits mailing list