[compiler-rt] [scudo] Move MemMap tests from to map_test.cpp (PR #197277)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 12 12:09:29 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- compiler-rt/lib/scudo/standalone/tests/common_test.cpp compiler-rt/lib/scudo/standalone/tests/map_test.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/tests/map_test.cpp b/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
index c10e6a7d8..620dffca3 100644
--- a/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/map_test.cpp
@@ -11,9 +11,9 @@
#include "common.h"
#include "mem_map.h"
+#include <algorithm>
#include <string.h>
#include <unistd.h>
-#include <algorithm>
#if SCUDO_LINUX
#include <sys/mman.h>
@@ -64,7 +64,8 @@ TEST(ScudoMapTest, VerifyGetResidentPages) {
// Now write the whole thing.
memset(reinterpret_cast<void *>(MemMap.getBase()), 1, SizeBytes);
- scudo::s64 ResidentPages = MemMap.getResidentPages(MemMap.getBase(), SizeBytes);
+ scudo::s64 ResidentPages =
+ MemMap.getResidentPages(MemMap.getBase(), SizeBytes);
EXPECT_EQ(NumPages, static_cast<uintptr_t>(ResidentPages));
MemMap.unmap();
@@ -86,7 +87,8 @@ TEST(ScudoMapTest, VerifyReleasePagesToOS) {
// Make the entire map resident.
memset(P, 1, SizeBytes);
- scudo::s64 ResidentPages = MemMap.getResidentPages(MemMap.getBase(), SizeBytes);
+ scudo::s64 ResidentPages =
+ MemMap.getResidentPages(MemMap.getBase(), SizeBytes);
if (ResidentPages >= 0)
EXPECT_EQ(NumPages, static_cast<uintptr_t>(ResidentPages));
``````````
</details>
https://github.com/llvm/llvm-project/pull/197277
More information about the llvm-commits
mailing list