1 # REQUIRES: shell, aarch64-registered-target
2 # UNSUPPORTED: system-windows
4 # Test merge a single object file into a cgdata
8 # Merge an object file that has no cgdata (__llvm_outline). It still produces a header only cgdata.
9 RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-empty.ll -o %t/merge-empty.o
10 RUN: llvm-cgdata --merge %t/merge-empty.o --output %t/merge-empty.cgdata
11 # No summary appear with the header only cgdata.
12 RUN: llvm-cgdata --show %t/merge-empty.cgdata | count 0
14 # Synthesize raw cgdata without the header (32 byte) from the indexed cgdata.
15 RUN: llvm-cgdata --convert --format binary %t/raw-single.cgtext -o %t/raw-single.cgdata
16 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
18 RUN: sed "s/<RAW_1_BYTES>/$(cat %t/raw-single-bytes.txt)/g" %t/merge-single-template.ll > %t/merge-single.ll
19 RUN: llc -filetype=obj -mtriple arm64-apple-darwin %t/merge-single.ll -o %t/merge-single.o
21 # Merge an object file having cgdata (__llvm_outline)
22 RUN: llvm-cgdata -m %t/merge-single.o -o %t/merge-single.cgdata
23 RUN: llvm-cgdata -s %t/merge-single.cgdata | FileCheck %s
24 CHECK: Outlined hash tree:
25 CHECK-NEXT: Total Node Count: 3
26 CHECK-NEXT: Terminal Node Count: 1
30 @.data = private unnamed_addr constant [1 x i8] c"\01"
32 ;--- raw-single.cgtext
48 ;--- merge-single-template.ll
49 @.data = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"