From 44a82c20eee5c841488ac6e098bda5d112ad217d Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 10 Sep 2025 15:52:42 -0700 Subject: [PATCH 1/2] [compiler-rt] Update fuzzer/focus-function.test to not require shell. Replace sub-shell for-loops with python calls so this test can run in the lit internal shell. This is part of our work migrating to use the internal shell as the default for lit tests. --- compiler-rt/test/fuzzer/focus-function.test | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler-rt/test/fuzzer/focus-function.test b/compiler-rt/test/fuzzer/focus-function.test index aa15692db358d..b9f0408cfa6d0 100644 --- a/compiler-rt/test/fuzzer/focus-function.test +++ b/compiler-rt/test/fuzzer/focus-function.test @@ -1,8 +1,7 @@ # Tests -focus_function # # TODO: don't require linux. -# Requires full shell support for the `for` loop syntax. -# REQUIRES: shell, linux +# REQUIRES: linux UNSUPPORTED: target=aarch64{{.*}} RUN: %cpp_compiler %S/OnlySomeBytesTest.cpp -o %t-exe @@ -22,9 +21,9 @@ FOCUS_F0: INFO: 0/1 inputs touch the focus function RUN: rm -rf %t-corpus RUN: mkdir %t-corpus # ABC triggers the focus function, others don't. -RUN: echo ABC$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABC -RUN: echo AXY$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/AXY -RUN: echo ABX$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABX +RUN: %python -c 'x_str = "ABC" + "x" * 2048; print(x_str)' > %t-corpus/ABC +RUN: %python -c 'x_str = "AXY" + "x" * 2048; print(x_str)' > %t-corpus/AXY +RUN: %python -c 'x_str = "ABX" + "x" * 2048; print(x_str)' > %t-corpus/ABX RUN: %run %t-exe -runs=10000 -focus_function=f0 %t-corpus 2>&1 | FileCheck %s --check-prefix=CORPUS_1_3 CORPUS_1_3: INFO: 1/3 inputs touch the focus function From 742fc032835bc3a48392887af04cbeb93d67324d Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 10 Sep 2025 16:04:52 -0700 Subject: [PATCH 2/2] Simplify change by bypassing temporaroy string 'x_str'. --- compiler-rt/test/fuzzer/focus-function.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler-rt/test/fuzzer/focus-function.test b/compiler-rt/test/fuzzer/focus-function.test index b9f0408cfa6d0..717af0e5c73b0 100644 --- a/compiler-rt/test/fuzzer/focus-function.test +++ b/compiler-rt/test/fuzzer/focus-function.test @@ -21,9 +21,9 @@ FOCUS_F0: INFO: 0/1 inputs touch the focus function RUN: rm -rf %t-corpus RUN: mkdir %t-corpus # ABC triggers the focus function, others don't. -RUN: %python -c 'x_str = "ABC" + "x" * 2048; print(x_str)' > %t-corpus/ABC -RUN: %python -c 'x_str = "AXY" + "x" * 2048; print(x_str)' > %t-corpus/AXY -RUN: %python -c 'x_str = "ABX" + "x" * 2048; print(x_str)' > %t-corpus/ABX +RUN: %python -c 'print("ABC" + "x" * 2048)' > %t-corpus/ABC +RUN: %python -c 'print("AXY" + "x" * 2048)' > %t-corpus/AXY +RUN: %python -c 'print("ABX" + "x" * 2048)' > %t-corpus/ABX RUN: %run %t-exe -runs=10000 -focus_function=f0 %t-corpus 2>&1 | FileCheck %s --check-prefix=CORPUS_1_3 CORPUS_1_3: INFO: 1/3 inputs touch the focus function