Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

Now that ulimit is implemented for the internal shell, we can make sure
that the clang tests utilizing ulimit actually work. One just needs the
removal of its shell requirement while the other one needs some rework
to avoid bash for loops. These are writtein in Python for about the same
amount of complexity.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Sep 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2025

@llvm/pr-subscribers-clang

Author: Aiden Grossman (boomanaiden154)

Changes

Now that ulimit is implemented for the internal shell, we can make sure
that the clang tests utilizing ulimit actually work. One just needs the
removal of its shell requirement while the other one needs some rework
to avoid bash for loops. These are writtein in Python for about the same
amount of complexity.


Full diff: https://github.com/llvm/llvm-project/pull/157977.diff

2 Files Affected:

  • (modified) clang/test/PCH/leakfiles.test (+3-4)
  • (modified) clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp (-1)
diff --git a/clang/test/PCH/leakfiles.test b/clang/test/PCH/leakfiles.test
index dc4047ac3ff48..6f7420362a2c6 100644
--- a/clang/test/PCH/leakfiles.test
+++ b/clang/test/PCH/leakfiles.test
@@ -2,7 +2,6 @@
 // https://bugs.chromium.org/p/chromium/issues/detail?id=924225
 //
 // This test requires bash loops and ulimit.
-// REQUIRES: shell
 // UNSUPPORTED: target={{.*win32.*}}
 //
 // Set up source files. lib/lib.h includes lots of lib*.h files in that dir.
@@ -12,10 +11,10 @@
 // RUN: mkdir %t
 // RUN: cd %t
 // RUN: mkdir lib
-// RUN: for i in {1..300}; do touch lib/lib$i.h; done
-// RUN: for i in {1..300}; do echo "#include \"lib$i.h\"" >> lib/lib.h; done
+// RUN: %python -c "from pathlib import Path; list(map(lambda i: Path(f'lib/lib{i}.h').touch(), range(1, 301)))"
+// RUN: %python -c "for i in range(1, 301): print(f'#include \"lib{i}.h\"')" > lib/lib.h
 // RUN: echo "#include \"lib/lib.h\"" > client.c
-// RUN: for i in {1..300}; do echo "#include \"lib/lib$i.h\"" >> client.c; done
+// RUN: %python -c "for i in range(1, 301): print(f'#include \"lib/lib{i}.h\"')" > client.c
 //
 // We want to verify that we don't hold all the files open at the same time.
 // This is important e.g. on mac, which has a low default FD limit.
diff --git a/clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp b/clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp
index 98e1a9afae6ea..df5d8c513d514 100644
--- a/clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp
+++ b/clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp
@@ -1,7 +1,6 @@
 // Only run this test where ulimit is known to work well.
 // (There's nothing really platform-specific being tested, this is just ulimit).
 //
-// REQUIRES: shell
 // REQUIRES: system-linux
 // UNSUPPORTED: msan
 // UNSUPPORTED: asan

Created using spr 1.3.6

[skip ci]
Created using spr 1.3.6
Created using spr 1.3.6

[skip ci]
Created using spr 1.3.6
Created using spr 1.3.6

[skip ci]
Created using spr 1.3.6
@boomanaiden154 boomanaiden154 changed the base branch from users/boomanaiden154/main.clang-port-ulimit-tests-to-work-with-internal-shell to main September 12, 2025 16:53
@boomanaiden154 boomanaiden154 merged commit e5db36b into main Sep 12, 2025
11 of 15 checks passed
@boomanaiden154 boomanaiden154 deleted the users/boomanaiden154/clang-port-ulimit-tests-to-work-with-internal-shell branch September 12, 2025 17:21
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Sep 16, 2025
Now that ulimit is implemented for the internal shell, we can make sure
that the clang tests utilizing ulimit actually work. One just needs the
removal of its shell requirement while the other one needs some rework
to avoid bash for loops. These are writtein in Python for about the same
amount of complexity.

Reviewers: ilovepi, cmtice, AaronBallman, Sirraide, petrhosek

Reviewed By: ilovepi

Pull Request: llvm/llvm-project#157977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants