[libc-commits] [libc] [libc] Fix a typo in posix_madvise_test. (PR #209523)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 14 08:50:54 PDT 2026


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/209523

None

>From 678c1fde727cd0d0c6e0e6fe225d6c371af5f608 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Tue, 14 Jul 2026 15:48:56 +0000
Subject: [PATCH] [libc] Fix a typo in posix_madvise_test.

---
 libc/test/src/sys/mman/linux/posix_madvise_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/test/src/sys/mman/linux/posix_madvise_test.cpp b/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
index 9be5a1fc4a723..eab8abe3fc2a0 100644
--- a/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
+++ b/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
@@ -48,7 +48,7 @@ TEST_F(LlvmLibcPosixMadviseTest, Error_BadPtr) {
 #ifdef LIBC_TEST_UNDER_EMULATOR
   // QEMU might stub madvise hints, so posix_madvise might return 0.
   int ret = LIBC_NAMESPACE::posix_madvise(nullptr, 8, POSIX_MADV_SEQUENTIAL);
-  EXPECT_TRUE(ret == 0 || ret = ENOMEM);
+  EXPECT_TRUE(ret == 0 || ret == ENOMEM);
 #else
   EXPECT_EQ(LIBC_NAMESPACE::posix_madvise(nullptr, 8, POSIX_MADV_SEQUENTIAL),
             ENOMEM);



More information about the libc-commits mailing list