blob: 371f38f5074ef7f5f87f754aaebcd9327ba7e399 [file] [log] [blame]
Teresa Johnson84174c32016-05-10 13:48:23 +00001; 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.
Teresa Johnson81bbf742017-12-16 00:18:12 +000010; We should import @g and alias @analias. While we don't import the aliasee
11; directly (and therefore don't have a third COMBINED record from module
12; id 1), we will have a VALUE_GUID for it (hence the 4 VALUE_GUID entries).
Teresa Johnson84174c32016-05-10 13:48:23 +000013; BACKEND1: <MODULE_STRTAB_BLOCK
14; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
15; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
16; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
17; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
18; BACKEND1-NEXT: <VERSION
Teresa Johnson9ecaaff2017-12-18 18:00:32 +000019; BACKEND1-DAG: <VALUE_GUID op0={{.*}} op1=-5751648690987223394
20; BACKEND1-DAG: <VALUE_GUID op0={{.*}} op1=-5300342847281564238
21; BACKEND1-DAG: <VALUE_GUID op0={{.*}} op1=-3706093650706652785
22; BACKEND1-DAG: <VALUE_GUID op0={{.*}} op1=-1039159065113703048
Teresa Johnson81bbf742017-12-16 00:18:12 +000023; BACKEND1-DAG: <COMBINED {{.*}} op1=0
24; BACKEND1-DAG: <COMBINED {{.*}} op1=1
25; BACKEND1-DAG: <COMBINED_ALIAS {{.*}} op1=1
Teresa Johnson84174c32016-05-10 13:48:23 +000026; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK
Teresa Johnson84174c32016-05-10 13:48:23 +000027
28; The backend index for Input/distributed_indexes.ll contains summaries from
29; itself only, as it does not import anything.
30; BACKEND2: <MODULE_STRTAB_BLOCK
31; BACKEND2-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp2.bc'
32; BACKEND2-NEXT: </MODULE_STRTAB_BLOCK
33; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
34; BACKEND2-NEXT: <VERSION
Teresa Johnson9ecaaff2017-12-18 18:00:32 +000035; BACKEND2-DAG: <VALUE_GUID op0={{.*}} op1=-5751648690987223394/>
36; BACKEND2-DAG: <VALUE_GUID op0={{.*}} op1=-5300342847281564238/>
37; BACKEND2-DAG: <VALUE_GUID op0={{.*}} op1=-1039159065113703048/>
Teresa Johnson84174c32016-05-10 13:48:23 +000038; BACKEND2-NEXT: <COMBINED
Teresa Johnson81bbf742017-12-16 00:18:12 +000039; BACKEND2-NEXT: <COMBINED
40; BACKEND2-NEXT: <COMBINED_ALIAS
Teresa Johnson84174c32016-05-10 13:48:23 +000041; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
Teresa Johnson84174c32016-05-10 13:48:23 +000042
Teresa Johnsonf8182f12018-07-03 01:11:43 +000043; Make sure that when the alias is imported as a copy of the aliasee, but the
44; aliasee is not being imported by itself, that we can still print the summary.
45; The aliasee should be "null".
46; RUN: llvm-dis %t1.bc.thinlto.bc -o - | FileCheck %s --check-prefix=DIS
47; DIS: aliasee: null
48
Teresa Johnson84174c32016-05-10 13:48:23 +000049declare void @g(...)
Teresa Johnson81bbf742017-12-16 00:18:12 +000050declare void @analias(...)
Teresa Johnson84174c32016-05-10 13:48:23 +000051
52define void @f() {
53entry:
54 call void (...) @g()
Teresa Johnson81bbf742017-12-16 00:18:12 +000055 call void (...) @analias()
Teresa Johnson84174c32016-05-10 13:48:23 +000056 ret void
57}