[compiler-rt] [scudo] Change tests that use setrlimit to cause mmap to fail. (PR #87004)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 28 13:30:03 PDT 2024
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 5b06de7f99ef86c484f5fea5542c1868e798ac08 52c6145803384fd3546568b41e7e6f4038510eb8 -- compiler-rt/lib/scudo/standalone/tests/strings_test.cpp compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/tests/strings_test.cpp b/compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
index c28ee7287a..646df28ac9 100644
--- a/compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
@@ -144,7 +144,8 @@ TEST(ScudoStringsTest, CapacityIncreaseFails) {
#if !SCUDO_ANDROID
// qemu does not honor the setrlimit, so verify before proceeding.
- void *ptr = mmap(nullptr, 100, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ void *ptr = mmap(nullptr, 100, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (ptr != MAP_FAILED) {
munmap(ptr, 100);
setrlimit(RLIMIT_AS, &Limit);
diff --git a/compiler-rt/lib/scudo/standalone/tests/vector_test.cpp b/compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
index e65c5d6cc2..cc81e261d1 100644
--- a/compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
@@ -61,7 +61,8 @@ TEST(ScudoVectorTest, ReallocateFails) {
#if !SCUDO_ANDROID
// qemu does not honor the setrlimit, so verify before proceeding.
- void *ptr = mmap(nullptr, 100, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ void *ptr = mmap(nullptr, 100, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (ptr != MAP_FAILED) {
munmap(ptr, 100);
setrlimit(RLIMIT_AS, &Limit);
``````````
</details>
https://github.com/llvm/llvm-project/pull/87004
More information about the llvm-commits
mailing list