From b58b5b4a2eef87f528c56a9e91d9bfeba74ac210 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 24 Aug 2016 17:37:06 +0000 Subject: [PATCH] Vendor import of compiler-rt release_39 branch r279477: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_39@279477 --- lib/msan/tests/msan_test.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/msan/tests/msan_test.cc b/lib/msan/tests/msan_test.cc index e4076b5bd24d..9ec1e28374db 100644 --- a/lib/msan/tests/msan_test.cc +++ b/lib/msan/tests/msan_test.cc @@ -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) {