xref: /aosp_15_r20/external/llvm/test/tools/llvm-lto/thinlto.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test combined function index generation for ThinLTO via llvm-lto.
2*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %s -o %t.o
3*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
5*9880d681SAndroid Build Coastguard Worker; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
6*9880d681SAndroid Build Coastguard Worker; RUN: not test -e %t3
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; COMBINED: <MODULE_STRTAB_BLOCK
9*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}thinlto.ll.tmp{{.*}}.o'
10*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}thinlto.ll.tmp{{.*}}.o'
11*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: </MODULE_STRTAB_BLOCK
12*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <GLOBALVAL_SUMMARY_BLOCK
13*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <VERSION
14*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <COMBINED
15*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <COMBINED
16*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK
17*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <VALUE_SYMTAB
18*9880d681SAndroid Build Coastguard Worker; Check that the format is: op0=valueid, op1=offset, op2=funcguid,
19*9880d681SAndroid Build Coastguard Worker; where funcguid is the lower 64 bits of the function name MD5.
20*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
21*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
22*9880d681SAndroid Build Coastguard Worker; COMBINED-NEXT: </VALUE_SYMTAB
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerdefine void @f() {
25*9880d681SAndroid Build Coastguard Workerentry:
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28