Skip to content

Commit fd2ac7f

Browse files
kyulee-comcjdb
authored andcommitted
[CGData] Fix tests for sed without using options (llvm#105546)
This fixes a build issue for AIX -- llvm#101461.
1 parent 9e1dab7 commit fd2ac7f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

llvm/test/tools/llvm-cgdata/merge-archive.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ RUN: split-file %s %t
88
# Synthesize raw cgdata without the header (24 byte) from the indexed cgdata.
99
RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata
1010
RUN: od -t x1 -j 24 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt
11-
RUN: sed -ie "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1.ll
11+
RUN: sed "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
1212
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o
1313

1414
# Synthesize raw cgdata without the header (24 byte) from the indexed cgdata.
1515
RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata
1616
RUN: od -t x1 -j 24 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt
17-
RUN: sed -ie "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2.ll
17+
RUN: sed "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
1818
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o
1919

2020
# Make an archive from two object files
@@ -66,7 +66,7 @@ TREE-NEXT: ...
6666
SuccessorIds: [ ]
6767
...
6868

69-
;--- merge-1.ll
69+
;--- merge-1-template.ll
7070
@.data = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"
7171

7272

@@ -86,5 +86,5 @@ TREE-NEXT: ...
8686
SuccessorIds: [ ]
8787
...
8888

89-
;--- merge-2.ll
89+
;--- merge-2-template.ll
9090
@.data = private unnamed_addr constant [72 x i8] c"<RAW_2_BYTES>", section "__DATA,__llvm_outline"

llvm/test/tools/llvm-cgdata/merge-concat.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ RUN: split-file %s %t
99
# Concatenate them in merge-concat.ll
1010
RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata
1111
RUN: od -t x1 -j 24 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt
12-
RUN: sed -ie "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat.ll
12+
RUN: sed "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-concat-template.ll > %t/merge-concat-template-2.ll
1313
RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata
1414
RUN: od -t x1 -j 24 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt
15-
RUN: sed -ie "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat.ll
15+
RUN: sed "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-concat-template-2.ll > %t/merge-concat.ll
1616

1717
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-concat.ll -o %t/merge-concat.o
1818
RUN: llvm-cgdata --merge %t/merge-concat.o -o %t/merge-concat.cgdata
@@ -76,7 +76,7 @@ TREE-NEXT: ...
7676
SuccessorIds: [ ]
7777
...
7878

79-
;--- merge-concat.ll
79+
;--- merge-concat-template.ll
8080

8181
; In an linked executable (as opposed to an object file), cgdata in __llvm_outline might be concatenated. Although this is not a typical workflow, we simply support this case to parse cgdata that is concatenated. In other words, the following two trees are encoded back-to-back in a binary format.
8282
@.data1 = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"

llvm/test/tools/llvm-cgdata/merge-double.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ RUN: split-file %s %t
88
# Synthesize raw cgdata without the header (24 byte) from the indexed cgdata.
99
RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata
1010
RUN: od -t x1 -j 24 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-1-bytes.txt
11-
RUN: sed -ie "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1.ll
11+
RUN: sed "s/<RAW_1_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-1-template.ll > %t/merge-1.ll
1212
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-1.ll -o %t/merge-1.o
1313

1414
# Synthesize raw cgdata without the header (24 byte) from the indexed cgdata.
1515
RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata
1616
RUN: od -t x1 -j 24 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-2-bytes.txt
17-
RUN: sed -ie "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2.ll
17+
RUN: sed "s/<RAW_2_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-2-template.ll > %t/merge-2.ll
1818
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-2.ll -o %t/merge-2.o
1919

2020
# Merge two object files into the codegen data file.
@@ -64,7 +64,7 @@ TREE-NEXT: ...
6464
SuccessorIds: [ ]
6565
...
6666

67-
;--- merge-1.ll
67+
;--- merge-1-template.ll
6868
@.data = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"
6969

7070
;--- raw-2.cgtext
@@ -83,5 +83,5 @@ TREE-NEXT: ...
8383
SuccessorIds: [ ]
8484
...
8585

86-
;--- merge-2.ll
86+
;--- merge-2-template.ll
8787
@.data = private unnamed_addr constant [72 x i8] c"<RAW_2_BYTES>", section "__DATA,__llvm_outline"

llvm/test/tools/llvm-cgdata/merge-single.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN: llvm-cgdata --show %t/merge-empty.cgdata | count 0
1515
RUN: llvm-cgdata --convert --format binary %t/raw-single.cgtext -o %t/raw-single.cgdata
1616
RUN: od -t x1 -j 24 -An %t/raw-single.cgdata | tr -d '\n\r\t' | sed 's/[ ]*$//' | sed 's/[ ][ ]*/\\\\/g' > %t/raw-single-bytes.txt
1717

18-
RUN: sed -ie "s/<RAW_1_BYTES>/$(cat %t/raw-single-bytes.txt)/g" %t/merge-single.ll
18+
RUN: sed "s/<RAW_1_BYTES>/$(cat %t/raw-single-bytes.txt)/g" %t/merge-single-template.ll > %t/merge-single.ll
1919
RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-single.ll -o %t/merge-single.o
2020

2121
# Merge an object file having cgdata (__llvm_outline)
@@ -45,5 +45,5 @@ CHECK-NEXT: Depth: 2
4545
SuccessorIds: [ ]
4646
...
4747

48-
;--- merge-single.ll
48+
;--- merge-single-template.ll
4949
@.data = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"

0 commit comments

Comments
 (0)