Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-funcmap-double.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REQUIRES: shell, aarch64-registered-target
# REQUIRES: aarch64-registered-target
# UNSUPPORTED: system-windows

# Merge two object files having cgdata (__llvm_merge)
Expand All @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions llvm/test/tools/llvm-cgdata/merge-funcmap-single.test
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-hashtree-archive.test
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-hashtree-concat.test
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions llvm/test/tools/llvm-cgdata/merge-hashtree-double.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REQUIRES: shell, aarch64-registered-target
# REQUIRES: aarch64-registered-target
# UNSUPPORTED: system-windows

# Merge two object files having cgdata (__llvm_outline)
Expand All @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions llvm/test/tools/llvm-cgdata/merge-hashtree-single.test
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
Loading