[libclc] Allow default path when looking for llvm-spirv (#126071)
[llvm-project.git] / llvm / test / tools / llvm-cgdata / merge-hashtree-single.test
blob829c63f0f17a2c9d7b6f2ae8b4cf009a3f894411
1 # REQUIRES: shell, aarch64-registered-target
2 # UNSUPPORTED: system-windows
4 # Test merge a single object file into a cgdata
6 RUN: split-file %s %t
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
27 CHECK-NEXT:  Depth: 2
29 ;--- merge-empty.ll
30 @.data = private unnamed_addr constant [1 x i8] c"\01"
32 ;--- raw-single.cgtext
33 :outlined_hash_tree
35   Hash:            0x0
36   Terminals:       0
37   SuccessorIds:    [ 1 ]
39   Hash:            0x1
40   Terminals:       0
41   SuccessorIds:    [ 2 ]
43   Hash:            0x2
44   Terminals:       4
45   SuccessorIds:    [  ]
46 ...
48 ;--- merge-single-template.ll
49 @.data = private unnamed_addr constant [72 x i8] c"<RAW_1_BYTES>", section "__DATA,__llvm_outline"