From 526cbcd3d70ef65ba265b02cd67aa9263f8301e5 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Tue, 18 Nov 2025 20:07:51 -0800 Subject: [PATCH 1/2] [Fuzzer] make big-file-copy.test work with the internal shell This patch uses several shell features not supported by the internal shell, such as $? to get the exit code of a command, and exit. This patch adjusts the test to work with the internal shell by using bash to run the actual command with a zero exit code to ensure the file is deleted, and python to propagate the exit code up to lit. --- compiler-rt/test/fuzzer/big-file-copy.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/fuzzer/big-file-copy.test b/compiler-rt/test/fuzzer/big-file-copy.test index 9565ed4e0bca2..3008933794ae1 100644 --- a/compiler-rt/test/fuzzer/big-file-copy.test +++ b/compiler-rt/test/fuzzer/big-file-copy.test @@ -1,6 +1,6 @@ REQUIRES: darwin UNSUPPORTED: ios RUN: %cpp_compiler %S/BigFileCopy.cpp -o %t -RUN: %run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; result=$? +RUN: bash -c "%run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; echo -n $? > %t.result" RUN: %run rm -f big-file.txt big-file-out.txt -RUN: (exit $result) +RUN: %python -c "import sys; sys.exit(%{readfile:%t.result})" From b1dbe73837fd803ef2d10d5e2d125024905909e6 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Wed, 19 Nov 2025 09:15:14 -0800 Subject: [PATCH 2/2] feedback --- compiler-rt/test/fuzzer/big-file-copy.test | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler-rt/test/fuzzer/big-file-copy.test b/compiler-rt/test/fuzzer/big-file-copy.test index 3008933794ae1..b92379460ac3b 100644 --- a/compiler-rt/test/fuzzer/big-file-copy.test +++ b/compiler-rt/test/fuzzer/big-file-copy.test @@ -1,6 +1,5 @@ REQUIRES: darwin UNSUPPORTED: ios RUN: %cpp_compiler %S/BigFileCopy.cpp -o %t -RUN: bash -c "%run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; echo -n $? > %t.result" -RUN: %run rm -f big-file.txt big-file-out.txt -RUN: %python -c "import sys; sys.exit(%{readfile:%t.result})" +RUN: bash -c '%run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; result=$? \ +RUN: %run rm -f big-file.txt big-file-out.txt && exit $result'