[llvm] 86b1e1b - [CGData] Rewrite tests to not use subshells
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 06:21:47 PDT 2025
Author: Aiden Grossman
Date: 2025-09-09T06:21:43-07:00
New Revision: 86b1e1b9720ed4cd892d18503667ab32b080a528
URL: https://github.com/llvm/llvm-project/commit/86b1e1b9720ed4cd892d18503667ab32b080a528
DIFF: https://github.com/llvm/llvm-project/commit/86b1e1b9720ed4cd892d18503667ab32b080a528.diff
LOG: [CGData] Rewrite tests to not use subshells
Subshells are not supported by lit's internal shell, which we want to
enable by default for the LLVM test suite. Rewrite the tests in
llvm/test/tools/llvm-cgdata to not use subshells so we can achieve this
without losing any test coverage.
Reviewers: kyulee-com, petrhosek, ilovepi
Reviewed By: ilovepi, petrhosek
Pull Request: https://github.com/llvm/llvm-project/pull/157234
Added:
Modified:
llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test
llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test
llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test
llvm/test/tools/llvm-cgdata/merge-funcmap-double.test
llvm/test/tools/llvm-cgdata/merge-funcmap-single.test
llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test
llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test
llvm/test/tools/llvm-cgdata/merge-hashtree-double.test
llvm/test/tools/llvm-cgdata/merge-hashtree-single.test
Removed:
################################################################################
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/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/$(cat %t/raw-hashtree-bytes.txt)/g" %t/merge-both-template.ll > %t/merge-both-hashtree-template.ll
-RUN: sed "s/<RAW_2_BYTES>/$(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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat-template.ll > %t/merge-concat-template-2.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat-template-2.ll > %t/merge-concat.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/" > %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/<RAW_1_BYTES>/$(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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat-template.ll > %t/merge-concat-template-2.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat-template-2.ll > %t/merge-concat.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
+RUN: echo -n "s/<RAW_1_BYTES>/" > %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/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
+RUN: echo -n "s/<RAW_2_BYTES>/" > %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/<RAW_1_BYTES>/" > %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/<RAW_1_BYTES>/$(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)
More information about the llvm-commits
mailing list