[libc-commits] [libc] [libc] remove unstable mincore test for invalid vec (PR #79348)

via libc-commits libc-commits at lists.llvm.org
Wed Jan 24 11:07:20 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

<details>
<summary>Changes</summary>

The faults on invalid vec range in mincore seems to be handled differently by the OS (it is an erroneous edge case after all). Remove the tests for now.

---
Full diff: https://github.com/llvm/llvm-project/pull/79348.diff


1 Files Affected:

- (modified) libc/test/src/sys/mman/linux/mincore_test.cpp (-8) 


``````````diff
diff --git a/libc/test/src/sys/mman/linux/mincore_test.cpp b/libc/test/src/sys/mman/linux/mincore_test.cpp
index 52fc7bcf44f78f..493d748f2c98e6 100644
--- a/libc/test/src/sys/mman/linux/mincore_test.cpp
+++ b/libc/test/src/sys/mman/linux/mincore_test.cpp
@@ -52,14 +52,6 @@ TEST(LlvmLibcMincoreTest, InvalidVec) {
   libc_errno = 0;
   int res = LIBC_NAMESPACE::mincore(addr, 1, nullptr);
   EXPECT_THAT(res, Fails(EFAULT, -1));
-  void *area = LIBC_NAMESPACE::mmap(nullptr, page_size, PROT_READ | PROT_WRITE,
-                                    MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-  EXPECT_NE(area, MAP_FAILED);
-  unsigned char *ptr = static_cast<unsigned char *>(area) + page_size - 3;
-  res = LIBC_NAMESPACE::mincore(addr, 4 * page_size, ptr);
-  EXPECT_THAT(res, Fails(EFAULT, -1));
-  EXPECT_THAT(LIBC_NAMESPACE::munmap(addr, page_size), Succeeds());
-  EXPECT_THAT(LIBC_NAMESPACE::munmap(area, 2), Succeeds());
 }
 
 TEST(LlvmLibcMincoreTest, NoError) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/79348


More information about the libc-commits mailing list