From ffbce18df0a52af259dd84242a439b8adb6740cb Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 6 Sep 2025 06:54:45 +0000 Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 [skip ci] --- llvm/test/MC/COFF/stdin.s | 4 +--- llvm/test/Other/pipefail.txt | 2 -- .../merge-combined-funcmap-hashtree.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-funcmap-archive.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-funcmap-concat.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-funcmap-double.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-funcmap-single.test | 8 +++++--- .../tools/llvm-cgdata/merge-hashtree-archive.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-hashtree-concat.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-hashtree-double.test | 14 +++++++++----- .../tools/llvm-cgdata/merge-hashtree-single.test | 8 +++++--- llvm/test/tools/not/disable-symbolization.test | 4 ++-- .../lit/tests/Inputs/shtest-shell/pipefail.txt | 4 ++++ llvm/utils/lit/tests/shtest-shell.py | 8 +++++++- 14 files changed, 87 insertions(+), 49 deletions(-) delete mode 100644 llvm/test/Other/pipefail.txt create mode 100644 llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt diff --git a/llvm/test/MC/COFF/stdin.s b/llvm/test/MC/COFF/stdin.s index 9a22da5488e6d..8ceae7fdef501 100644 --- a/llvm/test/MC/COFF/stdin.s +++ b/llvm/test/MC/COFF/stdin.s @@ -1,3 +1 @@ -// REQUIRES: shell -// RUN: ( echo "test"; llvm-mc -filetype=obj -triple i686-pc-win32 %s ) > %t - +// RUN: bash -c '(echo "test"; llvm-mc -filetype=obj -triple i686-pc-win32 %s ) > %t' diff --git a/llvm/test/Other/pipefail.txt b/llvm/test/Other/pipefail.txt deleted file mode 100644 index 241080aab661c..0000000000000 --- a/llvm/test/Other/pipefail.txt +++ /dev/null @@ -1,2 +0,0 @@ -REQUIRES: shell -RUN: ((false | true) && echo true || echo false) | grep false diff --git a/llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test b/llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test index 70b83af407e5a..2a11fffc570d7 100644 --- a/llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test +++ b/llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Test merge a single object file having both __llvm_outline and __llvm_merge into a cgdata. @@ -8,15 +8,19 @@ RUN: split-file %s %t # Synthesize raw hashtree bytes without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-hashtree.cgtext -o %t/raw-hashtree.cgdata -RUN: od -t x1 -j 32 -An %t/raw-hashtree.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-hashtree-bytes.txt +RUN: echo -n "s//" > %t/raw-hashtree-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-hashtree.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-hashtree-sed.txt +RUN: echo "/g" >> %t/raw-hashtree-sed.txt # Synthesize raw funcmap bytes without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-funcmap.cgtext -o %t/raw-funcmap.cgdata -RUN: od -t x1 -j 32 -An %t/raw-funcmap.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-funcmap-bytes.txt +RUN: echo -n "s//" > %t/raw-funcmap-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-funcmap.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-funcmap-sed.txt +RUN: echo "/g" >> %t/raw-funcmap-sed.txt # Synthesize a bitcode file by creating two sections for the hash tree and the function map, respectively. -RUN: sed "s//$(cat %t/raw-hashtree-bytes.txt)/g" %t/merge-both-template.ll > %t/merge-both-hashtree-template.ll -RUN: sed "s//$(cat %t/raw-funcmap-bytes.txt)/g" %t/merge-both-hashtree-template.ll > %t/merge-both-hashtree-funcmap.ll +RUN: sed -f %t/raw-hashtree-sed.txt %t/merge-both-template.ll > %t/merge-both-hashtree-template.ll +RUN: sed -f %t/raw-funcmap-sed.txt %t/merge-both-hashtree-template.ll > %t/merge-both-hashtree-funcmap.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-both-hashtree-funcmap.ll -o %t/merge-both-hashtree-funcmap.o diff --git a/llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test b/llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test index c088ffbb4e83f..e95e1cea549d3 100644 --- a/llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test +++ b/llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge an archive that has two object files having cgdata (__llvm_merge) @@ -7,14 +7,18 @@ RUN: split-file %s %t # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-1-template.ll > %t/merge-1.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-2-template.ll > %t/merge-2.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o # Make an archive from two object files diff --git a/llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test b/llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test index 90b5992973b49..70038d3bf3d83 100644 --- a/llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test +++ b/llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge a binary file (e.g., a linked executable) having concatenated cgdata (__llvm_merge) @@ -8,11 +8,15 @@ RUN: split-file %s %t # Synthesize two sets of raw cgdata without the header (32 byte) from the indexed cgdata. # Concatenate them in merge-concat.ll RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat-template.ll > %t/merge-concat-template-2.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-concat-template.ll > %t/merge-concat-template-2.ll RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat-template-2.ll > %t/merge-concat.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-concat-template-2.ll > %t/merge-concat.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-concat.ll -o %t/merge-concat.o RUN: llvm-cgdata --merge --skip-trim %t/merge-concat.o -o %t/merge-concat.cgdata diff --git a/llvm/test/tools/llvm-cgdata/merge-funcmap-double.test b/llvm/test/tools/llvm-cgdata/merge-funcmap-double.test index b986aef26f1d7..21cda3439c511 100644 --- a/llvm/test/tools/llvm-cgdata/merge-funcmap-double.test +++ b/llvm/test/tools/llvm-cgdata/merge-funcmap-double.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge two object files having cgdata (__llvm_merge) @@ -7,14 +7,18 @@ RUN: split-file %s %t # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-1-template.ll > %t/merge-1.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-2-template.ll > %t/merge-2.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o # Merge two object files into the codegen data file. diff --git a/llvm/test/tools/llvm-cgdata/merge-funcmap-single.test b/llvm/test/tools/llvm-cgdata/merge-funcmap-single.test index eac852ff7e710..86e491bcf9c70 100644 --- a/llvm/test/tools/llvm-cgdata/merge-funcmap-single.test +++ b/llvm/test/tools/llvm-cgdata/merge-funcmap-single.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Test merge a single object file into a cgdata @@ -7,9 +7,11 @@ RUN: split-file %s %t # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-single.cgtext -o %t/raw-single.cgdata -RUN: od -t x1 -j 32 -An %t/raw-single.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-single-bytes.txt +RUN: echo -n "s//" > %t/raw-single-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-single.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-single-sed.txt +RUN: echo "/g" >> %t/raw-single-sed.txt -RUN: sed "s//$(cat %t/raw-single-bytes.txt)/g" %t/merge-single-template.ll > %t/merge-single.ll +RUN: sed -f %t/raw-single-sed.txt %t/merge-single-template.ll > %t/merge-single.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-single.ll -o %t/merge-single.o # Merge an object file having cgdata (__llvm_merge) diff --git a/llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test b/llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test index ee6345247c5be..91d6659aa81a4 100644 --- a/llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test +++ b/llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge an archive that has two object files having cgdata (__llvm_outline) @@ -7,14 +7,18 @@ RUN: split-file %s %t # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-1-template.ll > %t/merge-1.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-2-template.ll > %t/merge-2.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o # Make an archive from two object files diff --git a/llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test b/llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test index 5a3ece05a3f99..2bd3901c7230f 100644 --- a/llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test +++ b/llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge a binary file (e.g., a linked executable) having concatenated cgdata (__llvm_outline) @@ -8,11 +8,15 @@ RUN: split-file %s %t # Synthesize two sets of raw cgdata without the header (32 byte) from the indexed cgdata. # Concatenate them in merge-concat.ll RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat-template.ll > %t/merge-concat-template-2.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-concat-template.ll > %t/merge-concat-template-2.ll RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat-template-2.ll > %t/merge-concat.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-concat-template-2.ll > %t/merge-concat.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-concat.ll -o %t/merge-concat.o RUN: llvm-cgdata --merge %t/merge-concat.o -o %t/merge-concat.cgdata diff --git a/llvm/test/tools/llvm-cgdata/merge-hashtree-double.test b/llvm/test/tools/llvm-cgdata/merge-hashtree-double.test index 044a8649cf4ad..c95f097390f2b 100644 --- a/llvm/test/tools/llvm-cgdata/merge-hashtree-double.test +++ b/llvm/test/tools/llvm-cgdata/merge-hashtree-double.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Merge two object files having cgdata (__llvm_outline) @@ -7,14 +7,18 @@ RUN: split-file %s %t # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata -RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt -RUN: sed "s//$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll +RUN: echo -n "s//" > %t/raw-1-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-1-sed.txt +RUN: echo "/g" >> %t/raw-1-sed.txt +RUN: sed -f %t/raw-1-sed.txt %t/merge-1-template.ll > %t/merge-1.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata -RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt -RUN: sed "s//$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll +RUN: echo -n "s//" > %t/raw-2-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-2-sed.txt +RUN: echo "/g" >> %t/raw-2-sed.txt +RUN: sed -f %t/raw-2-sed.txt %t/merge-2-template.ll > %t/merge-2.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o # Merge two object files into the codegen data file. diff --git a/llvm/test/tools/llvm-cgdata/merge-hashtree-single.test b/llvm/test/tools/llvm-cgdata/merge-hashtree-single.test index 829c63f0f17a2..1af2156c17c8d 100644 --- a/llvm/test/tools/llvm-cgdata/merge-hashtree-single.test +++ b/llvm/test/tools/llvm-cgdata/merge-hashtree-single.test @@ -1,4 +1,4 @@ -# REQUIRES: shell, aarch64-registered-target +# REQUIRES: aarch64-registered-target # UNSUPPORTED: system-windows # Test merge a single object file into a cgdata @@ -13,9 +13,11 @@ RUN: llvm-cgdata --show %t/merge-empty.cgdata | count 0 # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata. RUN: llvm-cgdata --convert --format binary %t/raw-single.cgtext -o %t/raw-single.cgdata -RUN: od -t x1 -j 32 -An %t/raw-single.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-single-bytes.txt +RUN: echo -n "s//" > %t/raw-single-sed.txt +RUN: od -t x1 -j 32 -An %t/raw-single.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' >> %t/raw-single-sed.txt +RUN: echo "/g" >> %t/raw-single-sed.txt -RUN: sed "s//$(cat %t/raw-single-bytes.txt)/g" %t/merge-single-template.ll > %t/merge-single.ll +RUN: sed -f %t/raw-single-sed.txt %t/merge-single-template.ll > %t/merge-single.ll RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-single.ll -o %t/merge-single.o # Merge an object file having cgdata (__llvm_outline) diff --git a/llvm/test/tools/not/disable-symbolization.test b/llvm/test/tools/not/disable-symbolization.test index be11b17ea0250..58a418117f2db 100644 --- a/llvm/test/tools/not/disable-symbolization.test +++ b/llvm/test/tools/not/disable-symbolization.test @@ -1,8 +1,8 @@ # When building on Windows under cmd.exe and GnuWin32, 'env' fails if no # arguments are provided. # UNSUPPORTED: system-windows -# RUN: not --crash env > %t || true -# RUN: cmp -s %t /dev/null || FileCheck %s < %t +# RUN: not --crash bash -c env > %t || true +# RUN: FileCheck %s < %t # CHECK-DAG: LLVM_DISABLE_CRASH_REPORT=1 # CHECK-DAG: LLVM_DISABLE_SYMBOLIZATION=1 diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt b/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt new file mode 100644 index 0000000000000..b0d9dee4a2ced --- /dev/null +++ b/llvm/utils/lit/tests/Inputs/shtest-shell/pipefail.txt @@ -0,0 +1,4 @@ +# Check that we fail if earlier operations in a pipe fail. +# +# RUN: false | echo test +# \ No newline at end of file diff --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py index b8bdc6e532e3d..f964e8542db07 100644 --- a/llvm/utils/lit/tests/shtest-shell.py +++ b/llvm/utils/lit/tests/shtest-shell.py @@ -1,6 +1,7 @@ # Check the internal shell handling component of the ShTest format. # RUN: not %{lit} -v %{inputs}/shtest-shell > %t.out +# RUN: cat %t.out > /tmp/test # RUN: FileCheck --input-file %t.out %s # # Test again in non-UTF shell to catch potential errors with python 2 seen @@ -580,6 +581,11 @@ # CHECK: # error: command failed with exit status: 127 # CHECK: *** +# CHECK: FAIL: shtest-shell :: pipefail.txt +# CHECK: *** TEST 'shtest-shell :: pipefail.txt' FAILED *** +# CHECK: error: command failed with exit status: 1 +# CHECK: *** + # CHECK: PASS: shtest-shell :: redirects.txt # CHECK: FAIL: shtest-shell :: rm-error-0.txt @@ -629,4 +635,4 @@ # CHECK: PASS: shtest-shell :: valid-shell.txt # CHECK: Unresolved Tests (1) -# CHECK: Failed Tests (36) +# CHECK: Failed Tests (37) From 128c711b5cfa0a68d2505bc52f6ed64d8fbeed84 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 8 Sep 2025 17:29:11 +0000 Subject: [PATCH 2/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?UTF-8?q?anges=20introduced=20through=20rebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 [skip ci] --- llvm/test/MC/COFF/stdin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm/test/MC/COFF/stdin.py b/llvm/test/MC/COFF/stdin.py index 8b7b6ae1fba13..1d9b50c022523 100644 --- a/llvm/test/MC/COFF/stdin.py +++ b/llvm/test/MC/COFF/stdin.py @@ -1,14 +1,22 @@ # RUN: echo "// comment" > %t.input # RUN: which llvm-mc | %python %s %t +import argparse import subprocess import sys +parser = argparse.ArgumentParser() +parser.add_argument("temp_file") +arguments = parser.parse_args() + llvm_mc_binary = sys.stdin.readlines()[0].strip() -temp_file = sys.argv[1] +temp_file = arguments.temp_file input_file = temp_file + ".input" with open(temp_file, "w") as mc_stdout: + ## We need to test that starting on an input stream with a non-zero offset + ## does not trigger an assertion in WinCOFFObjectWriter.cpp, so we seek + ## past zero for STDOUT. mc_stdout.seek(4) subprocess.run( [llvm_mc_binary, "-filetype=obj", "-triple", "i686-pc-win32", input_file], From 6b04b3ce15b72cc848a6f0d59bd292b060a86ada Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 8 Sep 2025 17:43:49 +0000 Subject: [PATCH 3/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?UTF-8?q?anges=20introduced=20through=20rebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 [skip ci] --- llvm/test/MC/COFF/stdin.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/llvm/test/MC/COFF/stdin.py b/llvm/test/MC/COFF/stdin.py index 1d9b50c022523..0da1b4895142b 100644 --- a/llvm/test/MC/COFF/stdin.py +++ b/llvm/test/MC/COFF/stdin.py @@ -1,25 +1,30 @@ # RUN: echo "// comment" > %t.input -# RUN: which llvm-mc | %python %s %t +# RUN: which llvm-mc | %python %s %t.input %t import argparse import subprocess import sys parser = argparse.ArgumentParser() +parser.add_argument("input_file") parser.add_argument("temp_file") arguments = parser.parse_args() llvm_mc_binary = sys.stdin.readlines()[0].strip() -temp_file = arguments.temp_file -input_file = temp_file + ".input" -with open(temp_file, "w") as mc_stdout: +with open(arguments.temp_file, "w") as mc_stdout: ## We need to test that starting on an input stream with a non-zero offset ## does not trigger an assertion in WinCOFFObjectWriter.cpp, so we seek ## past zero for STDOUT. mc_stdout.seek(4) subprocess.run( - [llvm_mc_binary, "-filetype=obj", "-triple", "i686-pc-win32", input_file], + [ + llvm_mc_binary, + "-filetype=obj", + "-triple", + "i686-pc-win32", + arguments.input_file, + ], stdout=mc_stdout, check=True, ) From a3a3a9c954c93b18a5bbbcae3d42232b661cf7b6 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Tue, 9 Sep 2025 23:43:58 +0000 Subject: [PATCH 4/4] code formatting Created using spr 1.3.6 --- llvm/test/lit.cfg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py index e445bcc745815..e8861e29be707 100644 --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -37,9 +37,7 @@ if config.enable_profcheck else [] ) -config.test_format = lit.formats.ShTest( - not use_lit_shell, extra_substitutions -) +config.test_format = lit.formats.ShTest(not use_lit_shell, extra_substitutions) # suffixes: A list of file extensions to treat as test files. This is overriden # by individual lit.local.cfg files in the test subdirectories.