[compiler-rt] [llvm-lit] Add REQUIRES: shell in compiler-rt tests that use the `ulimit` command in lit internal shell (PR #105339)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 13:33:53 PDT 2024


https://github.com/Harini0924 updated https://github.com/llvm/llvm-project/pull/105339

>From ff93c18900641e1200529cad6256e985c76b5716 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Tue, 20 Aug 2024 19:19:50 +0000
Subject: [PATCH 1/2] [llvm-lit] Add REQUIRES: shell in tests that use the
 ulimit command

Added REQUIRES: shell in 6 files that use the ulimit command because lit
internal shell doesn't support this command.
---
 compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp | 1 +
 compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp    | 1 +
 compiler-rt/test/fuzzer/ulimit.test                          | 1 +
 compiler-rt/test/hwasan/TestCases/print-memory-usage.c       | 1 +
 compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp       | 1 +
 5 files changed, 5 insertions(+)

diff --git a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
index b096624a7f95b9..31541dd20ee489 100644
--- a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
@@ -7,6 +7,7 @@
 // Limit this test to Linux since we're relying on allocator internal
 // limits (shadow memory size, allocation limits etc.)
 
+REQUIRES: shell
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: ulimit -v 22024290304
 // RUN: not %run %t malloc 2>&1 \
diff --git a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
index e6e82a47572056..02284e8f0cc3e6 100644
--- a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
@@ -1,3 +1,4 @@
+REQUIRES: shell
 // Check that UAR mode can handle very deep recusrion.
 // RUN: %clangxx_asan -O2 %s -o %t
 // RUN: ulimit -s 4096
diff --git a/compiler-rt/test/fuzzer/ulimit.test b/compiler-rt/test/fuzzer/ulimit.test
index 223f2ac9bb6e2e..3e1c9ceedbb3c3 100644
--- a/compiler-rt/test/fuzzer/ulimit.test
+++ b/compiler-rt/test/fuzzer/ulimit.test
@@ -1,4 +1,5 @@
 # FIXME: Disabled on Windows for now because Windows has no ulimit command.
+REQUIRES: shell
 UNSUPPORTED: target={{.*windows.*}}
 RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest
 RUN: ulimit -s 1000
diff --git a/compiler-rt/test/hwasan/TestCases/print-memory-usage.c b/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
index 2c89d4e70ebc74..7c095e03125de5 100644
--- a/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
+++ b/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
@@ -1,3 +1,4 @@
+REQUIRES: shell
 // Tests __hwasan_print_memory_usage.
 // RUN: %clang_hwasan %s -o %t
 // RUN: ulimit -s 1000
diff --git a/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp b/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
index 61492ec34533fe..30c47abe02936a 100644
--- a/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
+++ b/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
@@ -1,3 +1,4 @@
+REQUIRES: shell
 // MSAN re-execs on unlimited stacks. We use that to verify ReExec() uses the
 // right path.
 // RUN: %clangxx_msan -O0 %s -o %t && ulimit -s unlimited && %run %t | FileCheck %s

>From 9b26939d4d1ed185be2ee884a197575b9b4a4181 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Tue, 20 Aug 2024 20:31:52 +0000
Subject: [PATCH 2/2] [llvm-lit] Found one more test that uses the ulimit
 command

---
 compiler-rt/test/fuzzer/merge-posix.test | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test
index 9fece647ca60b9..8e1c66c1863b40 100644
--- a/compiler-rt/test/fuzzer/merge-posix.test
+++ b/compiler-rt/test/fuzzer/merge-posix.test
@@ -1,3 +1,4 @@
+REQUIRES: shell
 XFAIL: ios
 UNSUPPORTED: target={{.*windows.*}}
 RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest



More information about the llvm-commits mailing list