Skip to content

Commit 14cf515

Browse files
authored
[compiler-rt] Update fuzzer/focus-function.test to not require shell. (#157967)
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.
1 parent afaea7f commit 14cf515

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler-rt/test/fuzzer/focus-function.test

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Tests -focus_function
22
#
33
# TODO: don't require linux.
4-
# Requires full shell support for the `for` loop syntax.
5-
# REQUIRES: shell, linux
4+
# REQUIRES: linux
65
UNSUPPORTED: target=aarch64{{.*}}
76

87
RUN: %cpp_compiler %S/OnlySomeBytesTest.cpp -o %t-exe
@@ -22,9 +21,9 @@ FOCUS_F0: INFO: 0/1 inputs touch the focus function
2221
RUN: rm -rf %t-corpus
2322
RUN: mkdir %t-corpus
2423
# ABC triggers the focus function, others don't.
25-
RUN: echo ABC$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABC
26-
RUN: echo AXY$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/AXY
27-
RUN: echo ABX$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABX
24+
RUN: %python -c 'print("ABC" + "x" * 2048)' > %t-corpus/ABC
25+
RUN: %python -c 'print("AXY" + "x" * 2048)' > %t-corpus/AXY
26+
RUN: %python -c 'print("ABX" + "x" * 2048)' > %t-corpus/ABX
2827

2928
RUN: %run %t-exe -runs=10000 -focus_function=f0 %t-corpus 2>&1 | FileCheck %s --check-prefix=CORPUS_1_3
3029
CORPUS_1_3: INFO: 1/3 inputs touch the focus function

0 commit comments

Comments
 (0)