1; RUN: opt -module-summary %s -o %t1.bc
2; RUN: opt -module-summary %p/Inputs/distributed_indexes.ll -o %t2.bc
3; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc
4; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-index %t.index.bc %t1.bc %t2.bc
5; RUN: llvm-bcanalyzer -dump %t1.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND1
6; RUN: llvm-bcanalyzer -dump %t2.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND2
7
8; The backend index for this module contains summaries from itself and
9; Inputs/distributed_indexes.ll, as it imports from the latter.
10; BACKEND1: <MODULE_STRTAB_BLOCK
11; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
12; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
13; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
14; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
15; BACKEND1-NEXT: <VERSION
16; BACKEND1-NEXT: <COMBINED
17; BACKEND1-NEXT: <COMBINED
18; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK
19; BACKEND1-NEXT: <VALUE_SYMTAB
20; Check that the format is: op0=valueid, op1=offset, op2=funcguid,
21; where funcguid is the lower 64 bits of the function name MD5.
22; BACKEND1-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
23; BACKEND1-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
24; BACKEND1-NEXT: </VALUE_SYMTAB
25
26; The backend index for Input/distributed_indexes.ll contains summaries from
27; itself only, as it does not import anything.
28; BACKEND2: <MODULE_STRTAB_BLOCK
29; BACKEND2-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp2.bc'
30; BACKEND2-NEXT: </MODULE_STRTAB_BLOCK
31; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
32; BACKEND2-NEXT: <VERSION
33; BACKEND2-NEXT: <COMBINED
34; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
35; BACKEND2-NEXT: <VALUE_SYMTAB
36; Check that the format is: op0=valueid, op1=offset, op2=funcguid,
37; where funcguid is the lower 64 bits of the function name MD5.
38; BACKEND2-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0=1 op1=-5300342847281564238
39; BACKEND2-NEXT: </VALUE_SYMTAB
40
41declare void @g(...)
42
43define void @f() {
44entry:
45  call void (...) @g()
46  ret void
47}
48