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

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 10:33:11 PDT 2024


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

>From ce8cbb0e5e247ce686c3693bb58164ea8bd31289 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/3] [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 | 2 +-
 compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp    | 1 +
 compiler-rt/test/fuzzer/merge-posix.test                     | 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 +
 6 files changed, 6 insertions(+), 1 deletion(-)

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..f60a6a4ef79e6d 100644
--- a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
@@ -31,7 +31,7 @@
 // ASan shadow memory on s390 is too large for this test.
 // AArch64 bots fail on this test.
 // TODO(alekseys): Android lit do not run ulimit on device.
-// REQUIRES: shadow-scale-3
+// REQUIRES: shell, shadow-scale-3
 // UNSUPPORTED: android, target={{(s390|aarch64|powerpc64le).*}}
 
 #include <stdlib.h>
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..929a26f8c8e7ce 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/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
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..f8da534375ed82 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..e08340430950d4 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 3d5f684f050eb1fd74ccdd902b99632e683503a2 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Fri, 23 Aug 2024 16:17:25 +0000
Subject: [PATCH 2/3] Removed `windows` and FIXME from two files

---
 compiler-rt/test/fuzzer/merge-posix.test | 1 -
 compiler-rt/test/fuzzer/ulimit.test      | 2 --
 2 files changed, 3 deletions(-)

diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test
index 8e1c66c1863b40..2721668fb97064 100644
--- a/compiler-rt/test/fuzzer/merge-posix.test
+++ b/compiler-rt/test/fuzzer/merge-posix.test
@@ -1,6 +1,5 @@
 REQUIRES: shell
 XFAIL: ios
-UNSUPPORTED: target={{.*windows.*}}
 RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest
 
 RUN: rm -rf  %tmp/T1 %tmp/T2
diff --git a/compiler-rt/test/fuzzer/ulimit.test b/compiler-rt/test/fuzzer/ulimit.test
index 3e1c9ceedbb3c3..e330a97cc07c57 100644
--- a/compiler-rt/test/fuzzer/ulimit.test
+++ b/compiler-rt/test/fuzzer/ulimit.test
@@ -1,6 +1,4 @@
-# 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
 RUN: not %run %t-SimpleTest

>From 37a971b43e90c864075a3b487def86b448c10866 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Fri, 23 Aug 2024 17:32:25 +0000
Subject: [PATCH 3/3] Moved the comments to the first line in three of the
 files

---
 compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp | 2 +-
 compiler-rt/test/hwasan/TestCases/print-memory-usage.c    | 2 +-
 compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

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 929a26f8c8e7ce..37aa7b11a231ad 100644
--- a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
@@ -1,5 +1,5 @@
-// REQUIRES: shell
 // Check that UAR mode can handle very deep recusrion.
+// REQUIRES: shell
 // RUN: %clangxx_asan -O2 %s -o %t
 // RUN: ulimit -s 4096
 // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s
diff --git a/compiler-rt/test/hwasan/TestCases/print-memory-usage.c b/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
index f8da534375ed82..13652fbd921b0a 100644
--- a/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
+++ b/compiler-rt/test/hwasan/TestCases/print-memory-usage.c
@@ -1,5 +1,5 @@
-// REQUIRES: shell
 // Tests __hwasan_print_memory_usage.
+// REQUIRES: shell
 // RUN: %clang_hwasan %s -o %t
 // RUN: ulimit -s 1000
 // RUN: %run %t 2>&1 | FileCheck %s
diff --git a/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp b/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
index e08340430950d4..8dee27047470ea 100644
--- a/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
+++ b/compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp
@@ -1,6 +1,6 @@
-// REQUIRES: shell
 // MSAN re-execs on unlimited stacks. We use that to verify ReExec() uses the
 // right path.
+// REQUIRES: shell
 // RUN: %clangxx_msan -O0 %s -o %t && ulimit -s unlimited && %run %t | FileCheck %s
 
 #include <stdio.h>



More information about the llvm-commits mailing list